Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROME_BROWSER_UI_VIEWS_BAR_CONTROL_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_BAR_CONTROL_BUTTON_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_BAR_CONTROL_BUTTON_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_BAR_CONTROL_BUTTON_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "ui/views/controls/button/image_button.h" | 12 #include "ui/views/controls/button/image_button.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 enum class VectorIconId; | 15 enum class VectorIconId; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace views { | |
| 19 class InkDropDelegate; | |
|
bruthig
2016/06/09 03:26:00
I guess I missed these, thanks for cleaning them u
mohsen
2016/06/09 21:24:51
No problem!
| |
| 20 } | |
| 21 | |
| 22 // A class for buttons that control bars (find bar, download shelf, etc.). The | 18 // A class for buttons that control bars (find bar, download shelf, etc.). The |
| 23 // button has an image and no text. | 19 // button has an image and no text. |
| 24 class BarControlButton : public views::ImageButton { | 20 class BarControlButton : public views::ImageButton { |
| 25 public: | 21 public: |
| 26 explicit BarControlButton(views::ButtonListener* listener); | 22 explicit BarControlButton(views::ButtonListener* listener); |
| 27 ~BarControlButton() override; | 23 ~BarControlButton() override; |
| 28 | 24 |
| 29 // Sets the icon to display and provides a callback which should return the | 25 // Sets the icon to display and provides a callback which should return the |
| 30 // text color from which to derive this icon's color. | 26 // text color from which to derive this icon's color. |
| 31 void SetIcon(gfx::VectorIconId id, | 27 void SetIcon(gfx::VectorIconId id, |
| 32 const base::Callback<SkColor(void)>& get_text_color_callback); | 28 const base::Callback<SkColor(void)>& get_text_color_callback); |
| 33 | 29 |
| 34 // views::ImageButton: | 30 // views::ImageButton: |
| 35 void OnThemeChanged() override; | 31 void OnThemeChanged() override; |
| 36 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 32 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
| 37 | 33 |
| 38 private: | 34 private: |
| 39 gfx::VectorIconId id_; | 35 gfx::VectorIconId id_; |
| 40 base::Callback<SkColor(void)> get_text_color_callback_; | 36 base::Callback<SkColor(void)> get_text_color_callback_; |
| 41 | 37 |
| 42 DISALLOW_COPY_AND_ASSIGN(BarControlButton); | 38 DISALLOW_COPY_AND_ASSIGN(BarControlButton); |
| 43 }; | 39 }; |
| 44 | 40 |
| 45 #endif // CHROME_BROWSER_UI_VIEWS_BAR_CONTROL_BUTTON_H_ | 41 #endif // CHROME_BROWSER_UI_VIEWS_BAR_CONTROL_BUTTON_H_ |
| OLD | NEW |