| 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 "mojo/services/window_manager/window_manager_app.h" | 5 #include "mojo/services/window_manager/window_manager_app.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "mojo/converters/geometry/geometry_type_converters.h" | 9 #include "mojo/converters/geometry/geometry_type_converters.h" |
| 10 #include "mojo/converters/input_events/input_events_type_converters.h" | 10 #include "mojo/converters/input_events/input_events_type_converters.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 focus_controller_->ActivateView(view); | 116 focus_controller_->ActivateView(view); |
| 117 } | 117 } |
| 118 | 118 |
| 119 bool WindowManagerApp::IsReady() const { | 119 bool WindowManagerApp::IsReady() const { |
| 120 return view_manager_ && root_; | 120 return view_manager_ && root_; |
| 121 } | 121 } |
| 122 | 122 |
| 123 void WindowManagerApp::InitFocus(scoped_ptr<mojo::FocusRules> rules) { | 123 void WindowManagerApp::InitFocus(scoped_ptr<mojo::FocusRules> rules) { |
| 124 focus_controller_.reset(new mojo::FocusController(rules.Pass())); | 124 focus_controller_.reset(new mojo::FocusController(rules.Pass())); |
| 125 focus_controller_->AddObserver(this); | 125 focus_controller_->AddObserver(this); |
| 126 |
| 127 DCHECK(root_); |
| 128 SetFocusController(root_, focus_controller_.get()); |
| 126 } | 129 } |
| 127 | 130 |
| 128 void WindowManagerApp::Embed( | 131 void WindowManagerApp::Embed( |
| 129 const String& url, | 132 const String& url, |
| 130 InterfaceRequest<ServiceProvider> service_provider) { | 133 InterfaceRequest<ServiceProvider> service_provider) { |
| 131 if (view_manager_) { | 134 if (view_manager_) { |
| 132 window_manager_delegate_->Embed(url, service_provider.Pass()); | 135 window_manager_delegate_->Embed(url, service_provider.Pass()); |
| 133 return; | 136 return; |
| 134 } | 137 } |
| 135 scoped_ptr<PendingEmbed> pending_embed(new PendingEmbed); | 138 scoped_ptr<PendingEmbed> pending_embed(new PendingEmbed); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 view_manager_app->ConnectToService(&window_manager_client_); | 337 view_manager_app->ConnectToService(&window_manager_client_); |
| 335 } | 338 } |
| 336 | 339 |
| 337 void WindowManagerApp::Create(ApplicationConnection* connection, | 340 void WindowManagerApp::Create(ApplicationConnection* connection, |
| 338 InterfaceRequest<WindowManagerInternal> request) { | 341 InterfaceRequest<WindowManagerInternal> request) { |
| 339 WindowManagerInternalImpl* impl = new WindowManagerInternalImpl(this); | 342 WindowManagerInternalImpl* impl = new WindowManagerInternalImpl(this); |
| 340 BindToRequest(impl, &request); | 343 BindToRequest(impl, &request); |
| 341 } | 344 } |
| 342 | 345 |
| 343 } // namespace mojo | 346 } // namespace mojo |
| OLD | NEW |