| 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/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/wm_lookup.h" | 9 #include "ash/common/wm_lookup.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 UpdateWorkArea(); | 55 UpdateWorkArea(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void AshPopupAlignmentDelegate::SetSystemTrayHeight(int height) { | 58 void AshPopupAlignmentDelegate::SetSystemTrayHeight(int height) { |
| 59 system_tray_height_ = height; | 59 system_tray_height_ = height; |
| 60 | 60 |
| 61 // If the shelf is shown during auto-hide state, the distance from the edge | 61 // If the shelf is shown during auto-hide state, the distance from the edge |
| 62 // should be reduced by the height of shelf's shown height. | 62 // should be reduced by the height of shelf's shown height. |
| 63 if (shelf_->visibility_state() == SHELF_AUTO_HIDE && | 63 if (shelf_->visibility_state() == SHELF_AUTO_HIDE && |
| 64 shelf_->auto_hide_state() == SHELF_AUTO_HIDE_SHOWN) { | 64 shelf_->auto_hide_state() == SHELF_AUTO_HIDE_SHOWN) { |
| 65 system_tray_height_ -= kShelfSize - ShelfLayoutManager::kAutoHideSize; | 65 system_tray_height_ -= GetShelfConstant(SHELF_SIZE) - kShelfAutoHideSize; |
| 66 } | 66 } |
| 67 | 67 |
| 68 if (system_tray_height_ > 0) | 68 if (system_tray_height_ > 0) |
| 69 system_tray_height_ += message_center::kMarginBetweenItems; | 69 system_tray_height_ += message_center::kMarginBetweenItems; |
| 70 else | 70 else |
| 71 system_tray_height_ = 0; | 71 system_tray_height_ = 0; |
| 72 | 72 |
| 73 DoUpdateIfPossible(); | 73 DoUpdateIfPossible(); |
| 74 } | 74 } |
| 75 | 75 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 const display::Display& old_display) {} | 143 const display::Display& old_display) {} |
| 144 | 144 |
| 145 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( | 145 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( |
| 146 const display::Display& display, | 146 const display::Display& display, |
| 147 uint32_t metrics) { | 147 uint32_t metrics) { |
| 148 if (GetCurrentDisplay().id() == display.id()) | 148 if (GetCurrentDisplay().id() == display.id()) |
| 149 UpdateWorkArea(); | 149 UpdateWorkArea(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace ash | 152 } // namespace ash |
| OLD | NEW |