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 "ui/views/controls/button/custom_button.h" | 9 #include "ui/views/controls/button/custom_button.h" |
10 #include "ui/views/controls/image_view.h" | 10 #include "ui/views/controls/image_view.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 LauncherButtonHost* host); | 32 LauncherButtonHost* host); |
33 | 33 |
34 // Sets the image to display for this entry. | 34 // Sets the image to display for this entry. |
35 void SetImage(const SkBitmap& image); | 35 void SetImage(const SkBitmap& image); |
36 | 36 |
37 // |state| is or'd into the current state. | 37 // |state| is or'd into the current state. |
38 void AddState(State state); | 38 void AddState(State state); |
39 void ClearState(State state); | 39 void ClearState(State state); |
40 int state() const { return state_; } | 40 int state() const { return state_; } |
41 | 41 |
| 42 // Returns the bounds of the icon. |
| 43 gfx::Rect GetIconBounds() const; |
| 44 |
42 protected: | 45 protected: |
43 LauncherButton(views::ButtonListener* listener, LauncherButtonHost* host); | 46 LauncherButton(views::ButtonListener* listener, LauncherButtonHost* host); |
44 | 47 |
45 // Class that draws the icon part of a button, so it can be animated | 48 // Class that draws the icon part of a button, so it can be animated |
46 // independently of the rest. This can be subclassed to provide a custom | 49 // independently of the rest. This can be subclassed to provide a custom |
47 // implementation, by overriding CreateIconView(). | 50 // implementation, by overriding CreateIconView(). |
48 class IconView : public views::ImageView { | 51 class IconView : public views::ImageView { |
49 public: | 52 public: |
50 IconView(); | 53 IconView(); |
51 virtual ~IconView(); | 54 virtual ~IconView(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // together. | 96 // together. |
94 int state_; | 97 int state_; |
95 | 98 |
96 DISALLOW_COPY_AND_ASSIGN(LauncherButton); | 99 DISALLOW_COPY_AND_ASSIGN(LauncherButton); |
97 }; | 100 }; |
98 | 101 |
99 } // namespace internal | 102 } // namespace internal |
100 } // namespace ash | 103 } // namespace ash |
101 | 104 |
102 #endif // ASH_LAUNCHER_APP_LAUNCHER_BUTTON_H_ | 105 #endif // ASH_LAUNCHER_APP_LAUNCHER_BUTTON_H_ |
OLD | NEW |