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

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

Issue 805123003: Adds capture to the mojo window_manager. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: sky comments 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
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/view_targeter.h" 5 #include "services/window_manager/view_targeter.h"
6 6
7 #include "services/window_manager/capture_controller.h"
7 #include "services/window_manager/focus_controller.h" 8 #include "services/window_manager/focus_controller.h"
8 #include "services/window_manager/view_target.h" 9 #include "services/window_manager/view_target.h"
9 10
10 namespace window_manager { 11 namespace window_manager {
11 12
12 ViewTargeter::ViewTargeter() {} 13 ViewTargeter::ViewTargeter() {}
13 14
14 ViewTargeter::~ViewTargeter() {} 15 ViewTargeter::~ViewTargeter() {}
15 16
16 ui::EventTarget* ViewTargeter::FindTargetForEvent(ui::EventTarget* root, 17 ui::EventTarget* ViewTargeter::FindTargetForEvent(ui::EventTarget* root,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 79
79 return view_target; 80 return view_target;
80 } 81 }
81 82
82 ViewTarget* ViewTargeter::FindTargetInRootView(ViewTarget* root_view, 83 ViewTarget* ViewTargeter::FindTargetInRootView(ViewTarget* root_view,
83 const ui::LocatedEvent& event) { 84 const ui::LocatedEvent& event) {
84 // TODO(erg): This here is important because it resolves 85 // TODO(erg): This here is important because it resolves
85 // mouse_pressed_handler() in the aura version. This is what makes sure 86 // mouse_pressed_handler() in the aura version. This is what makes sure
86 // that a view gets both the mouse down and up. 87 // that a view gets both the mouse down and up.
87 88
88 // TODO(erg): We redirect to a currently active capture window here. Add this 89 CaptureController* capture_controller =
89 // when we have capture working. 90 GetCaptureController(root_view->view());
91 DCHECK(capture_controller);
92 mojo::View* capture_view = capture_controller->GetCapture();
93 if (capture_view)
94 return ViewTarget::TargetFromView(capture_view);
90 95
91 // TODO(erg): There's a whole bunch of junk about handling touch events 96 // TODO(erg): There's a whole bunch of junk about handling touch events
92 // here. Handle later. 97 // here. Handle later.
93 98
94 return nullptr; 99 return nullptr;
95 } 100 }
96 101
97 } // namespace window_manager 102 } // namespace window_manager
OLDNEW
« no previous file with comments | « services/window_manager/focus_controller_unittest.cc ('k') | services/window_manager/view_targeter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698