diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 19:51:34 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 19:51:34 +0000 |
commit | 55902b55116fe36b88a719b13c15d38d9b3c08ff (patch) | |
tree | cb05a30d82fe83499e09368caad8120557b696e2 /views/controls/button/native_button_gtk.cc | |
parent | 7a08a49f266ca32581b95016cfa65a5679c5dcf1 (diff) | |
download | chromium_src-55902b55116fe36b88a719b13c15d38d9b3c08ff.zip chromium_src-55902b55116fe36b88a719b13c15d38d9b3c08ff.tar.gz chromium_src-55902b55116fe36b88a719b13c15d38d9b3c08ff.tar.bz2 |
Add basic checkbox support for GTK.
This also makes the Checkbox check for the native wrapper just like
NativeButton does, to prevent crashes if it hasn't been initialized yet.
Review URL: http://codereview.chromium.org/113408
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16094 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/button/native_button_gtk.cc')
-rw-r--r-- | views/controls/button/native_button_gtk.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/views/controls/button/native_button_gtk.cc b/views/controls/button/native_button_gtk.cc index e140b21..858fdcd 100644 --- a/views/controls/button/native_button_gtk.cc +++ b/views/controls/button/native_button_gtk.cc @@ -86,10 +86,31 @@ void NativeButtonGtk::NativeControlCreated(GtkWidget* widget) { UpdateDefault(); } +NativeCheckboxGtk::NativeCheckboxGtk(Checkbox* checkbox) + : NativeButtonGtk(checkbox) { +} + +void NativeCheckboxGtk::CreateNativeControl() { + GtkWidget* widget = gtk_check_button_new(); + NativeControlCreated(widget); +} + +// static +int NativeButtonWrapper::GetFixedWidth() { + // TODO(brettw) implement this properly. + return 10; +} + // static NativeButtonWrapper* NativeButtonWrapper::CreateNativeButtonWrapper( NativeButton* native_button) { return new NativeButtonGtk(native_button); } +// static +NativeButtonWrapper* NativeButtonWrapper::CreateCheckboxWrapper( + Checkbox* checkbox) { + return new NativeCheckboxGtk(checkbox); +} + } // namespace views |