| 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/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 Loading... |
| 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 |
| OLD | NEW |