summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-28 23:40:17 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-28 23:40:17 +0000
commitd5ce9f68f2cac24a08e62afd245357ff636a66d1 (patch)
tree0ab510e68a88d01e6217ea42a28e1d04056d1e5d /views
parent8d3f80e9171c23d5c998af155da4ad8ce3b63802 (diff)
downloadchromium_src-d5ce9f68f2cac24a08e62afd245357ff636a66d1.zip
chromium_src-d5ce9f68f2cac24a08e62afd245357ff636a66d1.tar.gz
chromium_src-d5ce9f68f2cac24a08e62afd245357ff636a66d1.tar.bz2
Stub out textfield on GTK
BUG=none TEST=none Review URL: http://codereview.chromium.org/115886 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17133 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/hwnd_view.cc2
-rw-r--r--views/controls/native_control_gtk.cc2
-rw-r--r--views/controls/native_view_host_gtk.cc4
-rw-r--r--views/controls/textfield/native_textfield_gtk.cc83
-rw-r--r--views/controls/textfield/native_textfield_gtk.h46
-rw-r--r--views/controls/textfield/native_textfield_win.h2
-rw-r--r--views/views.gyp2
7 files changed, 135 insertions, 6 deletions
diff --git a/views/controls/hwnd_view.cc b/views/controls/hwnd_view.cc
index eaefe6c..77269f2 100644
--- a/views/controls/hwnd_view.cc
+++ b/views/controls/hwnd_view.cc
@@ -13,7 +13,7 @@ namespace views {
static const char kViewClassName[] = "views/HWNDView";
-HWNDView::HWNDView() {
+HWNDView::HWNDView() : NativeViewHost() {
}
HWNDView::~HWNDView() {
diff --git a/views/controls/native_control_gtk.cc b/views/controls/native_control_gtk.cc
index ad7382f..11781f6 100644
--- a/views/controls/native_control_gtk.cc
+++ b/views/controls/native_control_gtk.cc
@@ -10,7 +10,7 @@
namespace views {
-NativeControlGtk::NativeControlGtk() {
+NativeControlGtk::NativeControlGtk() : NativeViewHostGtk() {
}
NativeControlGtk::~NativeControlGtk() {
diff --git a/views/controls/native_view_host_gtk.cc b/views/controls/native_view_host_gtk.cc
index a6f125e..3f3952d 100644
--- a/views/controls/native_view_host_gtk.cc
+++ b/views/controls/native_view_host_gtk.cc
@@ -11,7 +11,9 @@
namespace views {
-NativeViewHostGtk::NativeViewHostGtk() : destroy_signal_id_(0) {
+NativeViewHostGtk::NativeViewHostGtk()
+ : NativeViewHost(),
+ destroy_signal_id_(0) {
}
NativeViewHostGtk::~NativeViewHostGtk() {
diff --git a/views/controls/textfield/native_textfield_gtk.cc b/views/controls/textfield/native_textfield_gtk.cc
index e69de29..87ef0db 100644
--- a/views/controls/textfield/native_textfield_gtk.cc
+++ b/views/controls/textfield/native_textfield_gtk.cc
@@ -0,0 +1,83 @@
+// 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.
+
+#include "views/controls/textfield/native_textfield_gtk.h"
+
+namespace views {
+
+////////////////////////////////////////////////////////////////////////////////
+// NativeTextfieldGtk, public:
+
+NativeTextfieldGtk::NativeTextfieldGtk(Textfield* textfield)
+ : NativeControlGtk() {
+}
+
+NativeTextfieldGtk::~NativeTextfieldGtk() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// NativeTextfieldGtk, NativeTextfieldWrapper implementation:
+
+std::wstring NativeTextfieldGtk::GetText() const {
+ return std::wstring();
+}
+
+void NativeTextfieldGtk::UpdateText() {
+}
+
+void NativeTextfieldGtk::AppendText(const std::wstring& text) {
+}
+
+std::wstring NativeTextfieldGtk::GetSelectedText() const {
+ return std::wstring();
+}
+
+void NativeTextfieldGtk::SelectAll() {
+}
+
+void NativeTextfieldGtk::ClearSelection() {
+}
+
+void NativeTextfieldGtk::UpdateBorder() {
+}
+
+void NativeTextfieldGtk::UpdateBackgroundColor() {
+}
+
+void NativeTextfieldGtk::UpdateReadOnly() {
+}
+
+void NativeTextfieldGtk::UpdateFont() {
+}
+
+void NativeTextfieldGtk::UpdateEnabled() {
+}
+
+void NativeTextfieldGtk::SetHorizontalMargins(int left, int right) {
+}
+
+void NativeTextfieldGtk::SetFocus() {
+}
+
+View* NativeTextfieldGtk::GetView() {
+ return this;
+}
+
+gfx::NativeView NativeTextfieldGtk::GetTestingHandle() const {
+ return native_view();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// NativeTextfieldGtk, NativeControlGtk overrides:
+
+void NativeTextfieldGtk::CreateNativeControl() {
+ // TODO(port): create gtk text field
+}
+
+void NativeTextfieldGtk::NativeControlCreated(GtkWidget* widget) {
+ NativeControlGtk::NativeControlCreated(widget);
+ // TODO(port): post-creation init
+}
+
+} // namespace views
diff --git a/views/controls/textfield/native_textfield_gtk.h b/views/controls/textfield/native_textfield_gtk.h
index e69de29..0633591 100644
--- a/views/controls/textfield/native_textfield_gtk.h
+++ b/views/controls/textfield/native_textfield_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_TEXTFIELD_NATIVE_TEXTFIELD_GTK_H_
+#define VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_GTK_H_
+
+#include "views/controls/native_control_gtk.h"
+#include "views/controls/textfield/native_textfield_wrapper.h"
+
+namespace views {
+
+class NativeTextfieldGtk : public NativeControlGtk,
+ public NativeTextfieldWrapper {
+ public:
+ explicit NativeTextfieldGtk(Textfield* parent);
+ ~NativeTextfieldGtk();
+
+ // Overridden from NativeTextfieldWrapper:
+ virtual std::wstring GetText() const;
+ virtual void UpdateText();
+ virtual void AppendText(const std::wstring& text);
+ virtual std::wstring GetSelectedText() const;
+ virtual void SelectAll();
+ virtual void ClearSelection();
+ virtual void UpdateBorder();
+ virtual void UpdateBackgroundColor();
+ virtual void UpdateReadOnly();
+ virtual void UpdateFont();
+ virtual void UpdateEnabled();
+ virtual void SetHorizontalMargins(int left, int right);
+ virtual void SetFocus();
+ virtual View* GetView();
+ virtual gfx::NativeView GetTestingHandle() const;
+
+ // Overridden from NativeControlGtk:
+ virtual void CreateNativeControl();
+ virtual void NativeControlCreated(GtkWidget* widget);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NativeTextfieldGtk);
+};
+
+} // namespace views
+
+#endif // VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_GTK_H_ \ No newline at end of file
diff --git a/views/controls/textfield/native_textfield_win.h b/views/controls/textfield/native_textfield_win.h
index b7c336f..6e8a12f 100644
--- a/views/controls/textfield/native_textfield_win.h
+++ b/views/controls/textfield/native_textfield_win.h
@@ -199,6 +199,6 @@ class NativeTextfieldWin
DISALLOW_COPY_AND_ASSIGN(NativeTextfieldWin);
};
-};
+} // namespace views
#endif // VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_WIN_H_
diff --git a/views/views.gyp b/views/views.gyp
index 00a79bb..5633572 100644
--- a/views/views.gyp
+++ b/views/views.gyp
@@ -252,8 +252,6 @@
'controls/tabbed_pane.cc',
'controls/table/table_view.cc',
'controls/table/group_table_view.cc',
- 'controls/textfield/textfield.cc',
- 'controls/text_field.cc',
'controls/tree/tree_view.cc',
'event_win.cc',
'resize_corner.cc',