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> | |
10 #include <vector> | 9 #include <vector> |
11 | 10 |
12 #include "ash/login_status.h" | 11 #include "ash/login_status.h" |
13 #include "ash/system/tray/system_tray_item.h" | 12 #include "ash/system/tray/system_tray_item.h" |
14 #include "base/macros.h" | 13 #include "base/macros.h" |
15 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
16 #include "ui/views/bubble/tray_bubble_view.h" | 15 #include "ui/views/bubble/tray_bubble_view.h" |
17 | 16 |
18 namespace ash { | 17 namespace ash { |
19 class SystemTray; | 18 class SystemTray; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 bool IsVisible(); | 50 bool IsVisible(); |
52 | 51 |
53 // Returns true if any of the SystemTrayItems return true from | 52 // Returns true if any of the SystemTrayItems return true from |
54 // ShouldShowShelf(). | 53 // ShouldShowShelf(). |
55 bool ShouldShowShelf() const; | 54 bool ShouldShowShelf() const; |
56 | 55 |
57 // Records metrics for visible system menu rows. Only implemented for the | 56 // Records metrics for visible system menu rows. Only implemented for the |
58 // BUBBLE_TYPE_DEFAULT BubbleType. | 57 // BUBBLE_TYPE_DEFAULT BubbleType. |
59 void RecordVisibleRowMetrics(); | 58 void RecordVisibleRowMetrics(); |
60 | 59 |
61 // Update the bounds of the system tray bubble. Close the bubble if | |
62 // |close_bubble| is set. | |
63 void AnimateToTargetBounds(const gfx::Rect& target_bounds, bool close_bubble); | |
64 | |
65 private: | 60 private: |
66 // Updates the bottom padding of the |bubble_view_| based on the | 61 // Updates the bottom padding of the |bubble_view_| based on the |
67 // |bubble_type_|. | 62 // |bubble_type_|. |
68 void UpdateBottomPadding(); | 63 void UpdateBottomPadding(); |
69 void CreateItemViews(LoginStatus login_status); | 64 void CreateItemViews(LoginStatus login_status); |
70 | 65 |
71 ash::SystemTray* tray_; | 66 ash::SystemTray* tray_; |
72 views::TrayBubbleView* bubble_view_; | 67 views::TrayBubbleView* bubble_view_; |
73 std::vector<ash::SystemTrayItem*> items_; | 68 std::vector<ash::SystemTrayItem*> items_; |
74 BubbleType bubble_type_; | 69 BubbleType bubble_type_; |
75 | 70 |
76 // Tracks the views created in the last call to CreateItemViews(). | 71 // Tracks the views created in the last call to CreateItemViews(). |
77 std::map<SystemTrayItem::UmaType, views::View*> tray_item_view_map_; | 72 std::map<SystemTrayItem::UmaType, views::View*> tray_item_view_map_; |
78 | 73 |
79 int autoclose_delay_; | 74 int autoclose_delay_; |
80 base::OneShotTimer autoclose_; | 75 base::OneShotTimer autoclose_; |
81 | 76 |
82 // Used in maximize mode to make sure the system tray bubble only be shown in | |
83 // work area. | |
84 std::unique_ptr<aura::Window> clipping_window_; | |
85 | |
86 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubble); | 77 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubble); |
87 }; | 78 }; |
88 | 79 |
89 } // namespace ash | 80 } // namespace ash |
90 | 81 |
91 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ | 82 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ |
OLD | NEW |