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

Side by Side Diff: ash/wm/workspace/multi_window_resize_controller.cc

Issue 10916221: Make ToplevelWindowEventFilter and WorkspaceEventFilter into event handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/wm/workspace/multi_window_resize_controller.h" 5 #include "ash/wm/workspace/multi_window_resize_controller.h"
6 6
7 #include "ash/screen_ash.h" 7 #include "ash/screen_ash.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/wm/window_animations.h" 10 #include "ash/wm/window_animations.h"
11 #include "ash/wm/workspace/workspace_event_filter.h" 11 #include "ash/wm/workspace/workspace_event_handler.h"
12 #include "ash/wm/workspace/workspace_window_resizer.h" 12 #include "ash/wm/workspace/workspace_window_resizer.h"
13 #include "grit/ui_resources.h" 13 #include "grit/ui_resources.h"
14 #include "ui/aura/client/screen_position_client.h" 14 #include "ui/aura/client/screen_position_client.h"
15 #include "ui/aura/event_filter.h" 15 #include "ui/aura/event_filter.h"
16 #include "ui/aura/root_window.h" 16 #include "ui/aura/root_window.h"
17 #include "ui/aura/shared/compound_event_filter.h" 17 #include "ui/aura/shared/compound_event_filter.h"
18 #include "ui/aura/window.h" 18 #include "ui/aura/window.h"
19 #include "ui/aura/window_delegate.h" 19 #include "ui/aura/window_delegate.h"
20 #include "ui/base/hit_test.h" 20 #include "ui/base/hit_test.h"
21 #include "ui/base/resource/resource_bundle.h" 21 #include "ui/base/resource/resource_bundle.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 MultiWindowResizeController::~MultiWindowResizeController() { 153 MultiWindowResizeController::~MultiWindowResizeController() {
154 window_resizer_.reset(); 154 window_resizer_.reset();
155 Hide(); 155 Hide();
156 } 156 }
157 157
158 void MultiWindowResizeController::Show(Window* window, 158 void MultiWindowResizeController::Show(Window* window,
159 int component, 159 int component,
160 const gfx::Point& point_in_window) { 160 const gfx::Point& point_in_window) {
161 // When the resize widget is showing we ignore Show() requests. Instead we 161 // When the resize widget is showing we ignore Show() requests. Instead we
162 // only care about mouse movements from MouseWatcher. This is necessary as 162 // only care about mouse movements from MouseWatcher. This is necessary as
163 // WorkspaceEventFilter only sees mouse movements over the windows, not all 163 // WorkspaceEventHandler only sees mouse movements over the windows, not all
164 // windows or over the desktop. 164 // windows or over the desktop.
165 if (resize_widget_.get()) 165 if (resize_widget_.get())
166 return; 166 return;
167 167
168 ResizeWindows windows(DetermineWindows(window, component, point_in_window)); 168 ResizeWindows windows(DetermineWindows(window, component, point_in_window));
169 if (IsShowing()) { 169 if (IsShowing()) {
170 if (windows_.Equals(windows)) 170 if (windows_.Equals(windows))
171 return; // Over the same windows. 171 return; // Over the same windows.
172 DelayedHide(); 172 DelayedHide();
173 } 173 }
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 503
504 gfx::Point window_loc(location_in_screen); 504 gfx::Point window_loc(location_in_screen);
505 aura::Window::ConvertPointToTarget( 505 aura::Window::ConvertPointToTarget(
506 window->GetRootWindow(), window, &window_loc); 506 window->GetRootWindow(), window, &window_loc);
507 return window->HitTest(window_loc) && 507 return window->HitTest(window_loc) &&
508 window->delegate()->GetNonClientComponent(window_loc) == component; 508 window->delegate()->GetNonClientComponent(window_loc) == component;
509 } 509 }
510 510
511 } // namespace internal 511 } // namespace internal
512 } // namespace ash 512 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/toplevel_window_event_handler_unittest.cc ('k') | ash/wm/workspace/multi_window_resize_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698