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

Unified Diff: ash/aura/wm_shelf_aura.cc

Issue 2029323002: mash: Convert AshPopupAlignmentDelegate to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/aura/wm_shelf_aura.h ('k') | ash/common/shelf/wm_shelf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/aura/wm_shelf_aura.cc
diff --git a/ash/aura/wm_shelf_aura.cc b/ash/aura/wm_shelf_aura.cc
index 25ffb6721edd3ad226d2f156a77043fc7d5f5d1e..fc9f583a64e61f15ce276a1a861a2ddd2a2a32cb 100644
--- a/ash/aura/wm_shelf_aura.cc
+++ b/ash/aura/wm_shelf_aura.cc
@@ -52,11 +52,15 @@ void WmShelfAura::ResetShelfLayoutManager() {
}
WmWindow* WmShelfAura::GetWindow() {
- return WmWindowAura::Get(shelf_->shelf_widget()->GetNativeView());
+ // Use |shelf_layout_manager_| to access ShelfWidget because it is set
+ // before |shelf_| is available.
+ return WmWindowAura::Get(
+ shelf_layout_manager_->shelf_widget()->GetNativeView());
}
ShelfAlignment WmShelfAura::GetAlignment() const {
- return shelf_->alignment();
+ // Can be called before |shelf_| is set when initializing a secondary monitor.
+ return shelf_ ? shelf_->alignment() : SHELF_ALIGNMENT_BOTTOM_LOCKED;
}
void WmShelfAura::SetAlignment(ShelfAlignment alignment) {
@@ -71,12 +75,16 @@ void WmShelfAura::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) {
shelf_->SetAutoHideBehavior(behavior);
}
+ShelfAutoHideState WmShelfAura::GetAutoHideState() const {
+ return shelf_layout_manager_->auto_hide_state();
+}
+
ShelfBackgroundType WmShelfAura::GetBackgroundType() const {
- return shelf_->shelf_widget()->GetBackgroundType();
+ return shelf_layout_manager_->shelf_widget()->GetBackgroundType();
}
void WmShelfAura::UpdateVisibilityState() {
- shelf_->shelf_layout_manager()->UpdateVisibilityState();
+ shelf_layout_manager_->UpdateVisibilityState();
}
ShelfVisibilityState WmShelfAura::GetVisibilityState() const {
@@ -84,6 +92,11 @@ ShelfVisibilityState WmShelfAura::GetVisibilityState() const {
: SHELF_HIDDEN;
}
+gfx::Rect WmShelfAura::GetUserWorkAreaBounds() const {
+ return shelf_layout_manager_ ? shelf_layout_manager_->user_work_area_bounds()
+ : gfx::Rect();
+}
+
void WmShelfAura::UpdateIconPositionForWindow(WmWindow* window) {
shelf_->UpdateIconPositionForWindow(WmWindowAura::GetAuraWindow(window));
}
@@ -117,6 +130,11 @@ void WmShelfAura::WillChangeVisibilityState(ShelfVisibilityState new_state) {
WillChangeVisibilityState(new_state));
}
+void WmShelfAura::OnAutoHideStateChanged(ShelfAutoHideState new_state) {
+ FOR_EACH_OBSERVER(WmShelfObserver, observers_,
+ OnAutoHideStateChanged(new_state));
+}
+
void WmShelfAura::OnShelfIconPositionsChanged() {
FOR_EACH_OBSERVER(WmShelfObserver, observers_, OnShelfIconPositionsChanged());
}
« no previous file with comments | « ash/aura/wm_shelf_aura.h ('k') | ash/common/shelf/wm_shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698