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

Side by Side Diff: ash/wm/shelf_layout_manager.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/shelf_layout_manager.h" 5 #include "ash/wm/shelf_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 // Increase the the hit test area to prevent the shelf from disappearing 872 // Increase the the hit test area to prevent the shelf from disappearing
873 // when the mouse is over the bubble gap. 873 // when the mouse is over the bubble gap.
874 shelf_region.Inset(alignment_ == SHELF_ALIGNMENT_RIGHT ? 874 shelf_region.Inset(alignment_ == SHELF_ALIGNMENT_RIGHT ?
875 -kNotificationBubbleGapHeight : 0, 875 -kNotificationBubbleGapHeight : 0,
876 alignment_ == SHELF_ALIGNMENT_BOTTOM ? 876 alignment_ == SHELF_ALIGNMENT_BOTTOM ?
877 -kNotificationBubbleGapHeight : 0, 877 -kNotificationBubbleGapHeight : 0,
878 alignment_ == SHELF_ALIGNMENT_LEFT ? 878 alignment_ == SHELF_ALIGNMENT_LEFT ?
879 -kNotificationBubbleGapHeight : 0, 879 -kNotificationBubbleGapHeight : 0,
880 0); 880 0);
881 } 881 }
882 return shelf_region.Contains(gfx::Screen::GetCursorScreenPoint()) ? 882 return shelf_region.Contains(Shell::GetAshScreen()->GetCursorScreenPoint()) ?
883 AUTO_HIDE_SHOWN : AUTO_HIDE_HIDDEN; 883 AUTO_HIDE_SHOWN :
884 AUTO_HIDE_HIDDEN;
oshima 2012/10/10 17:58:23 I slightly prefer the original format, but I'll le
scottmg 2012/10/10 19:04:47 Done.
884 } 885 }
885 886
886 void ShelfLayoutManager::UpdateHitTestBounds() { 887 void ShelfLayoutManager::UpdateHitTestBounds() {
887 gfx::Insets insets; 888 gfx::Insets insets;
888 // Only modify the hit test when the shelf is visible, so we don't mess with 889 // Only modify the hit test when the shelf is visible, so we don't mess with
889 // hover hit testing in the auto-hide state. 890 // hover hit testing in the auto-hide state.
890 if (state_.visibility_state == VISIBLE) { 891 if (state_.visibility_state == VISIBLE) {
891 // Let clicks at the very top of the launcher through so windows can be 892 // Let clicks at the very top of the launcher through so windows can be
892 // resized with the bottom-right corner and bottom edge. 893 // resized with the bottom-right corner and bottom edge.
893 switch (alignment_) { 894 switch (alignment_) {
(...skipping 26 matching lines...) Expand all
920 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { 921 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const {
921 if (state.visibility_state == VISIBLE) 922 if (state.visibility_state == VISIBLE)
922 return size; 923 return size;
923 if (state.visibility_state == AUTO_HIDE) 924 if (state.visibility_state == AUTO_HIDE)
924 return kAutoHideSize; 925 return kAutoHideSize;
925 return 0; 926 return 0;
926 } 927 }
927 928
928 } // namespace internal 929 } // namespace internal
929 } // namespace ash 930 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698