| 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/window_tree_host_manager.h" | 7 #include "ash/display/window_tree_host_manager.h" |
| 8 #include "ash/screen_util.h" | 8 #include "ash/screen_util.h" |
| 9 #include "ash/shelf/shelf_constants.h" | 9 #include "ash/shelf/shelf_constants.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 void AshPopupAlignmentDelegate::UpdateShelf() { | 123 void AshPopupAlignmentDelegate::UpdateShelf() { |
| 124 if (shelf_) | 124 if (shelf_) |
| 125 return; | 125 return; |
| 126 | 126 |
| 127 shelf_ = ShelfLayoutManager::ForShelf(root_window_); | 127 shelf_ = ShelfLayoutManager::ForShelf(root_window_); |
| 128 if (shelf_) | 128 if (shelf_) |
| 129 shelf_->AddObserver(this); | 129 shelf_->AddObserver(this); |
| 130 } | 130 } |
| 131 | 131 |
| 132 gfx::Display AshPopupAlignmentDelegate::GetCurrentDisplay() const { | 132 gfx::Display AshPopupAlignmentDelegate::GetCurrentDisplay() const { |
| 133 return Shell::GetScreen()->GetDisplayNearestWindow( | 133 return gfx::Screen::GetScreen()->GetDisplayNearestWindow( |
| 134 shelf_->shelf_widget()->GetNativeView()); | 134 shelf_->shelf_widget()->GetNativeView()); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void AshPopupAlignmentDelegate::UpdateWorkArea() { | 137 void AshPopupAlignmentDelegate::UpdateWorkArea() { |
| 138 work_area_ = shelf_->user_work_area_bounds(); | 138 work_area_ = shelf_->user_work_area_bounds(); |
| 139 DoUpdateIfPossible(); | 139 DoUpdateIfPossible(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void AshPopupAlignmentDelegate::OnDisplayWorkAreaInsetsChanged() { | 142 void AshPopupAlignmentDelegate::OnDisplayWorkAreaInsetsChanged() { |
| 143 UpdateShelf(); | 143 UpdateShelf(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 164 | 164 |
| 165 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( | 165 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( |
| 166 const gfx::Display& display, | 166 const gfx::Display& display, |
| 167 uint32_t metrics) { | 167 uint32_t metrics) { |
| 168 UpdateShelf(); | 168 UpdateShelf(); |
| 169 if (shelf_ && GetCurrentDisplay().id() == display.id()) | 169 if (shelf_ && GetCurrentDisplay().id() == display.id()) |
| 170 UpdateWorkArea(); | 170 UpdateWorkArea(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace ash | 173 } // namespace ash |
| OLD | NEW |