diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-09 17:07:05 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-09 17:07:05 +0000 |
commit | 7805c5b9f4aab9db058dcaf84ce747acf6549aa8 (patch) | |
tree | 0ca286d2bb0e9fb9c6534c882c200db88244f328 /views/controls | |
parent | 20b2450c1935dd0b9e91ad894926af703c30a5ad (diff) | |
download | chromium_src-7805c5b9f4aab9db058dcaf84ce747acf6549aa8.zip chromium_src-7805c5b9f4aab9db058dcaf84ce747acf6549aa8.tar.gz chromium_src-7805c5b9f4aab9db058dcaf84ce747acf6549aa8.tar.bz2 |
This CL adds some more FocusManager unit-tests.
BUG=None
TEST=Run the unit-tests.
Review URL: http://codereview.chromium.org/118413
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17951 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r-- | views/controls/button/native_button_gtk.cc | 4 | ||||
-rw-r--r-- | views/controls/button/native_button_gtk.h | 1 | ||||
-rw-r--r-- | views/controls/button/native_button_win.cc | 4 | ||||
-rw-r--r-- | views/controls/button/native_button_win.h | 1 | ||||
-rw-r--r-- | views/controls/button/native_button_wrapper.h | 3 | ||||
-rw-r--r-- | views/controls/textfield/textfield.h | 2 |
6 files changed, 14 insertions, 1 deletions
diff --git a/views/controls/button/native_button_gtk.cc b/views/controls/button/native_button_gtk.cc index 3731d45..e4355c1 100644 --- a/views/controls/button/native_button_gtk.cc +++ b/views/controls/button/native_button_gtk.cc @@ -68,6 +68,10 @@ void NativeButtonGtk::SetFocus() { Focus(); } +gfx::NativeView NativeButtonWin::GetTestingHandle() const { + return native_view(); +} + gfx::Size NativeButtonGtk::GetPreferredSize() { if (!native_view()) return gfx::Size(); diff --git a/views/controls/button/native_button_gtk.h b/views/controls/button/native_button_gtk.h index 96a8f53..e719202 100644 --- a/views/controls/button/native_button_gtk.h +++ b/views/controls/button/native_button_gtk.h @@ -23,6 +23,7 @@ class NativeButtonGtk : public NativeControlGtk, public NativeButtonWrapper { virtual void UpdateDefault(); virtual View* GetView(); virtual void SetFocus(); + virtual gfx::NativeView GetTestingHandle() const; // Overridden from View: virtual gfx::Size GetPreferredSize(); diff --git a/views/controls/button/native_button_win.cc b/views/controls/button/native_button_win.cc index 8d51907..fa00456 100644 --- a/views/controls/button/native_button_win.cc +++ b/views/controls/button/native_button_win.cc @@ -63,6 +63,10 @@ void NativeButtonWin::SetFocus() { Focus(); } +gfx::NativeView NativeButtonWin::GetTestingHandle() const { + return native_view(); +} + //////////////////////////////////////////////////////////////////////////////// // NativeButtonWin, View overrides: diff --git a/views/controls/button/native_button_win.h b/views/controls/button/native_button_win.h index 3f5141a..2b9d016 100644 --- a/views/controls/button/native_button_win.h +++ b/views/controls/button/native_button_win.h @@ -24,6 +24,7 @@ class NativeButtonWin : public NativeControlWin, virtual void UpdateDefault(); virtual View* GetView(); virtual void SetFocus(); + virtual gfx::NativeView GetTestingHandle() const; // Overridden from View: virtual gfx::Size GetPreferredSize(); diff --git a/views/controls/button/native_button_wrapper.h b/views/controls/button/native_button_wrapper.h index 07739af..0f2439c 100644 --- a/views/controls/button/native_button_wrapper.h +++ b/views/controls/button/native_button_wrapper.h @@ -44,6 +44,9 @@ class NativeButtonWrapper { // Sets the focus to the button. virtual void SetFocus() = 0; + // Returns a handle to the underlying native view for testing. + virtual gfx::NativeView GetTestingHandle() const = 0; + // Return the width of the button. Used for fixed size buttons (checkboxes and // radio buttons) only. static int GetFixedWidth(); diff --git a/views/controls/textfield/textfield.h b/views/controls/textfield/textfield.h index bbd9104..a008bea 100644 --- a/views/controls/textfield/textfield.h +++ b/views/controls/textfield/textfield.h @@ -183,10 +183,10 @@ class Textfield : public View { virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); virtual std::string GetClassName() const; - private: // The object that actually implements the native text field. NativeTextfieldWrapper* native_wrapper_; + private: // This is the current listener for events from this Textfield. Controller* controller_; |