| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 #include "mojo/public/cpp/application/application_connection.h" | 6 #include "mojo/public/cpp/application/application_connection.h" |
| 7 #include "mojo/public/cpp/application/application_delegate.h" | 7 #include "mojo/public/cpp/application/application_delegate.h" |
| 8 #include "mojo/public/cpp/application/application_impl.h" | 8 #include "mojo/public/cpp/application/application_impl.h" |
| 9 #include "mojo/public/cpp/application/interface_factory_impl.h" | 9 #include "mojo/public/cpp/application/interface_factory_impl.h" |
| 10 #include "mojo/services/html_viewer/blink_platform_impl.h" | 10 #include "mojo/services/html_viewer/blink_platform_impl.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 | 66 |
| 67 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) | 67 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) |
| 68 OVERRIDE { | 68 OVERRIDE { |
| 69 connection->AddService(&navigator_factory_); | 69 connection->AddService(&navigator_factory_); |
| 70 connection->AddService(&view_manager_client_factory_); | 70 connection->AddService(&view_manager_client_factory_); |
| 71 return true; | 71 return true; |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Overridden from ViewManagerDelegate: | 74 // Overridden from ViewManagerDelegate: |
| 75 virtual void OnEmbed(ViewManager* view_manager, Node* root) OVERRIDE { | 75 virtual void OnEmbed(ViewManager* view_manager, |
| 76 Node* root, |
| 77 ExportedServiceRegistry* exported_services, |
| 78 scoped_ptr<ServiceProvider> imported_services) OVERRIDE { |
| 76 document_view_ = new HTMLDocumentView( | 79 document_view_ = new HTMLDocumentView( |
| 77 application_impl_->ConnectToApplication("mojo://mojo_window_manager/")-> | 80 application_impl_->ConnectToApplication("mojo://mojo_window_manager/")-> |
| 78 GetServiceProvider(), | 81 GetServiceProvider(), |
| 79 view_manager); | 82 view_manager); |
| 80 document_view_->AttachToNode(root); | 83 document_view_->AttachToNode(root); |
| 81 MaybeLoad(); | 84 MaybeLoad(); |
| 82 } | 85 } |
| 83 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE { | 86 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE { |
| 84 base::MessageLoop::current()->Quit(); | 87 base::MessageLoop::current()->Quit(); |
| 85 } | 88 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 107 ResponseDetailsPtr response_details) { | 110 ResponseDetailsPtr response_details) { |
| 108 viewer_->Load(response_details->response.Pass()); | 111 viewer_->Load(response_details->response.Pass()); |
| 109 } | 112 } |
| 110 | 113 |
| 111 // static | 114 // static |
| 112 ApplicationDelegate* ApplicationDelegate::Create() { | 115 ApplicationDelegate* ApplicationDelegate::Create() { |
| 113 return new HTMLViewer; | 116 return new HTMLViewer; |
| 114 } | 117 } |
| 115 | 118 |
| 116 } | 119 } |
| OLD | NEW |