| 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 "services/kiosk_wm/kiosk_wm.h" | 5 #include "services/kiosk_wm/kiosk_wm.h" |
| 6 | 6 |
| 7 #include "services/kiosk_wm/merged_service_provider.h" | 7 #include "services/kiosk_wm/merged_service_provider.h" |
| 8 #include "services/window_manager/basic_focus_rules.h" | 8 #include "services/window_manager/basic_focus_rules.h" |
| 9 | 9 |
| 10 namespace kiosk_wm { | 10 namespace kiosk_wm { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 void KioskWM::OnViewManagerDisconnected( | 103 void KioskWM::OnViewManagerDisconnected( |
| 104 mojo::ViewManager* view_manager) { | 104 mojo::ViewManager* view_manager) { |
| 105 root_ = nullptr; | 105 root_ = nullptr; |
| 106 } | 106 } |
| 107 | 107 |
| 108 void KioskWM::OnViewDestroyed(mojo::View* view) { | 108 void KioskWM::OnViewDestroyed(mojo::View* view) { |
| 109 view->RemoveObserver(this); | 109 view->RemoveObserver(this); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void KioskWM::OnViewBoundsChanged(mojo::View* view, | 112 void KioskWM::OnViewBoundsChanged(mojo::View* view, |
| 113 const mojo::Rect& old_bounds, | 113 const mojo::Rect& old_bounds, |
| 114 const mojo::Rect& new_bounds) { | 114 const mojo::Rect& new_bounds) { |
| 115 content_->SetBounds(new_bounds); | 115 content_->SetBounds(new_bounds); |
| 116 } | 116 } |
| 117 | 117 |
| 118 // Convenience method: | 118 // Convenience method: |
| 119 void KioskWM::ReplaceContentWithURL(const mojo::String& url) { | 119 void KioskWM::ReplaceContentWithURL(const mojo::String& url) { |
| 120 Embed(url, nullptr, nullptr); | 120 Embed(url, nullptr, nullptr); |
| 121 } | 121 } |
| 122 | 122 |
| 123 bool KioskWM::AcceleratorPressed(const ui::Accelerator& accelerator, | 123 bool KioskWM::AcceleratorPressed(const ui::Accelerator& accelerator, |
| 124 mojo::View* target) { | 124 mojo::View* target) { |
| 125 if (accelerator.key_code() != ui::VKEY_BROWSER_BACK) | 125 if (accelerator.key_code() != ui::VKEY_BROWSER_BACK) |
| 126 return false; | 126 return false; |
| 127 navigator_host_.RequestNavigateHistory(-1); | 127 navigator_host_.RequestNavigateHistory(-1); |
| 128 return true; | 128 return true; |
| 129 } | 129 } |
| 130 | 130 |
| 131 bool KioskWM::CanHandleAccelerators() const { | 131 bool KioskWM::CanHandleAccelerators() const { |
| 132 return true; | 132 return true; |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace kiosk_wm | 135 } // namespace kiosk_wm |
| OLD | NEW |