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

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

Issue 10827145: Convert Aura to use ui::Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « ash/wm/workspace/frame_maximize_button.cc ('k') | ash/wm/workspace/workspace_event_filter.h » ('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 (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"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 DelayedHide(); 173 DelayedHide();
174 } 174 }
175 175
176 if (!windows.is_valid()) 176 if (!windows.is_valid())
177 return; 177 return;
178 Hide(); 178 Hide();
179 windows_ = windows; 179 windows_ = windows;
180 windows_.window1->AddObserver(this); 180 windows_.window1->AddObserver(this);
181 windows_.window2->AddObserver(this); 181 windows_.window2->AddObserver(this);
182 show_location_in_parent_ = point_in_window; 182 show_location_in_parent_ = point_in_window;
183 Window::ConvertPointToWindow( 183 Window::ConvertPointToTarget(
184 window, window->parent(), &show_location_in_parent_); 184 window, window->parent(), &show_location_in_parent_);
185 if (show_timer_.IsRunning()) 185 if (show_timer_.IsRunning())
186 return; 186 return;
187 show_timer_.Start(FROM_HERE, 187 show_timer_.Start(FROM_HERE,
188 base::TimeDelta::FromMilliseconds(kShowDelayMS), 188 base::TimeDelta::FromMilliseconds(kShowDelayMS),
189 this, &MultiWindowResizeController::ShowNow); 189 this, &MultiWindowResizeController::ShowNow);
190 } 190 }
191 191
192 void MultiWindowResizeController::Hide() { 192 void MultiWindowResizeController::Hide() {
193 hide_timer_.Stop(); 193 hide_timer_.Stop();
(...skipping 24 matching lines...) Expand all
218 Hide(); 218 Hide();
219 } 219 }
220 220
221 MultiWindowResizeController::ResizeWindows 221 MultiWindowResizeController::ResizeWindows
222 MultiWindowResizeController::DetermineWindows( 222 MultiWindowResizeController::DetermineWindows(
223 Window* window, 223 Window* window,
224 int window_component, 224 int window_component,
225 const gfx::Point& point) const { 225 const gfx::Point& point) const {
226 ResizeWindows result; 226 ResizeWindows result;
227 gfx::Point point_in_parent(point); 227 gfx::Point point_in_parent(point);
228 Window::ConvertPointToWindow(window, window->parent(), &point_in_parent); 228 Window::ConvertPointToTarget(window, window->parent(), &point_in_parent);
229 switch (window_component) { 229 switch (window_component) {
230 case HTRIGHT: 230 case HTRIGHT:
231 result.direction = LEFT_RIGHT; 231 result.direction = LEFT_RIGHT;
232 result.window1 = window; 232 result.window1 = window;
233 result.window2 = FindWindowByEdge( 233 result.window2 = FindWindowByEdge(
234 window, HTLEFT, window->bounds().right(), point_in_parent.y()); 234 window, HTLEFT, window->bounds().right(), point_in_parent.y());
235 break; 235 break;
236 case HTLEFT: 236 case HTLEFT:
237 result.direction = LEFT_RIGHT; 237 result.direction = LEFT_RIGHT;
238 result.window1 = FindWindowByEdge( 238 result.window1 = FindWindowByEdge(
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 } 498 }
499 499
500 bool MultiWindowResizeController::IsOverWindow( 500 bool MultiWindowResizeController::IsOverWindow(
501 aura::Window* window, 501 aura::Window* window,
502 const gfx::Point& location_in_screen, 502 const gfx::Point& location_in_screen,
503 int component) const { 503 int component) const {
504 if (!window->delegate()) 504 if (!window->delegate())
505 return false; 505 return false;
506 506
507 gfx::Point window_loc(location_in_screen); 507 gfx::Point window_loc(location_in_screen);
508 aura::Window::ConvertPointToWindow( 508 aura::Window::ConvertPointToTarget(
509 window->GetRootWindow(), window, &window_loc); 509 window->GetRootWindow(), window, &window_loc);
510 return window->HitTest(window_loc) && 510 return window->HitTest(window_loc) &&
511 window->delegate()->GetNonClientComponent(window_loc) == component; 511 window->delegate()->GetNonClientComponent(window_loc) == component;
512 } 512 }
513 513
514 } // namespace internal 514 } // namespace internal
515 } // namespace ash 515 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/frame_maximize_button.cc ('k') | ash/wm/workspace/workspace_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698