Use int64 more pervasively in storing time s/ms/us values.
[chromium-blink-merge.git] / mojo / shell / view_manager_loader.cc
blob91280846383d8dd34791bd6b6231806db2aa4770
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "mojo/shell/view_manager_loader.h"
7 #include "mojo/public/cpp/application/application_connection.h"
8 #include "mojo/public/cpp/application/application_impl.h"
9 #include "mojo/services/view_manager/view_manager_init_service_impl.h"
11 namespace mojo {
13 using service::ViewManagerInitServiceImpl;
15 namespace shell {
17 ViewManagerLoader::ViewManagerLoader() {
20 ViewManagerLoader::~ViewManagerLoader() {
23 void ViewManagerLoader::Load(ApplicationManager* manager,
24 const GURL& url,
25 scoped_refptr<LoadCallbacks> callbacks) {
26 ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication();
27 if (!shell_handle.is_valid())
28 return;
30 // TODO(sky): this needs some sort of authentication as well as making sure
31 // we only ever have one active at a time.
32 scoped_ptr<ApplicationImpl> app(
33 new ApplicationImpl(this, shell_handle.Pass()));
34 apps_.push_back(app.release());
37 void ViewManagerLoader::OnApplicationError(ApplicationManager* manager,
38 const GURL& url) {
41 bool ViewManagerLoader::ConfigureIncomingConnection(
42 ApplicationConnection* connection) {
43 context_.ConfigureIncomingConnection(connection);
44 connection->AddService(this);
45 return true;
48 void ViewManagerLoader::Create(
49 ApplicationConnection* connection,
50 InterfaceRequest<ViewManagerInitService> request) {
51 BindToRequest(new ViewManagerInitServiceImpl(connection, &context_),
52 &request);
55 } // namespace shell
56 } // namespace mojo