summaryrefslogtreecommitdiffstats
path: root/views/controls/button/native_button_gtk.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-11 21:59:06 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-11 21:59:06 +0000
commit1558020441c8b594993252707f610dc2de481bad (patch)
tree2f5e0ea5af1965f9820c2979e7b79237ba17ef53 /views/controls/button/native_button_gtk.h
parentb6ca264f3c8d6b010e92774f1ef508dc3c39604e (diff)
downloadchromium_src-1558020441c8b594993252707f610dc2de481bad.zip
chromium_src-1558020441c8b594993252707f610dc2de481bad.tar.gz
chromium_src-1558020441c8b594993252707f610dc2de481bad.tar.bz2
Adds back some code removed during Ben's landing of views renaming.
Adds support for GTK buttons. BUG=none TEST=none Review URL: http://codereview.chromium.org/113212 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15793 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/button/native_button_gtk.h')
-rw-r--r--views/controls/button/native_button_gtk.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/views/controls/button/native_button_gtk.h b/views/controls/button/native_button_gtk.h
new file mode 100644
index 0000000..e76a703
--- /dev/null
+++ b/views/controls/button/native_button_gtk.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
+
+#ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_GTK_H_
+#define VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_GTK_H_
+
+#include "views/controls/button/native_button_wrapper.h"
+#include "views/controls/native_control_gtk.h"
+
+namespace views {
+
+// A View that hosts a native GTK button.
+class NativeButtonGtk : public NativeControlGtk, public NativeButtonWrapper {
+ public:
+ explicit NativeButtonGtk(NativeButton* native_button);
+ virtual ~NativeButtonGtk();
+
+ // Overridden from NativeButtonWrapper:
+ virtual void UpdateLabel();
+ virtual void UpdateFont();
+ virtual void UpdateEnabled();
+ virtual void UpdateDefault();
+ virtual View* GetView();
+ virtual void SetFocus();
+
+ // Overridden from View:
+ virtual gfx::Size GetPreferredSize();
+
+ protected:
+ virtual void CreateNativeControl();
+ virtual void NativeControlCreated(GtkWidget* widget);
+
+ // Returns true if this button is actually a checkbox or radio button.
+ virtual bool IsCheckbox() const { return false; }
+
+ private:
+ // The NativeButton we are bound to.
+ NativeButton* native_button_;
+
+ DISALLOW_COPY_AND_ASSIGN(NativeButtonGtk);
+};
+
+} // namespace views
+
+#endif // #ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_GTK_H_