| 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/public/cpp/shelf_types.h" | 7 #include "ash/public/cpp/shelf_types.h" | 
| 8 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" | 
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" | 
| 10 #include "ash/shelf/shelf_constants.h" | 10 #include "ash/shelf/shelf_constants.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::SetTrayBubbleHeight(int height) { | 58 void AshPopupAlignmentDelegate::SetTrayBubbleHeight(int height) { | 
| 59   tray_bubble_height_ = height; | 59   tray_bubble_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_->GetVisibilityState() == SHELF_AUTO_HIDE && | 63   if (shelf_->GetVisibilityState() == SHELF_AUTO_HIDE && | 
| 64       shelf_->GetAutoHideState() == SHELF_AUTO_HIDE_SHOWN) { | 64       shelf_->GetAutoHideState() == SHELF_AUTO_HIDE_SHOWN) { | 
| 65     tray_bubble_height_ -= GetShelfConstant(SHELF_SIZE) - | 65     tray_bubble_height_ -= kShelfSize; | 
| 66                            GetShelfConstant(SHELF_INSETS_FOR_AUTO_HIDE); |  | 
| 67   } | 66   } | 
| 68 | 67 | 
| 69   if (tray_bubble_height_ > 0) | 68   if (tray_bubble_height_ > 0) | 
| 70     tray_bubble_height_ += message_center::kMarginBetweenItems; | 69     tray_bubble_height_ += message_center::kMarginBetweenItems; | 
| 71   else | 70   else | 
| 72     tray_bubble_height_ = 0; | 71     tray_bubble_height_ = 0; | 
| 73 | 72 | 
| 74   DoUpdateIfPossible(); | 73   DoUpdateIfPossible(); | 
| 75 } | 74 } | 
| 76 | 75 | 
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 159     const display::Display& old_display) {} | 158     const display::Display& old_display) {} | 
| 160 | 159 | 
| 161 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( | 160 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( | 
| 162     const display::Display& display, | 161     const display::Display& display, | 
| 163     uint32_t metrics) { | 162     uint32_t metrics) { | 
| 164   if (GetCurrentDisplay().id() == display.id()) | 163   if (GetCurrentDisplay().id() == display.id()) | 
| 165     UpdateWorkArea(); | 164     UpdateWorkArea(); | 
| 166 } | 165 } | 
| 167 | 166 | 
| 168 }  // namespace ash | 167 }  // namespace ash | 
| OLD | NEW | 
|---|