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/kiosk_wm/kiosk_wm.h" | 5 #include "mojo/services/kiosk_wm/kiosk_wm.h" |
6 | 6 |
7 #include "mojo/services/kiosk_wm/merged_service_provider.h" | 7 #include "mojo/services/kiosk_wm/merged_service_provider.h" |
8 #include "mojo/services/window_manager/basic_focus_rules.h" | 8 #include "mojo/services/window_manager/basic_focus_rules.h" |
9 | 9 |
10 namespace kiosk_wm { | 10 namespace kiosk_wm { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 | 47 |
48 void KioskWM::OnEmbed( | 48 void KioskWM::OnEmbed( |
49 mojo::View* root, | 49 mojo::View* root, |
50 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 50 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
51 mojo::ServiceProviderPtr exposed_services) { | 51 mojo::ServiceProviderPtr exposed_services) { |
52 // KioskWM does not support being embedded more than once. | 52 // KioskWM does not support being embedded more than once. |
53 CHECK(!root_); | 53 CHECK(!root_); |
54 | 54 |
55 root_ = root; | 55 root_ = root; |
56 root_->AddObserver(this); | 56 root_->AddObserver(this); |
57 | 57 |
cpu_(ooo_6.6-7.5)
2015/04/06 20:43:48
ifdef(os_win) ?
I mean keep both sizes
jam
2015/04/06 22:02:51
this is only used on desktop, so it's not hit on a
sky
2015/04/08 19:17:46
Actually, we do use this on the device as well. I
jam
2015/04/10 01:29:55
ah I was mistaken, thanks for clarifying. I'll und
| |
58 // Resize to match the Nexus 5 aspect ratio: | 58 window_manager_app_->SetViewportSize(gfx::Size(1280, 800)); |
59 window_manager_app_->SetViewportSize(gfx::Size(320, 640)); | |
60 | 59 |
61 content_ = root->view_manager()->CreateView(); | 60 content_ = root->view_manager()->CreateView(); |
62 content_->SetBounds(root_->bounds()); | 61 content_->SetBounds(root_->bounds()); |
63 root_->AddChild(content_); | 62 root_->AddChild(content_); |
64 content_->SetVisible(true); | 63 content_->SetVisible(true); |
65 | 64 |
66 window_manager_app_->InitFocus( | 65 window_manager_app_->InitFocus( |
67 make_scoped_ptr(new window_manager::BasicFocusRules(root_))); | 66 make_scoped_ptr(new window_manager::BasicFocusRules(root_))); |
68 window_manager_app_->accelerator_manager()->Register( | 67 window_manager_app_->accelerator_manager()->Register( |
69 ui::Accelerator(ui::VKEY_BROWSER_BACK, 0), | 68 ui::Accelerator(ui::VKEY_BROWSER_BACK, 0), |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 return false; | 124 return false; |
126 navigator_host_.RequestNavigateHistory(-1); | 125 navigator_host_.RequestNavigateHistory(-1); |
127 return true; | 126 return true; |
128 } | 127 } |
129 | 128 |
130 bool KioskWM::CanHandleAccelerators() const { | 129 bool KioskWM::CanHandleAccelerators() const { |
131 return true; | 130 return true; |
132 } | 131 } |
133 | 132 |
134 } // namespace kiosk_wm | 133 } // namespace kiosk_wm |
OLD | NEW |