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: ash/wm/workspace/multi_window_resize_controller.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix new addition Created 8 years, 2 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_handler.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 (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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 else 423 else
424 bounds.set_x(show_bounds_in_screen_.x()); 424 bounds.set_x(show_bounds_in_screen_.x());
425 resize_widget_->SetBounds(bounds); 425 resize_widget_->SetBounds(bounds);
426 } 426 }
427 427
428 void MultiWindowResizeController::CompleteResize(int event_flags) { 428 void MultiWindowResizeController::CompleteResize(int event_flags) {
429 window_resizer_->CompleteDrag(event_flags); 429 window_resizer_->CompleteDrag(event_flags);
430 window_resizer_.reset(); 430 window_resizer_.reset();
431 431
432 // Mouse may still be over resizer, if not hide. 432 // Mouse may still be over resizer, if not hide.
433 gfx::Point screen_loc = gfx::Screen::GetCursorScreenPoint(); 433 gfx::Point screen_loc = Shell::GetScreen()->GetCursorScreenPoint();
434 if (!resize_widget_->GetWindowBoundsInScreen().Contains(screen_loc)) { 434 if (!resize_widget_->GetWindowBoundsInScreen().Contains(screen_loc)) {
435 Hide(); 435 Hide();
436 } else { 436 } else {
437 // If the mouse is over the resizer we need to remove observers on any of 437 // If the mouse is over the resizer we need to remove observers on any of
438 // the |other_windows|. If we start another resize we'll recalculate the 438 // the |other_windows|. If we start another resize we'll recalculate the
439 // |other_windows| and invoke AddObserver() as necessary. 439 // |other_windows| and invoke AddObserver() as necessary.
440 for (size_t i = 0; i < windows_.other_windows.size(); ++i) 440 for (size_t i = 0; i < windows_.other_windows.size(); ++i)
441 windows_.other_windows[i]->RemoveObserver(this); 441 windows_.other_windows[i]->RemoveObserver(this);
442 windows_.other_windows.clear(); 442 windows_.other_windows.clear();
443 } 443 }
(...skipping 59 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/workspace/frame_maximize_button.cc ('k') | ash/wm/workspace/workspace_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698