Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: services/kiosk_wm/kiosk_wm.cc

Issue 1100803002: Make ganesh_app's GaneshView actually observe its View. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « examples/ganesh_app/ganesh_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « examples/ganesh_app/ganesh_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698