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_LAUNCHER_LAUNCHER_BUTTON_H_ | 5 #ifndef ASH_LAUNCHER_LAUNCHER_BUTTON_H_ |
6 #define ASH_LAUNCHER_LAUNCHER_BUTTON_H_ | 6 #define ASH_LAUNCHER_LAUNCHER_BUTTON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/views/controls/button/custom_button.h" | 10 #include "ui/views/controls/button/custom_button.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // e.g. A TYPE_TABBED item that has a window. | 29 // e.g. A TYPE_TABBED item that has a window. |
30 STATE_RUNNING = 1 << 1, | 30 STATE_RUNNING = 1 << 1, |
31 // Underlying LauncherItem is active (i.e. has focus). | 31 // Underlying LauncherItem is active (i.e. has focus). |
32 STATE_ACTIVE = 1 << 2, | 32 STATE_ACTIVE = 1 << 2, |
33 // Underlying LauncherItem needs user's attention. | 33 // Underlying LauncherItem needs user's attention. |
34 STATE_ATTENTION = 1 << 3, | 34 STATE_ATTENTION = 1 << 3, |
35 // Underlying LauncherItem has pending operations. | 35 // Underlying LauncherItem has pending operations. |
36 // e.g. A TYPE_APP_SHORTCUT item whose corresponding app is being | 36 // e.g. A TYPE_APP_SHORTCUT item whose corresponding app is being |
37 // installed. | 37 // installed. |
38 STATE_PENDING = 1 << 4, | 38 STATE_PENDING = 1 << 4, |
| 39 STATE_FOCUSED = 1 << 5, |
39 }; | 40 }; |
40 | 41 |
41 virtual ~LauncherButton(); | 42 virtual ~LauncherButton(); |
42 | 43 |
43 // Called to create an instance of a LauncherButton. | 44 // Called to create an instance of a LauncherButton. |
44 static LauncherButton* Create(views::ButtonListener* listener, | 45 static LauncherButton* Create(views::ButtonListener* listener, |
45 LauncherButtonHost* host); | 46 LauncherButtonHost* host); |
46 | 47 |
47 // Sets the image to display for this entry. | 48 // Sets the image to display for this entry. |
48 void SetImage(const SkBitmap& image); | 49 void SetImage(const SkBitmap& image); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | 85 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; |
85 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; | 86 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; |
86 virtual void OnMouseCaptureLost() OVERRIDE; | 87 virtual void OnMouseCaptureLost() OVERRIDE; |
87 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; | 88 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; |
88 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; | 89 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; |
89 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; | 90 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; |
90 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 91 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
91 virtual void Layout() OVERRIDE; | 92 virtual void Layout() OVERRIDE; |
92 virtual bool GetTooltipText(const gfx::Point& p, | 93 virtual bool GetTooltipText(const gfx::Point& p, |
93 string16* tooltip) const OVERRIDE; | 94 string16* tooltip) const OVERRIDE; |
| 95 virtual void OnFocus() OVERRIDE; |
| 96 virtual void OnBlur() OVERRIDE; |
94 | 97 |
95 // Sets the icon image with a shadow. | 98 // Sets the icon image with a shadow. |
96 void SetShadowedImage(const SkBitmap& bitmap); | 99 void SetShadowedImage(const SkBitmap& bitmap); |
97 // Override for custom initialization. | 100 // Override for custom initialization. |
98 virtual void Init(); | 101 virtual void Init(); |
99 // Override to subclass IconView. | 102 // Override to subclass IconView. |
100 virtual IconView* CreateIconView(); | 103 virtual IconView* CreateIconView(); |
101 IconView* icon_view() const { return icon_view_; } | 104 IconView* icon_view() const { return icon_view_; } |
102 LauncherButtonHost* host() const { return host_; } | 105 LauncherButtonHost* host() const { return host_; } |
103 | 106 |
(...skipping 21 matching lines...) Expand all Loading... |
125 // has a STATE_PENDING bit and destroyed when that bit is clear. | 128 // has a STATE_PENDING bit and destroyed when that bit is clear. |
126 scoped_ptr<IconPulseAnimation> icon_pulse_animation_; | 129 scoped_ptr<IconPulseAnimation> icon_pulse_animation_; |
127 | 130 |
128 DISALLOW_COPY_AND_ASSIGN(LauncherButton); | 131 DISALLOW_COPY_AND_ASSIGN(LauncherButton); |
129 }; | 132 }; |
130 | 133 |
131 } // namespace internal | 134 } // namespace internal |
132 } // namespace ash | 135 } // namespace ash |
133 | 136 |
134 #endif // ASH_LAUNCHER_LAUNCHER_BUTTON_H_ | 137 #endif // ASH_LAUNCHER_LAUNCHER_BUTTON_H_ |
OLD | NEW |