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

Side by Side Diff: ash/wm/shelf_layout_manager.cc

Issue 10027007: ash: Make sure the uber-tray popup is positioned correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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/shelf_layout_manager.h ('k') | no next file » | 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/shelf_layout_manager.h" 5 #include "ash/wm/shelf_layout_manager.h"
6 6
7 #include "ash/launcher/launcher.h" 7 #include "ash/launcher/launcher.h"
8 #include "ash/screen_ash.h" 8 #include "ash/screen_ash.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_delegate.h" 10 #include "ash/shell_delegate.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 122 }
123 123
124 void ShelfLayoutManager::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) { 124 void ShelfLayoutManager::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) {
125 if (auto_hide_behavior_ == behavior) 125 if (auto_hide_behavior_ == behavior)
126 return; 126 return;
127 auto_hide_behavior_ = behavior; 127 auto_hide_behavior_ = behavior;
128 UpdateVisibilityState(); 128 UpdateVisibilityState();
129 } 129 }
130 130
131 bool ShelfLayoutManager::IsVisible() const { 131 bool ShelfLayoutManager::IsVisible() const {
132 return state_.visibility_state == VISIBLE || 132 bool empty = status_->GetWindowScreenBounds().IsEmpty() &&
sky 2012/04/09 21:01:48 Can we use status_->IsVisible() instead? Also, I t
sadrul 2012/04/09 23:59:34 Changed to use status_->IsVisible. I have removed
133 (launcher_widget()->GetWindowScreenBounds().IsEmpty() ||
134 launcher_->GetStatusWidth() == 0);
135 return !empty && (state_.visibility_state == VISIBLE ||
133 (state_.visibility_state == AUTO_HIDE && 136 (state_.visibility_state == AUTO_HIDE &&
134 state_.auto_hide_state == AUTO_HIDE_SHOWN); 137 state_.auto_hide_state == AUTO_HIDE_SHOWN));
135 } 138 }
136 139
137 gfx::Rect ShelfLayoutManager::GetMaximizedWindowBounds( 140 gfx::Rect ShelfLayoutManager::GetMaximizedWindowBounds(
138 aura::Window* window) const { 141 aura::Window* window) const {
139 // TODO: needs to be multi-mon aware. 142 // TODO: needs to be multi-mon aware.
140 gfx::Rect bounds(gfx::Screen::GetMonitorAreaNearestWindow(window)); 143 gfx::Rect bounds(gfx::Screen::GetMonitorAreaNearestWindow(window));
141 if (auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT || 144 if (auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT ||
142 auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) { 145 auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) {
143 bounds.set_height(bounds.height() - kAutoHideHeight); 146 bounds.set_height(bounds.height() - kAutoHideHeight);
144 return bounds; 147 return bounds;
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 insets.Set(kWorkspaceAreaBottomInset, 0, 0, 0); 431 insets.Set(kWorkspaceAreaBottomInset, 0, 0, 0);
429 } 432 }
430 if (launcher_widget() && launcher_widget()->GetNativeWindow()) 433 if (launcher_widget() && launcher_widget()->GetNativeWindow())
431 launcher_widget()->GetNativeWindow()->set_hit_test_bounds_override_outer( 434 launcher_widget()->GetNativeWindow()->set_hit_test_bounds_override_outer(
432 insets); 435 insets);
433 status_->GetNativeWindow()->set_hit_test_bounds_override_outer(insets); 436 status_->GetNativeWindow()->set_hit_test_bounds_override_outer(insets);
434 } 437 }
435 438
436 } // namespace internal 439 } // namespace internal
437 } // namespace ash 440 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/shelf_layout_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698