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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; | 69 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; |
70 virtual void OnMouseCaptureLost() OVERRIDE; | 70 virtual void OnMouseCaptureLost() OVERRIDE; |
71 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; | 71 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; |
72 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; | 72 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; |
73 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; | 73 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; |
74 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 74 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
75 virtual void Layout() OVERRIDE; | 75 virtual void Layout() OVERRIDE; |
76 virtual bool GetTooltipText(const gfx::Point& p, | 76 virtual bool GetTooltipText(const gfx::Point& p, |
77 string16* tooltip) const OVERRIDE; | 77 string16* tooltip) const OVERRIDE; |
78 | 78 |
| 79 // Sets the icon image with a shadow. |
| 80 void SetShadowedImage(const SkBitmap& bitmap); |
79 // Override for custom initialization. | 81 // Override for custom initialization. |
80 virtual void Init(); | 82 virtual void Init(); |
81 // Override to subclass IconView. | 83 // Override to subclass IconView. |
82 virtual IconView* CreateIconView(); | 84 virtual IconView* CreateIconView(); |
83 IconView* icon_view() const { return icon_view_; } | 85 IconView* icon_view() const { return icon_view_; } |
84 LauncherButtonHost* host() const { return host_; } | 86 LauncherButtonHost* host() const { return host_; } |
85 | 87 |
86 private: | 88 private: |
87 // Updates the parts of the button to reflect the current state_. This may | 89 // Updates the parts of the button to reflect the current state_. This may |
88 // add or remove views, layout and paint. | 90 // add or remove views, layout and paint. |
89 void UpdateState(); | 91 void UpdateState(); |
90 | 92 |
91 LauncherButtonHost* host_; | 93 LauncherButtonHost* host_; |
92 IconView* icon_view_; | 94 IconView* icon_view_; |
93 // Draws a bar underneath the image to represent the state of the application. | 95 // Draws a bar underneath the image to represent the state of the application. |
94 views::ImageView* bar_; | 96 views::ImageView* bar_; |
95 // The current state of the application, multiple values of AppState are or'd | 97 // The current state of the application, multiple values of AppState are or'd |
96 // together. | 98 // together. |
97 int state_; | 99 int state_; |
98 | 100 |
99 DISALLOW_COPY_AND_ASSIGN(LauncherButton); | 101 DISALLOW_COPY_AND_ASSIGN(LauncherButton); |
100 }; | 102 }; |
101 | 103 |
102 } // namespace internal | 104 } // namespace internal |
103 } // namespace ash | 105 } // namespace ash |
104 | 106 |
105 #endif // ASH_LAUNCHER_APP_LAUNCHER_BUTTON_H_ | 107 #endif // ASH_LAUNCHER_APP_LAUNCHER_BUTTON_H_ |
OLD | NEW |