Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ |
| 6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 virtual views::View* CreateTrayView(LoginStatus status); | 82 virtual views::View* CreateTrayView(LoginStatus status); |
| 83 | 83 |
| 84 // Returns a view for the item to be displayed in the list. This view can be | 84 // Returns a view for the item to be displayed in the list. This view can be |
| 85 // displayed with a number of other tray items, so this should not be too | 85 // displayed with a number of other tray items, so this should not be too |
| 86 // big. | 86 // big. |
| 87 virtual views::View* CreateDefaultView(LoginStatus status); | 87 virtual views::View* CreateDefaultView(LoginStatus status); |
| 88 | 88 |
| 89 // Returns a detailed view for the item. This view is displayed standalone. | 89 // Returns a detailed view for the item. This view is displayed standalone. |
| 90 virtual views::View* CreateDetailedView(LoginStatus status); | 90 virtual views::View* CreateDetailedView(LoginStatus status); |
| 91 | 91 |
| 92 // Returns a notification view for the item. This view is displayed with | |
| 93 // other notifications and should be the same size as default views. | |
| 94 // DEPRECATED. Use the message center instead. | |
| 95 virtual views::View* CreateNotificationView(LoginStatus status); | |
| 96 | |
| 97 // These functions are called when the corresponding view item is about to be | 92 // These functions are called when the corresponding view item is about to be |
| 98 // removed. An item should do appropriate cleanup in these functions. | 93 // removed. An item should do appropriate cleanup in these functions. |
| 99 // The default implementation does nothing. | 94 // The default implementation does nothing. |
| 100 virtual void DestroyTrayView(); | 95 virtual void DestroyTrayView(); |
| 101 virtual void DestroyDefaultView(); | 96 virtual void DestroyDefaultView(); |
| 102 virtual void DestroyDetailedView(); | 97 virtual void DestroyDetailedView(); |
| 103 virtual void DestroyNotificationView(); | 98 virtual void DestroyNotificationView(); |
|
tdanderson
2017/01/26 22:19:07
I think you also want to remove this method. Note
yiyix
2017/02/02 20:43:57
Done.
| |
| 104 | 99 |
| 105 // Updates the tray view (if applicable) when the user's login status changes. | 100 // Updates the tray view (if applicable) when the user's login status changes. |
| 106 // It is not necessary the update the default or detailed view, since the | 101 // It is not necessary the update the default or detailed view, since the |
| 107 // default/detailed popup is closed when login status changes. The default | 102 // default/detailed popup is closed when login status changes. The default |
| 108 // implementation does nothing. | 103 // implementation does nothing. |
| 109 virtual void UpdateAfterLoginStatusChange(LoginStatus status); | 104 virtual void UpdateAfterLoginStatusChange(LoginStatus status); |
| 110 | 105 |
| 111 // Updates the tray view (if applicable) when shelf's alignment changes. | 106 // Updates the tray view (if applicable) when shelf's alignment changes. |
| 112 // The default implementation does nothing. | 107 // The default implementation does nothing. |
| 113 virtual void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment); | 108 virtual void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 130 | 125 |
| 131 // Continue showing the currently-shown detailed view, if any, for | 126 // Continue showing the currently-shown detailed view, if any, for |
| 132 // |for_seconds| seconds. The caller is responsible for checking that the | 127 // |for_seconds| seconds. The caller is responsible for checking that the |
| 133 // currently-shown view is for this item. | 128 // currently-shown view is for this item. |
| 134 void SetDetailedViewCloseDelay(int for_seconds); | 129 void SetDetailedViewCloseDelay(int for_seconds); |
| 135 | 130 |
| 136 // Hides the detailed view for this item. Disable hiding animation if | 131 // Hides the detailed view for this item. Disable hiding animation if |
| 137 // |animate| is false. | 132 // |animate| is false. |
| 138 void HideDetailedView(bool animate); | 133 void HideDetailedView(bool animate); |
| 139 | 134 |
| 140 // Shows a notification for this item. | |
| 141 void ShowNotificationView(); | |
| 142 | |
| 143 // Hides the notification for this item. | |
| 144 void HideNotificationView(); | |
| 145 | |
| 146 // Returns true if this item needs to force the shelf to be visible when | 135 // Returns true if this item needs to force the shelf to be visible when |
| 147 // the shelf is in the auto-hide state. Default is true. | 136 // the shelf is in the auto-hide state. Default is true. |
| 148 virtual bool ShouldShowShelf() const; | 137 virtual bool ShouldShowShelf() const; |
| 149 | 138 |
| 150 // Returns the system tray that this item belongs to. | 139 // Returns the system tray that this item belongs to. |
| 151 SystemTray* system_tray() const { return system_tray_; } | 140 SystemTray* system_tray() const { return system_tray_; } |
| 152 | 141 |
| 153 bool restore_focus() const { return restore_focus_; } | 142 bool restore_focus() const { return restore_focus_; } |
| 154 void set_restore_focus(bool restore_focus) { restore_focus_ = restore_focus; } | 143 void set_restore_focus(bool restore_focus) { restore_focus_ = restore_focus; } |
| 155 | 144 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 168 | 157 |
| 169 // Used to delay the transition to the detailed view. | 158 // Used to delay the transition to the detailed view. |
| 170 std::unique_ptr<base::OneShotTimer> transition_delay_timer_; | 159 std::unique_ptr<base::OneShotTimer> transition_delay_timer_; |
| 171 | 160 |
| 172 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); | 161 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); |
| 173 }; | 162 }; |
| 174 | 163 |
| 175 } // namespace ash | 164 } // namespace ash |
| 176 | 165 |
| 177 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ | 166 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ |
| OLD | NEW |