diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 22:06:19 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 22:06:19 +0000 |
commit | 44f773c63bbe33388c71bac110e097a0bf106664 (patch) | |
tree | 1996d8ceee903a7061c4dddd8fbba43c3570ff03 /chrome/browser/views/find_bar_view.h | |
parent | 22a3daa444d2ef3efd1e11fdcd6216c0f5b474a5 (diff) | |
download | chromium_src-44f773c63bbe33388c71bac110e097a0bf106664.zip chromium_src-44f773c63bbe33388c71bac110e097a0bf106664.tar.gz chromium_src-44f773c63bbe33388c71bac110e097a0bf106664.tar.bz2 |
Refactored FindBarHost/View to create DropdownBarHostView, which I'm plannig to use this
for CompactLocationBar.
BUG=None
TEST=enabled find_bar_host_browsertest.cc for linux view build.
Review URL: http://codereview.chromium.org/360044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31486 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/find_bar_view.h')
-rw-r--r-- | chrome/browser/views/find_bar_view.h | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/chrome/browser/views/find_bar_view.h b/chrome/browser/views/find_bar_view.h index 184482e..8e74d5f 100644 --- a/chrome/browser/views/find_bar_view.h +++ b/chrome/browser/views/find_bar_view.h @@ -8,6 +8,7 @@ #include "base/gfx/size.h" #include "base/string16.h" #include "chrome/browser/find_notification_details.h" +#include "chrome/browser/views/dropdown_bar_view.h" #include "views/controls/button/button.h" #include "views/controls/textfield/textfield.h" @@ -22,12 +23,12 @@ class View; //////////////////////////////////////////////////////////////////////////////// // -// The FindInPageView is responsible for drawing the UI controls of the -// FindInPage window, the find text box, the 'Find' button and the 'Close' +// The FindBarView is responsible for drawing the UI controls of the +// FindBar, the find text box, the 'Find' button and the 'Close' // button. It communicates the user search words to the FindBarHost. // //////////////////////////////////////////////////////////////////////////////// -class FindBarView : public views::View, +class FindBarView : public DropdownBarView, public views::ButtonListener, public views::Textfield::Controller { public: @@ -38,7 +39,7 @@ class FindBarView : public views::View, CLOSE_TAG, // The Close button (the 'X'). }; - explicit FindBarView(FindBarHost* container); + explicit FindBarView(FindBarHost* host); virtual ~FindBarView(); // Sets the text displayed in the text box. @@ -50,17 +51,13 @@ class FindBarView : public views::View, const string16& find_text); // Claims focus for the text field and selects its contents. - void SetFocusAndSelection(); - - // Updates the view to let it know where the controller is clipping the - // Find window (while animating the opening or closing of the window). - void animation_offset(int offset) { animation_offset_ = offset; } + virtual void SetFocusAndSelection(); // Overridden from views::View: virtual void Paint(gfx::Canvas* canvas); virtual void Layout(); virtual gfx::Size GetPreferredSize(); - virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); + virtual void ViewHierarchyChanged(bool is_add, views::View* parent, views::View* child); // Overridden from views::ButtonListener: virtual void ButtonPressed(views::Button* sender, const views::Event& event); @@ -95,9 +92,9 @@ class FindBarView : public views::View, DISALLOW_COPY_AND_ASSIGN(FocusForwarderView); }; - // Manages the OS-specific view for the find bar and acts as an intermediary + // Returns the OS-specific view for the find bar that acts as an intermediary // between us and the TabContentsView. - FindBarHost* container_; + FindBarHost* find_bar_host() const; // The controls in the window. views::Textfield* find_text_; @@ -107,12 +104,6 @@ class FindBarView : public views::View, views::ImageButton* find_next_button_; views::ImageButton* close_button_; - // While animating, the controller clips the window and draws only the bottom - // part of it. The view needs to know the pixel offset at which we are drawing - // the window so that we can draw the curved edges that attach to the toolbar - // in the right location. - int animation_offset_; - DISALLOW_COPY_AND_ASSIGN(FindBarView); }; |