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

Side by Side Diff: ash/common/system/web_notification/ash_popup_alignment_delegate.cc

Issue 2335963002: Refactor: remove SetDisplayWorkAreaInsets calls. (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/system/web_notification/ash_popup_alignment_delegate.h" 5 #include "ash/common/system/web_notification/ash_popup_alignment_delegate.h"
6 6
7 #include "ash/common/shelf/shelf_constants.h" 7 #include "ash/common/shelf/shelf_constants.h"
8 #include "ash/common/shelf/shelf_types.h" 8 #include "ash/common/shelf/shelf_types.h"
9 #include "ash/common/shelf/wm_shelf.h" 9 #include "ash/common/shelf/wm_shelf.h"
10 #include "ash/common/shell_window_ids.h" 10 #include "ash/common/shell_window_ids.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 display::Display AshPopupAlignmentDelegate::GetCurrentDisplay() const { 124 display::Display AshPopupAlignmentDelegate::GetCurrentDisplay() const {
125 return shelf_->GetWindow()->GetDisplayNearestWindow(); 125 return shelf_->GetWindow()->GetDisplayNearestWindow();
126 } 126 }
127 127
128 void AshPopupAlignmentDelegate::UpdateWorkArea() { 128 void AshPopupAlignmentDelegate::UpdateWorkArea() {
129 work_area_ = shelf_->GetUserWorkAreaBounds(); 129 work_area_ = shelf_->GetUserWorkAreaBounds();
130 DoUpdateIfPossible(); 130 DoUpdateIfPossible();
131 } 131 }
132 132
133 /////////////////////////////////////////////////////////////////////////////// 133 ///////////////////////////////////////////////////////////////////////////////
134 // ShellObserver:
135
136 void AshPopupAlignmentDelegate::OnDisplayWorkAreaInsetsChanged() {
137 UpdateWorkArea();
138 }
139
140 ///////////////////////////////////////////////////////////////////////////////
141 // WmShelfObserver: 134 // WmShelfObserver:
142 135
143 void AshPopupAlignmentDelegate::WillChangeVisibilityState( 136 void AshPopupAlignmentDelegate::WillChangeVisibilityState(
144 ShelfVisibilityState new_state) { 137 ShelfVisibilityState new_state) {
145 UpdateWorkArea(); 138 UpdateWorkArea();
146 } 139 }
147 140
148 void AshPopupAlignmentDelegate::OnAutoHideStateChanged( 141 void AshPopupAlignmentDelegate::OnAutoHideStateChanged(
149 ShelfAutoHideState new_state) { 142 ShelfAutoHideState new_state) {
150 UpdateWorkArea(); 143 UpdateWorkArea();
151 } 144 }
152 145
153 /////////////////////////////////////////////////////////////////////////////// 146 ///////////////////////////////////////////////////////////////////////////////
154 // display::DisplayObserver: 147 // display::DisplayObserver:
155 148
156 void AshPopupAlignmentDelegate::OnDisplayAdded( 149 void AshPopupAlignmentDelegate::OnDisplayAdded(
157 const display::Display& new_display) {} 150 const display::Display& new_display) {}
158 151
159 void AshPopupAlignmentDelegate::OnDisplayRemoved( 152 void AshPopupAlignmentDelegate::OnDisplayRemoved(
160 const display::Display& old_display) {} 153 const display::Display& old_display) {}
161 154
162 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( 155 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged(
163 const display::Display& display, 156 const display::Display& display,
164 uint32_t metrics) { 157 uint32_t metrics) {
165 if (GetCurrentDisplay().id() == display.id()) 158 if (GetCurrentDisplay().id() == display.id())
166 UpdateWorkArea(); 159 UpdateWorkArea();
167 } 160 }
168 161
169 } // namespace ash 162 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/web_notification/ash_popup_alignment_delegate.h ('k') | ash/display/display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698