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

Side by Side Diff: services/window_manager/focus_controller.cc

Issue 781603002: Port even more FocusController tests. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Initialize my member variables. Created 6 years 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 | « no previous file | services/window_manager/focus_controller_unittest.cc » ('j') | 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/window_manager/focus_controller.h" 5 #include "services/window_manager/focus_controller.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "mojo/services/public/cpp/view_manager/view_property.h" 8 #include "mojo/services/public/cpp/view_manager/view_property.h"
9 #include "mojo/services/public/cpp/view_manager/view_tracker.h" 9 #include "mojo/services/public/cpp/view_manager/view_tracker.h"
10 #include "services/window_manager/focus_controller_observer.h" 10 #include "services/window_manager/focus_controller_observer.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 void FocusController::OnGestureEvent(ui::GestureEvent* event) { 139 void FocusController::OnGestureEvent(ui::GestureEvent* event) {
140 if (event->type() == ui::ET_GESTURE_BEGIN && 140 if (event->type() == ui::ET_GESTURE_BEGIN &&
141 event->details().touch_points() == 1 && 141 event->details().touch_points() == 1 &&
142 !event->handled()) { 142 !event->handled()) {
143 View* view = static_cast<ViewTarget*>(event->target())->view(); 143 View* view = static_cast<ViewTarget*>(event->target())->view();
144 ViewFocusedFromInputEvent(view); 144 ViewFocusedFromInputEvent(view);
145 } 145 }
146 } 146 }
147 147
148 //////////////////////////////////////////////////////////////////////////////// 148 ////////////////////////////////////////////////////////////////////////////////
149 // FocusController, aura::WindowObserver implementation: 149 // FocusController, mojo::ViewObserver implementation:
150 150
151 void FocusController::OnViewVisibilityChanged(View* view) { 151 void FocusController::OnViewVisibilityChanged(View* view) {
152 bool visible = view->visible(); 152 bool visible = view->visible();
153 if (!visible) 153 if (!visible)
154 ViewLostFocusFromDispositionChange(view, view->parent()); 154 ViewLostFocusFromDispositionChange(view, view->parent());
155 } 155 }
156 156
157 void FocusController::OnViewDestroying(View* view) { 157 void FocusController::OnViewDestroying(View* view) {
158 ViewLostFocusFromDispositionChange(view, view->parent()); 158 ViewLostFocusFromDispositionChange(view, view->parent());
159 } 159 }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 } 311 }
312 312
313 FocusController* GetFocusController(View* root_view) { 313 FocusController* GetFocusController(View* root_view) {
314 if (root_view) 314 if (root_view)
315 DCHECK_EQ(root_view->GetRoot(), root_view); 315 DCHECK_EQ(root_view->GetRoot(), root_view);
316 return root_view ? 316 return root_view ?
317 root_view->GetLocalProperty(kRootViewFocusController) : nullptr; 317 root_view->GetLocalProperty(kRootViewFocusController) : nullptr;
318 } 318 }
319 319
320 } // namespace mojo 320 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | services/window_manager/focus_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698