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 UI_MESSAGE_CENTER_VIEWS_DESKTOP_POPUP_ALIGNMENT_DELEGATE_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_DESKTOP_POPUP_ALIGNMENT_DELEGATE_H_ |
6 #define UI_MESSAGE_CENTER_VIEWS_DESKTOP_POPUP_ALIGNMENT_DELEGATE_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_DESKTOP_POPUP_ALIGNMENT_DELEGATE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "ui/gfx/display_observer.h" | 9 #include "ui/gfx/display_observer.h" |
10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 class MESSAGE_CENTER_EXPORT DesktopPopupAlignmentDelegate | 23 class MESSAGE_CENTER_EXPORT DesktopPopupAlignmentDelegate |
24 : public PopupAlignmentDelegate, | 24 : public PopupAlignmentDelegate, |
25 public gfx::DisplayObserver { | 25 public gfx::DisplayObserver { |
26 public: | 26 public: |
27 DesktopPopupAlignmentDelegate(); | 27 DesktopPopupAlignmentDelegate(); |
28 virtual ~DesktopPopupAlignmentDelegate(); | 28 virtual ~DesktopPopupAlignmentDelegate(); |
29 | 29 |
30 void StartObserving(gfx::Screen* screen); | 30 void StartObserving(gfx::Screen* screen); |
31 | 31 |
32 // Overridden from PopupAlignmentDelegate: | 32 // Overridden from PopupAlignmentDelegate: |
33 virtual int GetToastOriginX(const gfx::Rect& toast_bounds) const OVERRIDE; | 33 virtual int GetToastOriginX(const gfx::Rect& toast_bounds) const override; |
34 virtual int GetBaseLine() const OVERRIDE; | 34 virtual int GetBaseLine() const override; |
35 virtual int GetWorkAreaBottom() const OVERRIDE; | 35 virtual int GetWorkAreaBottom() const override; |
36 virtual bool IsTopDown() const OVERRIDE; | 36 virtual bool IsTopDown() const override; |
37 virtual bool IsFromLeft() const OVERRIDE; | 37 virtual bool IsFromLeft() const override; |
38 virtual void RecomputeAlignment(const gfx::Display& display) OVERRIDE; | 38 virtual void RecomputeAlignment(const gfx::Display& display) override; |
39 | 39 |
40 private: | 40 private: |
41 friend class test::MessagePopupCollectionTest; | 41 friend class test::MessagePopupCollectionTest; |
42 | 42 |
43 enum PopupAlignment { | 43 enum PopupAlignment { |
44 POPUP_ALIGNMENT_TOP = 1 << 0, | 44 POPUP_ALIGNMENT_TOP = 1 << 0, |
45 POPUP_ALIGNMENT_LEFT = 1 << 1, | 45 POPUP_ALIGNMENT_LEFT = 1 << 1, |
46 POPUP_ALIGNMENT_BOTTOM = 1 << 2, | 46 POPUP_ALIGNMENT_BOTTOM = 1 << 2, |
47 POPUP_ALIGNMENT_RIGHT = 1 << 3, | 47 POPUP_ALIGNMENT_RIGHT = 1 << 3, |
48 }; | 48 }; |
49 | 49 |
50 // Overridden from gfx::DisplayObserver: | 50 // Overridden from gfx::DisplayObserver: |
51 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; | 51 virtual void OnDisplayAdded(const gfx::Display& new_display) override; |
52 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; | 52 virtual void OnDisplayRemoved(const gfx::Display& old_display) override; |
53 virtual void OnDisplayMetricsChanged(const gfx::Display& display, | 53 virtual void OnDisplayMetricsChanged(const gfx::Display& display, |
54 uint32_t metrics) OVERRIDE; | 54 uint32_t metrics) override; |
55 | 55 |
56 int32_t alignment_; | 56 int32_t alignment_; |
57 int64_t display_id_; | 57 int64_t display_id_; |
58 gfx::Screen* screen_; | 58 gfx::Screen* screen_; |
59 gfx::Rect work_area_; | 59 gfx::Rect work_area_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(DesktopPopupAlignmentDelegate); | 61 DISALLOW_COPY_AND_ASSIGN(DesktopPopupAlignmentDelegate); |
62 }; | 62 }; |
63 | 63 |
64 } // namespace message_center | 64 } // namespace message_center |
65 | 65 |
66 #endif // UI_MESSAGE_CENTER_VIEWS_DESKTOP_POPUP_ALIGNMENT_DELEGATE_H_ | 66 #endif // UI_MESSAGE_CENTER_VIEWS_DESKTOP_POPUP_ALIGNMENT_DELEGATE_H_ |
OLD | NEW |