| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_GTK_H_ | 5 #ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_GTK_H_ |
| 6 #define VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_GTK_H_ | 6 #define VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_GTK_H_ |
| 7 | 7 |
| 8 #include "views/controls/button/native_button_wrapper.h" | 8 #include "views/controls/button/native_button_wrapper.h" |
| 9 #include "views/controls/native_control_gtk.h" | 9 #include "views/controls/native_control_gtk.h" |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 virtual gfx::Size GetPreferredSize(); | 29 virtual gfx::Size GetPreferredSize(); |
| 30 | 30 |
| 31 protected: | 31 protected: |
| 32 virtual void CreateNativeControl(); | 32 virtual void CreateNativeControl(); |
| 33 virtual void NativeControlCreated(GtkWidget* widget); | 33 virtual void NativeControlCreated(GtkWidget* widget); |
| 34 | 34 |
| 35 // Returns true if this button is actually a checkbox or radio button. | 35 // Returns true if this button is actually a checkbox or radio button. |
| 36 virtual bool IsCheckbox() const { return false; } | 36 virtual bool IsCheckbox() const { return false; } |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 static void CallClicked(GtkButton* widget); | 39 static void CallClicked(GtkButton* widget, NativeButtonGtk* button); |
| 40 | 40 |
| 41 // Invoked when the user clicks on the button. | 41 // Invoked when the user clicks on the button. |
| 42 void OnClicked(); | 42 void OnClicked(); |
| 43 | 43 |
| 44 // The NativeButton we are bound to. | 44 // The NativeButton we are bound to. |
| 45 NativeButton* native_button_; | 45 NativeButton* native_button_; |
| 46 | 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(NativeButtonGtk); | 47 DISALLOW_COPY_AND_ASSIGN(NativeButtonGtk); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 class NativeCheckboxGtk : public NativeButtonGtk { | 50 class NativeCheckboxGtk : public NativeButtonGtk { |
| 51 public: | 51 public: |
| 52 explicit NativeCheckboxGtk(Checkbox* checkbox); | 52 explicit NativeCheckboxGtk(Checkbox* checkbox); |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 virtual void CreateNativeControl(); | 55 virtual void CreateNativeControl(); |
| 56 | 56 |
| 57 // Returns true if this button is actually a checkbox or radio button. | 57 // Returns true if this button is actually a checkbox or radio button. |
| 58 virtual bool IsCheckbox() const { return true; } | 58 virtual bool IsCheckbox() const { return true; } |
| 59 DISALLOW_COPY_AND_ASSIGN(NativeCheckboxGtk); | 59 DISALLOW_COPY_AND_ASSIGN(NativeCheckboxGtk); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace views | 62 } // namespace views |
| 63 | 63 |
| 64 #endif // #ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_GTK_H_ | 64 #endif // #ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_GTK_H_ |
| OLD | NEW |