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_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ | 5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ |
6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ | 6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 bool IsVisible(); | 54 bool IsVisible(); |
55 | 55 |
56 // Returns true if any of the SystemTrayItems return true from | 56 // Returns true if any of the SystemTrayItems return true from |
57 // ShouldShowShelf(). | 57 // ShouldShowShelf(). |
58 bool ShouldShowShelf() const; | 58 bool ShouldShowShelf() const; |
59 | 59 |
60 // Records metrics for visible system menu rows. Only implemented for the | 60 // Records metrics for visible system menu rows. Only implemented for the |
61 // BUBBLE_TYPE_DEFAULT BubbleType. | 61 // BUBBLE_TYPE_DEFAULT BubbleType. |
62 void RecordVisibleRowMetrics(); | 62 void RecordVisibleRowMetrics(); |
63 | 63 |
64 // Update the bounds of the system tray bubble. Close the bubble if it | |
65 // is hidden behind the shelf. | |
xiyuan
2017/06/16 17:33:43
The comment seems not exactly correct since Update
minch1
2017/06/16 22:11:51
Done.
| |
66 void UpdateBounds(const gfx::Rect& target_bounds, bool close_bubble); | |
67 | |
64 private: | 68 private: |
65 // Updates the bottom padding of the |bubble_view_| based on the | 69 // Updates the bottom padding of the |bubble_view_| based on the |
66 // |bubble_type_|. | 70 // |bubble_type_|. |
67 void UpdateBottomPadding(); | 71 void UpdateBottomPadding(); |
68 void CreateItemViews(LoginStatus login_status); | 72 void CreateItemViews(LoginStatus login_status); |
69 | 73 |
70 ash::SystemTray* tray_; | 74 ash::SystemTray* tray_; |
71 views::TrayBubbleView* bubble_view_; | 75 views::TrayBubbleView* bubble_view_; |
72 std::vector<ash::SystemTrayItem*> items_; | 76 std::vector<ash::SystemTrayItem*> items_; |
73 BubbleType bubble_type_; | 77 BubbleType bubble_type_; |
74 | 78 |
75 // Tracks the views created in the last call to CreateItemViews(). | 79 // Tracks the views created in the last call to CreateItemViews(). |
76 std::map<SystemTrayItem::UmaType, views::View*> tray_item_view_map_; | 80 std::map<SystemTrayItem::UmaType, views::View*> tray_item_view_map_; |
77 | 81 |
78 int autoclose_delay_; | 82 int autoclose_delay_; |
79 base::OneShotTimer autoclose_; | 83 base::OneShotTimer autoclose_; |
80 | 84 |
85 // Used in maximize mode to make sure the system tray bubble only be shown in | |
86 // work area. | |
87 aura::Window* clipping_window_ = nullptr; | |
88 | |
81 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubble); | 89 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubble); |
82 }; | 90 }; |
83 | 91 |
84 } // namespace ash | 92 } // namespace ash |
85 | 93 |
86 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ | 94 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ |
OLD | NEW |