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

Side by Side Diff: ash/wm/maximize_bubble_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 some new gfx::Screen additions 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
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/maximize_bubble_controller.h" 5 #include "ash/wm/maximize_bubble_controller.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/wm/window_animations.h" 9 #include "ash/wm/window_animations.h"
10 #include "ash/wm/workspace/frame_maximize_button.h" 10 #include "ash/wm/workspace/frame_maximize_button.h"
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 DCHECK(bubble_border_); 483 DCHECK(bubble_border_);
484 bubble_border_->GetMask(mask); 484 bubble_border_->GetMask(mask);
485 } 485 }
486 486
487 void MaximizeBubbleController::Bubble::MouseMovedOutOfHost() { 487 void MaximizeBubbleController::Bubble::MouseMovedOutOfHost() {
488 if (!owner_ || shutting_down_) 488 if (!owner_ || shutting_down_)
489 return; 489 return;
490 // When we leave the bubble, we might be still be in gesture mode or over 490 // When we leave the bubble, we might be still be in gesture mode or over
491 // the maximize button. So only close if none of the other cases apply. 491 // the maximize button. So only close if none of the other cases apply.
492 if (!owner_->frame_maximize_button()->is_snap_enabled()) { 492 if (!owner_->frame_maximize_button()->is_snap_enabled()) {
493 gfx::Point screen_location = gfx::Screen::GetCursorScreenPoint(); 493 gfx::Point screen_location = Shell::GetAshScreen()->GetCursorScreenPoint();
494 if (!owner_->frame_maximize_button()->GetBoundsInScreen().Contains( 494 if (!owner_->frame_maximize_button()->GetBoundsInScreen().Contains(
495 screen_location)) { 495 screen_location)) {
496 owner_->RequestDestructionThroughOwner(); 496 owner_->RequestDestructionThroughOwner();
497 } 497 }
498 } 498 }
499 } 499 }
500 500
501 bool MaximizeBubbleController::Bubble::Contains( 501 bool MaximizeBubbleController::Bubble::Contains(
502 const gfx::Point& screen_point, 502 const gfx::Point& screen_point,
503 views::MouseWatcherHost::MouseEventType type) { 503 views::MouseWatcherHost::MouseEventType type) {
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 if (!GetBoundsInScreen().Contains(screen_location)) 855 if (!GetBoundsInScreen().Contains(screen_location))
856 button_row_->ButtonHovered(NULL); 856 button_row_->ButtonHovered(NULL);
857 else 857 else
858 button_row_->ButtonHovered(this); 858 button_row_->ButtonHovered(this);
859 859
860 // Pass the event on to the normal handler. 860 // Pass the event on to the normal handler.
861 return views::ImageButton::OnMouseDragged(event); 861 return views::ImageButton::OnMouseDragged(event);
862 } 862 }
863 863
864 } // namespace ash 864 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698