Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Side by Side Diff: ash/launcher/launcher_tooltip_manager.h

Issue 11434099: Use the correct launcher assets for shelf alignment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_LAUNCHER_LAUNCHER_TOOLTIP_MANAGER_H_ 5 #ifndef ASH_LAUNCHER_LAUNCHER_TOOLTIP_MANAGER_H_
6 #define ASH_LAUNCHER_LAUNCHER_TOOLTIP_MANAGER_H_ 6 #define ASH_LAUNCHER_LAUNCHER_TOOLTIP_MANAGER_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/wm/session_state_observer.h" 9 #include "ash/wm/session_state_observer.h"
10 #include "ash/wm/shelf_layout_manager.h" 10 #include "ash/wm/shelf_layout_manager.h"
(...skipping 22 matching lines...) Expand all
33 33
34 namespace internal { 34 namespace internal {
35 class LauncherView; 35 class LauncherView;
36 36
37 // LauncherTooltipManager manages the tooltip balloon poping up on launcher 37 // LauncherTooltipManager manages the tooltip balloon poping up on launcher
38 // items. 38 // items.
39 class ASH_EXPORT LauncherTooltipManager : public ui::EventHandler, 39 class ASH_EXPORT LauncherTooltipManager : public ui::EventHandler,
40 public ShelfLayoutManager::Observer, 40 public ShelfLayoutManager::Observer,
41 public SessionStateObserver { 41 public SessionStateObserver {
42 public: 42 public:
43 LauncherTooltipManager(ShelfAlignment alignment, 43 LauncherTooltipManager(ShelfLayoutManager* shelf_layout_manager,
44 ShelfLayoutManager* shelf_layout_manager,
45 LauncherView* launcher_view); 44 LauncherView* launcher_view);
46 virtual ~LauncherTooltipManager(); 45 virtual ~LauncherTooltipManager();
47 46
47 ShelfLayoutManager* shelf_layout_manager() {
48 return shelf_layout_manager_;
49 }
50
48 // Called when the bubble is closed. 51 // Called when the bubble is closed.
49 void OnBubbleClosed(views::BubbleDelegateView* view); 52 void OnBubbleClosed(views::BubbleDelegateView* view);
50 53
51 // Shows the tooltip after a delay. It also has the appearing animation. 54 // Shows the tooltip after a delay. It also has the appearing animation.
52 void ShowDelayed(views::View* anchor, const string16& text); 55 void ShowDelayed(views::View* anchor, const string16& text);
53 56
54 // Shows the tooltip immediately. It omits the appearing animation. 57 // Shows the tooltip immediately. It omits the appearing animation.
55 void ShowImmediately(views::View* anchor, const string16& text); 58 void ShowImmediately(views::View* anchor, const string16& text);
56 59
57 // Closes the tooltip. 60 // Closes the tooltip.
58 void Close(); 61 void Close();
59 62
60 // Changes the arrow location of the tooltip in case that the launcher 63 // Changes the arrow location of the tooltip in case that the launcher
61 // arrangement has changed. 64 // arrangement has changed.
62 void SetArrowLocation(ShelfAlignment alignment); 65 void UpdateArrowLocation();
63 66
64 // Resets the timer for the delayed showing |view_|. If the timer isn't 67 // Resets the timer for the delayed showing |view_|. If the timer isn't
65 // running, it starts a new timer. 68 // running, it starts a new timer.
66 void ResetTimer(); 69 void ResetTimer();
67 70
68 // Stops the timer for the delayed showing |view_|. 71 // Stops the timer for the delayed showing |view_|.
69 void StopTimer(); 72 void StopTimer();
70 73
71 // Returns true if the tooltip is currently visible. 74 // Returns true if the tooltip is currently visible.
72 bool IsVisible(); 75 bool IsVisible();
(...skipping 22 matching lines...) Expand all
95 98
96 void CancelHidingAnimation(); 99 void CancelHidingAnimation();
97 void CloseSoon(); 100 void CloseSoon();
98 void ShowInternal(); 101 void ShowInternal();
99 void CreateBubble(views::View* anchor, const string16& text); 102 void CreateBubble(views::View* anchor, const string16& text);
100 103
101 LauncherTooltipBubble* view_; 104 LauncherTooltipBubble* view_;
102 views::Widget* widget_; 105 views::Widget* widget_;
103 views::View* anchor_; 106 views::View* anchor_;
104 string16 text_; 107 string16 text_;
105 ShelfAlignment alignment_;
106 scoped_ptr<base::Timer> timer_; 108 scoped_ptr<base::Timer> timer_;
107 109
108 ShelfLayoutManager* shelf_layout_manager_; 110 ShelfLayoutManager* shelf_layout_manager_;
109 LauncherView* launcher_view_; 111 LauncherView* launcher_view_;
110 112
111 DISALLOW_COPY_AND_ASSIGN(LauncherTooltipManager); 113 DISALLOW_COPY_AND_ASSIGN(LauncherTooltipManager);
112 }; 114 };
113 115
114 } // namespace internal 116 } // namespace internal
115 } // namespace ash 117 } // namespace ash
116 118
117 #endif // ASH_LAUNCHER_LAUNCHER_TOOLTIP_MANAGER_H_ 119 #endif // ASH_LAUNCHER_LAUNCHER_TOOLTIP_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698