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_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_ |
6 #define ASH_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_ | 6 #define ASH_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/shelf/shelf_layout_manager_observer.h" | 9 #include "ash/shelf/shelf_layout_manager_observer.h" |
10 #include "ash/shelf/shelf_types.h" | 10 #include "ash/shelf/shelf_types.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 virtual ~AshPopupAlignmentDelegate(); | 40 virtual ~AshPopupAlignmentDelegate(); |
41 | 41 |
42 // Start observing the system. | 42 // Start observing the system. |
43 void StartObserving(gfx::Screen* screen, const gfx::Display& display); | 43 void StartObserving(gfx::Screen* screen, const gfx::Display& display); |
44 | 44 |
45 // Sets the current height of the system tray so that the notification toasts | 45 // Sets the current height of the system tray so that the notification toasts |
46 // can avoid it. | 46 // can avoid it. |
47 void SetSystemTrayHeight(int height); | 47 void SetSystemTrayHeight(int height); |
48 | 48 |
49 // Overridden from message_center::PopupAlignmentDelegate: | 49 // Overridden from message_center::PopupAlignmentDelegate: |
50 virtual int GetToastOriginX(const gfx::Rect& toast_bounds) const OVERRIDE; | 50 virtual int GetToastOriginX(const gfx::Rect& toast_bounds) const override; |
51 virtual int GetBaseLine() const OVERRIDE; | 51 virtual int GetBaseLine() const override; |
52 virtual int GetWorkAreaBottom() const OVERRIDE; | 52 virtual int GetWorkAreaBottom() const override; |
53 virtual bool IsTopDown() const OVERRIDE; | 53 virtual bool IsTopDown() const override; |
54 virtual bool IsFromLeft() const OVERRIDE; | 54 virtual bool IsFromLeft() const override; |
55 virtual void RecomputeAlignment(const gfx::Display& display) OVERRIDE; | 55 virtual void RecomputeAlignment(const gfx::Display& display) override; |
56 | 56 |
57 private: | 57 private: |
58 friend class AshPopupAlignmentDelegateTest; | 58 friend class AshPopupAlignmentDelegateTest; |
59 friend class WebNotificationTrayTest; | 59 friend class WebNotificationTrayTest; |
60 | 60 |
61 // Get the current alignment of the shelf. | 61 // Get the current alignment of the shelf. |
62 ShelfAlignment GetAlignment() const; | 62 ShelfAlignment GetAlignment() const; |
63 | 63 |
64 // Update |shelf_| and start watching when it's first set. This should not | 64 // Update |shelf_| and start watching when it's first set. This should not |
65 // be done in the constructor because the shelf might not be initialized at | 65 // be done in the constructor because the shelf might not be initialized at |
66 // that point. | 66 // that point. |
67 void UpdateShelf(); | 67 void UpdateShelf(); |
68 | 68 |
69 // Overridden from ShellObserver: | 69 // Overridden from ShellObserver: |
70 virtual void OnDisplayWorkAreaInsetsChanged() OVERRIDE; | 70 virtual void OnDisplayWorkAreaInsetsChanged() override; |
71 | 71 |
72 // Overridden from ShelfLayoutManagerObserver: | 72 // Overridden from ShelfLayoutManagerObserver: |
73 virtual void OnAutoHideStateChanged(ShelfAutoHideState new_state) OVERRIDE; | 73 virtual void OnAutoHideStateChanged(ShelfAutoHideState new_state) override; |
74 | 74 |
75 // Overridden from gfx::DisplayObserver: | 75 // Overridden from gfx::DisplayObserver: |
76 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; | 76 virtual void OnDisplayAdded(const gfx::Display& new_display) override; |
77 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; | 77 virtual void OnDisplayRemoved(const gfx::Display& old_display) override; |
78 virtual void OnDisplayMetricsChanged(const gfx::Display& display, | 78 virtual void OnDisplayMetricsChanged(const gfx::Display& display, |
79 uint32_t metrics) OVERRIDE; | 79 uint32_t metrics) override; |
80 | 80 |
81 int64_t display_id_; | 81 int64_t display_id_; |
82 gfx::Screen* screen_; | 82 gfx::Screen* screen_; |
83 gfx::Rect work_area_; | 83 gfx::Rect work_area_; |
84 aura::Window* root_window_; | 84 aura::Window* root_window_; |
85 ShelfLayoutManager* shelf_; | 85 ShelfLayoutManager* shelf_; |
86 int system_tray_height_; | 86 int system_tray_height_; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(AshPopupAlignmentDelegate); | 88 DISALLOW_COPY_AND_ASSIGN(AshPopupAlignmentDelegate); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace ash | 91 } // namespace ash |
92 | 92 |
93 #endif // ASH_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_ | 93 #endif // ASH_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_ |
OLD | NEW |