| 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 #ifndef ASH_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_ | 5 #ifndef ASH_COMMON_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_ |
| 6 #define ASH_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_ | 6 #define ASH_COMMON_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/common/shelf/shelf_types.h" | 11 #include "ash/common/shelf/shelf_types.h" |
| 12 #include "ash/common/shelf/wm_shelf_observer.h" | 12 #include "ash/common/shelf/wm_shelf_observer.h" |
| 13 #include "ash/common/shell_observer.h" | 13 #include "ash/common/shell_observer.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "ui/display/display_observer.h" | 15 #include "ui/display/display_observer.h" |
| 16 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 34 public WmShelfObserver, | 34 public WmShelfObserver, |
| 35 public ShellObserver, | 35 public ShellObserver, |
| 36 public display::DisplayObserver { | 36 public display::DisplayObserver { |
| 37 public: | 37 public: |
| 38 explicit AshPopupAlignmentDelegate(WmShelf* shelf); | 38 explicit AshPopupAlignmentDelegate(WmShelf* shelf); |
| 39 ~AshPopupAlignmentDelegate() override; | 39 ~AshPopupAlignmentDelegate() override; |
| 40 | 40 |
| 41 // Start observing the system. | 41 // Start observing the system. |
| 42 void StartObserving(display::Screen* screen, const display::Display& display); | 42 void StartObserving(display::Screen* screen, const display::Display& display); |
| 43 | 43 |
| 44 // Sets the current height of the system tray so that the notification toasts | 44 // Sets the current height of the system tray bubble (or legacy notification |
| 45 // can avoid it. | 45 // bubble) so that web notification toasts can avoid it. |
| 46 void SetSystemTrayHeight(int height); | 46 void SetTrayBubbleHeight(int height); |
| 47 | 47 |
| 48 // Returns the current system tray height. | 48 // Returns the current tray bubble height or 0 if there is no bubble. |
| 49 int system_tray_height_for_test() const { return system_tray_height_; } | 49 int tray_bubble_height_for_test() const { return tray_bubble_height_; } |
| 50 | 50 |
| 51 // Overridden from message_center::PopupAlignmentDelegate: | 51 // Overridden from message_center::PopupAlignmentDelegate: |
| 52 int GetToastOriginX(const gfx::Rect& toast_bounds) const override; | 52 int GetToastOriginX(const gfx::Rect& toast_bounds) const override; |
| 53 int GetBaseLine() const override; | 53 int GetBaseLine() const override; |
| 54 int GetWorkAreaBottom() const override; | 54 int GetWorkAreaBottom() const override; |
| 55 bool IsTopDown() const override; | 55 bool IsTopDown() const override; |
| 56 bool IsFromLeft() const override; | 56 bool IsFromLeft() const override; |
| 57 void RecomputeAlignment(const display::Display& display) override; | 57 void RecomputeAlignment(const display::Display& display) override; |
| 58 void ConfigureWidgetInitParamsForContainer( | 58 void ConfigureWidgetInitParamsForContainer( |
| 59 views::Widget* widget, | 59 views::Widget* widget, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 81 | 81 |
| 82 // Overridden from display::DisplayObserver: | 82 // Overridden from display::DisplayObserver: |
| 83 void OnDisplayAdded(const display::Display& new_display) override; | 83 void OnDisplayAdded(const display::Display& new_display) override; |
| 84 void OnDisplayRemoved(const display::Display& old_display) override; | 84 void OnDisplayRemoved(const display::Display& old_display) override; |
| 85 void OnDisplayMetricsChanged(const display::Display& display, | 85 void OnDisplayMetricsChanged(const display::Display& display, |
| 86 uint32_t metrics) override; | 86 uint32_t metrics) override; |
| 87 | 87 |
| 88 display::Screen* screen_; | 88 display::Screen* screen_; |
| 89 gfx::Rect work_area_; | 89 gfx::Rect work_area_; |
| 90 WmShelf* shelf_; | 90 WmShelf* shelf_; |
| 91 int system_tray_height_; | 91 int tray_bubble_height_; |
| 92 | 92 |
| 93 DISALLOW_COPY_AND_ASSIGN(AshPopupAlignmentDelegate); | 93 DISALLOW_COPY_AND_ASSIGN(AshPopupAlignmentDelegate); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace ash | 96 } // namespace ash |
| 97 | 97 |
| 98 #endif // ASH_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_ | 98 #endif // ASH_COMMON_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_ |
| OLD | NEW |