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/services/html_viewer/blink_platform_impl.h" | 9 #include "mojo/services/html_viewer/blink_platform_impl.h" |
10 #include "mojo/services/html_viewer/html_document_view.h" | 10 #include "mojo/services/html_viewer/html_document_view.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 connection->AddService<NavigatorImpl>(this); | 66 connection->AddService<NavigatorImpl>(this); |
67 view_manager::ViewManager::ConfigureIncomingConnection(connection, this); | 67 view_manager::ViewManager::ConfigureIncomingConnection(connection, this); |
68 return true; | 68 return true; |
69 } | 69 } |
70 | 70 |
71 // Overridden from view_manager::ViewManagerDelegate: | 71 // Overridden from view_manager::ViewManagerDelegate: |
72 virtual void OnRootAdded(view_manager::ViewManager* view_manager, | 72 virtual void OnRootAdded(view_manager::ViewManager* view_manager, |
73 view_manager::Node* root) OVERRIDE { | 73 view_manager::Node* root) OVERRIDE { |
74 document_view_ = new HTMLDocumentView( | 74 document_view_ = new HTMLDocumentView( |
75 application_impl_->ConnectToApplication("mojo://mojo_window_manager/")-> | 75 application_impl_->ConnectToApplication("mojo://mojo_window_manager/")-> |
76 GetServiceProvider(), view_manager); | 76 GetServiceProvider(), |
| 77 view_manager); |
77 document_view_->AttachToNode(root); | 78 document_view_->AttachToNode(root); |
78 MaybeLoad(); | 79 MaybeLoad(); |
79 } | 80 } |
80 virtual void OnViewManagerDisconnected( | 81 virtual void OnViewManagerDisconnected( |
81 view_manager::ViewManager* view_manager) OVERRIDE { | 82 view_manager::ViewManager* view_manager) OVERRIDE { |
82 base::MessageLoop::current()->Quit(); | 83 base::MessageLoop::current()->Quit(); |
83 } | 84 } |
84 | 85 |
85 void MaybeLoad() { | 86 void MaybeLoad() { |
86 if (document_view_ && response_) | 87 if (document_view_ && response_) |
(...skipping 16 matching lines...) Expand all Loading... |
103 navigation::ResponseDetailsPtr response_details) { | 104 navigation::ResponseDetailsPtr response_details) { |
104 viewer_->Load(response_details->response.Pass()); | 105 viewer_->Load(response_details->response.Pass()); |
105 } | 106 } |
106 | 107 |
107 // static | 108 // static |
108 ApplicationDelegate* ApplicationDelegate::Create() { | 109 ApplicationDelegate* ApplicationDelegate::Create() { |
109 return new HTMLViewer; | 110 return new HTMLViewer; |
110 } | 111 } |
111 | 112 |
112 } | 113 } |
OLD | NEW |