OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_MESSAGE_CENTER_WIDGET_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_MESSAGE_CENTER_WIDGET_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_MESSAGE_CENTER_WIDGET_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_MESSAGE_CENTER_WIDGET_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 virtual views::Widget* GetWidget() OVERRIDE; | 65 virtual views::Widget* GetWidget() OVERRIDE; |
66 virtual const views::Widget* GetWidget() const OVERRIDE; | 66 virtual const views::Widget* GetWidget() const OVERRIDE; |
67 | 67 |
68 // WidgetObserver overrides: | 68 // WidgetObserver overrides: |
69 virtual void OnWidgetActivationChanged(views::Widget* widget, | 69 virtual void OnWidgetActivationChanged(views::Widget* widget, |
70 bool active) OVERRIDE; | 70 bool active) OVERRIDE; |
71 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; | 71 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
72 | 72 |
73 // View overrides: | 73 // View overrides: |
74 virtual void PreferredSizeChanged() OVERRIDE; | 74 virtual void PreferredSizeChanged() OVERRIDE; |
75 virtual gfx::Size GetPreferredSize() OVERRIDE; | 75 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
76 virtual gfx::Size GetMaximumSize() OVERRIDE; | 76 virtual gfx::Size GetMaximumSize() OVERRIDE; |
77 virtual int GetHeightForWidth(int width) OVERRIDE; | 77 virtual int GetHeightForWidth(int width) const OVERRIDE; |
78 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 78 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
79 | 79 |
80 private: | 80 private: |
81 // Creates and initializes the message center widget. | 81 // Creates and initializes the message center widget. |
82 void InitWidget(); | 82 void InitWidget(); |
83 | 83 |
84 // Shifts the message center anchor point such that the mouse click point is | 84 // Shifts the message center anchor point such that the mouse click point is |
85 // along the middle 60% of the width of the message center if taskbar is | 85 // along the middle 60% of the width of the message center if taskbar is |
86 // horizontal aligned. If vertically aligned, ensures that mouse click point | 86 // horizontal aligned. If vertically aligned, ensures that mouse click point |
87 // is along the height of the message center (at least at a corner). | 87 // is along the height of the message center (at least at a corner). |
88 gfx::Point GetCorrectedAnchor(gfx::Size calculated_size); | 88 gfx::Point GetCorrectedAnchor(gfx::Size calculated_size); |
89 | 89 |
90 // Calculates the message center bounds using the position info and the | 90 // Calculates the message center bounds using the position info and the |
91 // corrected anchor. | 91 // corrected anchor. |
92 gfx::Rect GetMessageCenterBounds(); | 92 gfx::Rect GetMessageCenterBounds(); |
93 | 93 |
94 // Insets of the message center border (set in MessageCenterFrameView). | 94 // Insets of the message center border (set in MessageCenterFrameView). |
95 gfx::Insets border_insets_; | 95 gfx::Insets border_insets_; |
96 | 96 |
97 // Info necessary to calculate the estimated position of the message center. | 97 // Info necessary to calculate the estimated position of the message center. |
98 PositionInfo pos_info_; | 98 PositionInfo pos_info_; |
99 | 99 |
100 WebNotificationTray* tray_; | 100 WebNotificationTray* tray_; |
101 }; | 101 }; |
102 | 102 |
103 } // namespace message_center | 103 } // namespace message_center |
104 | 104 |
105 #endif // CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_MESSAGE_CENTER_WIDGET_DELEGATE
_H_ | 105 #endif // CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_MESSAGE_CENTER_WIDGET_DELEGATE
_H_ |
OLD | NEW |