OLD | NEW |
---|---|
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/system/web_notification/ash_popup_alignment_delegate.h" | 5 #include "ash/system/web_notification/ash_popup_alignment_delegate.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/shelf/shelf_constants.h" | 8 #include "ash/shelf/shelf_constants.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shelf/shelf_types.h" | 10 #include "ash/shelf/shelf_types.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 // Since the work_area is already reduced by kAutoHideSize, the inset width | 142 // Since the work_area is already reduced by kAutoHideSize, the inset width |
143 // should be just the difference. | 143 // should be just the difference. |
144 width = kShelfSize - ShelfLayoutManager::kAutoHideSize; | 144 width = kShelfSize - ShelfLayoutManager::kAutoHideSize; |
145 } | 145 } |
146 work_area_.Inset(shelf_->SelectValueForShelfAlignment( | 146 work_area_.Inset(shelf_->SelectValueForShelfAlignment( |
147 gfx::Insets(0, 0, width, 0), | 147 gfx::Insets(0, 0, width, 0), |
148 gfx::Insets(0, width, 0, 0), | 148 gfx::Insets(0, width, 0, 0), |
149 gfx::Insets(0, 0, 0, width), | 149 gfx::Insets(0, 0, 0, width), |
150 gfx::Insets(width, 0, 0, 0))); | 150 gfx::Insets(width, 0, 0, 0))); |
151 | 151 |
152 if (shelf_) | |
153 work_area_.Union(shelf_->dock_bounds()); | |
oshima
2015/05/06 21:01:18
I don't think this is correct. let me take a look.
jonross
2015/05/07 18:54:27
Updated per offline discussions. ShelfLayoutManage
| |
154 | |
152 DoUpdateIfPossible(); | 155 DoUpdateIfPossible(); |
153 } | 156 } |
154 | 157 |
155 void AshPopupAlignmentDelegate::OnDisplayWorkAreaInsetsChanged() { | 158 void AshPopupAlignmentDelegate::OnDisplayWorkAreaInsetsChanged() { |
156 UpdateShelf(); | 159 UpdateShelf(); |
157 UpdateWorkArea(GetCurrentDisplay(), shelf_->auto_hide_state()); | 160 UpdateWorkArea(GetCurrentDisplay(), shelf_->auto_hide_state()); |
158 } | 161 } |
159 | 162 |
160 void AshPopupAlignmentDelegate::OnAutoHideStateChanged( | 163 void AshPopupAlignmentDelegate::OnAutoHideStateChanged( |
161 ShelfAutoHideState new_state) { | 164 ShelfAutoHideState new_state) { |
(...skipping 10 matching lines...) Expand all Loading... | |
172 | 175 |
173 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( | 176 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( |
174 const gfx::Display& display, | 177 const gfx::Display& display, |
175 uint32_t metrics) { | 178 uint32_t metrics) { |
176 UpdateShelf(); | 179 UpdateShelf(); |
177 if (shelf_ && GetCurrentDisplay().id() == display.id()) | 180 if (shelf_ && GetCurrentDisplay().id() == display.id()) |
178 UpdateWorkArea(display, shelf_->auto_hide_state()); | 181 UpdateWorkArea(display, shelf_->auto_hide_state()); |
179 } | 182 } |
180 | 183 |
181 } // namespace ash | 184 } // namespace ash |
OLD | NEW |