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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "mojo/common/common_type_converters.h" | 8 #include "mojo/common/common_type_converters.h" |
9 #include "mojo/examples/window_manager/window_manager.mojom.h" | 9 #include "mojo/examples/window_manager/window_manager.mojom.h" |
10 #include "mojo/public/cpp/application/application_connection.h" | 10 #include "mojo/public/cpp/application/application_connection.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 params.delegate = widget_delegate; | 196 params.delegate = widget_delegate; |
197 params.bounds = gfx::Rect(node->bounds().width(), node->bounds().height()); | 197 params.bounds = gfx::Rect(node->bounds().width(), node->bounds().height()); |
198 widget_->Init(params); | 198 widget_->Init(params); |
199 // KeyboardManager handles deleting itself when the widget is destroyed. | 199 // KeyboardManager handles deleting itself when the widget is destroyed. |
200 new KeyboardManager(widget_, window_manager_.get(), node); | 200 new KeyboardManager(widget_, window_manager_.get(), node); |
201 widget_->Show(); | 201 widget_->Show(); |
202 textfield->RequestFocus(); | 202 textfield->RequestFocus(); |
203 } | 203 } |
204 | 204 |
205 // ViewManagerDelegate: | 205 // ViewManagerDelegate: |
206 virtual void OnEmbed(ViewManager* view_manager, Node* root) OVERRIDE { | 206 virtual void OnEmbed(ViewManager* view_manager, |
| 207 Node* root, |
| 208 ServiceProviderImpl* exported_services, |
| 209 scoped_ptr<ServiceProvider> imported_services) OVERRIDE { |
207 // TODO: deal with OnEmbed() being invoked multiple times. | 210 // TODO: deal with OnEmbed() being invoked multiple times. |
208 view_manager_ = view_manager; | 211 view_manager_ = view_manager; |
209 root_ = root; | 212 root_ = root; |
210 root_->AddObserver(this); | 213 root_->AddObserver(this); |
211 root_->SetActiveView(View::Create(view_manager)); | 214 root_->SetActiveView(View::Create(view_manager)); |
212 root_->SetFocus(); | 215 root_->SetFocus(); |
213 CreateWidget(root_); | 216 CreateWidget(root_); |
214 } | 217 } |
215 virtual void OnViewManagerDisconnected( | 218 virtual void OnViewManagerDisconnected( |
216 ViewManager* view_manager) OVERRIDE { | 219 ViewManager* view_manager) OVERRIDE { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 }; | 266 }; |
264 | 267 |
265 } // namespace examples | 268 } // namespace examples |
266 | 269 |
267 // static | 270 // static |
268 ApplicationDelegate* ApplicationDelegate::Create() { | 271 ApplicationDelegate* ApplicationDelegate::Create() { |
269 return new examples::Browser; | 272 return new examples::Browser; |
270 } | 273 } |
271 | 274 |
272 } // namespace mojo | 275 } // namespace mojo |
OLD | NEW |