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

Side by Side Diff: ash/common/shelf/wm_shelf.cc

Issue 2279533002: ash: Convert ShelfDelegate to use WmShelf* instead of Shelf* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: curlies Created 4 years, 4 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
« no previous file with comments | « ash/common/shelf/shelf_layout_manager.cc ('k') | ash/mus/bridge/wm_shelf_mus.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/common/shelf/shelf.h" 5 #include "ash/common/shelf/shelf.h"
6 #include "ash/common/shelf/shelf_delegate.h" 6 #include "ash/common/shelf/shelf_delegate.h"
7 #include "ash/common/shelf/shelf_layout_manager.h" 7 #include "ash/common/shelf/shelf_layout_manager.h"
8 #include "ash/common/shelf/shelf_locking_manager.h" 8 #include "ash/common/shelf/shelf_locking_manager.h"
9 #include "ash/common/shelf/shelf_widget.h" 9 #include "ash/common/shelf/shelf_widget.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 if (shelf_locking_manager_->is_locked() && 56 if (shelf_locking_manager_->is_locked() &&
57 alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) { 57 alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) {
58 shelf_locking_manager_->set_stored_alignment(alignment); 58 shelf_locking_manager_->set_stored_alignment(alignment);
59 return; 59 return;
60 } 60 }
61 61
62 alignment_ = alignment; 62 alignment_ = alignment;
63 // The ShelfWidget notifies the ShelfView of the alignment change. 63 // The ShelfWidget notifies the ShelfView of the alignment change.
64 shelf_layout_manager_->shelf_widget()->OnShelfAlignmentChanged(); 64 shelf_layout_manager_->shelf_widget()->OnShelfAlignmentChanged();
65 WmShell::Get()->shelf_delegate()->OnShelfAlignmentChanged(shelf_); 65 WmShell::Get()->shelf_delegate()->OnShelfAlignmentChanged(this);
66 WmShell::Get()->NotifyShelfAlignmentChanged(GetWindow()->GetRootWindow()); 66 WmShell::Get()->NotifyShelfAlignmentChanged(GetWindow()->GetRootWindow());
67 // ShelfLayoutManager will resize the shelf. 67 // ShelfLayoutManager will resize the shelf.
68 } 68 }
69 69
70 bool WmShelf::IsHorizontalAlignment() const { 70 bool WmShelf::IsHorizontalAlignment() const {
71 switch (alignment_) { 71 switch (alignment_) {
72 case SHELF_ALIGNMENT_BOTTOM: 72 case SHELF_ALIGNMENT_BOTTOM:
73 case SHELF_ALIGNMENT_BOTTOM_LOCKED: 73 case SHELF_ALIGNMENT_BOTTOM_LOCKED:
74 return true; 74 return true;
75 case SHELF_ALIGNMENT_LEFT: 75 case SHELF_ALIGNMENT_LEFT:
(...skipping 24 matching lines...) Expand all
100 return IsHorizontalAlignment() ? horizontal : vertical; 100 return IsHorizontalAlignment() ? horizontal : vertical;
101 } 101 }
102 102
103 void WmShelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) { 103 void WmShelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) {
104 DCHECK(shelf_layout_manager_); 104 DCHECK(shelf_layout_manager_);
105 105
106 if (auto_hide_behavior_ == auto_hide_behavior) 106 if (auto_hide_behavior_ == auto_hide_behavior)
107 return; 107 return;
108 108
109 auto_hide_behavior_ = auto_hide_behavior; 109 auto_hide_behavior_ = auto_hide_behavior;
110 WmShell::Get()->shelf_delegate()->OnShelfAutoHideBehaviorChanged(shelf_); 110 WmShell::Get()->shelf_delegate()->OnShelfAutoHideBehaviorChanged(this);
111 WmShell::Get()->NotifyShelfAutoHideBehaviorChanged( 111 WmShell::Get()->NotifyShelfAutoHideBehaviorChanged(
112 GetWindow()->GetRootWindow()); 112 GetWindow()->GetRootWindow());
113 } 113 }
114 114
115 ShelfAutoHideState WmShelf::GetAutoHideState() const { 115 ShelfAutoHideState WmShelf::GetAutoHideState() const {
116 return shelf_layout_manager_->auto_hide_state(); 116 return shelf_layout_manager_->auto_hide_state();
117 } 117 }
118 118
119 void WmShelf::UpdateAutoHideState() { 119 void WmShelf::UpdateAutoHideState() {
120 shelf_layout_manager_->UpdateAutoHideState(); 120 shelf_layout_manager_->UpdateAutoHideState();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, 225 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type,
226 BackgroundAnimatorChangeType change_type) { 226 BackgroundAnimatorChangeType change_type) {
227 if (background_type == GetBackgroundType()) 227 if (background_type == GetBackgroundType())
228 return; 228 return;
229 FOR_EACH_OBSERVER(WmShelfObserver, observers_, 229 FOR_EACH_OBSERVER(WmShelfObserver, observers_,
230 OnBackgroundTypeChanged(background_type, change_type)); 230 OnBackgroundTypeChanged(background_type, change_type));
231 } 231 }
232 232
233 } // namespace ash 233 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_layout_manager.cc ('k') | ash/mus/bridge/wm_shelf_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698