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 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ui/gfx/shadow_value.h" | 9 #include "ui/gfx/shadow_value.h" |
10 #include "ui/views/controls/button/custom_button.h" | 10 #include "ui/views/controls/button/custom_button.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // implementation, by overriding CreateIconView(). | 64 // implementation, by overriding CreateIconView(). |
65 class IconView : public views::ImageView { | 65 class IconView : public views::ImageView { |
66 public: | 66 public: |
67 IconView(); | 67 IconView(); |
68 virtual ~IconView(); | 68 virtual ~IconView(); |
69 | 69 |
70 void set_icon_size(int icon_size) { icon_size_ = icon_size; } | 70 void set_icon_size(int icon_size) { icon_size_ = icon_size; } |
71 int icon_size() const { return icon_size_; } | 71 int icon_size() const { return icon_size_; } |
72 | 72 |
73 // views::View overrides. | 73 // views::View overrides. |
74 virtual bool HitTest(const gfx::Point& l) const OVERRIDE; | 74 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; |
75 | 75 |
76 private: | 76 private: |
77 // Set to non-zero to force icons to be resized to fit within a square, | 77 // Set to non-zero to force icons to be resized to fit within a square, |
78 // while maintaining original proportions. | 78 // while maintaining original proportions. |
79 int icon_size_; | 79 int icon_size_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(IconView); | 81 DISALLOW_COPY_AND_ASSIGN(IconView); |
82 }; | 82 }; |
83 | 83 |
84 // View overrides: | 84 // View overrides: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 gfx::ShadowValues icon_shadows_; | 132 gfx::ShadowValues icon_shadows_; |
133 | 133 |
134 DISALLOW_COPY_AND_ASSIGN(LauncherButton); | 134 DISALLOW_COPY_AND_ASSIGN(LauncherButton); |
135 }; | 135 }; |
136 | 136 |
137 } // namespace internal | 137 } // namespace internal |
138 } // namespace ash | 138 } // namespace ash |
139 | 139 |
140 #endif // ASH_LAUNCHER_LAUNCHER_BUTTON_H_ | 140 #endif // ASH_LAUNCHER_LAUNCHER_BUTTON_H_ |
OLD | NEW |