summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/find_bar_gtk.h
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 17:03:37 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 17:03:37 +0000
commit92e175a8152b4a7226cf8715aed8501ed7d83187 (patch)
tree67ca4faf8de98eef08cbc592f4b16b8d08d739be /chrome/browser/gtk/find_bar_gtk.h
parent7985f9159ec6ba70fcdc4c76b6bc8787c074cb50 (diff)
downloadchromium_src-92e175a8152b4a7226cf8715aed8501ed7d83187.zip
chromium_src-92e175a8152b4a7226cf8715aed8501ed7d83187.tar.gz
chromium_src-92e175a8152b4a7226cf8715aed8501ed7d83187.tar.bz2
Some work in refactoring FindBarWin/FindBarView so
we can share code across platforms. See http://code.google.com/p/chromium/wiki/FindBarRefactoring for more information about the design. Review URL: http://codereview.chromium.org/42057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11544 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/find_bar_gtk.h')
-rw-r--r--chrome/browser/gtk/find_bar_gtk.h41
1 files changed, 29 insertions, 12 deletions
diff --git a/chrome/browser/gtk/find_bar_gtk.h b/chrome/browser/gtk/find_bar_gtk.h
index 9a38ce9..6ac3c41 100644
--- a/chrome/browser/gtk/find_bar_gtk.h
+++ b/chrome/browser/gtk/find_bar_gtk.h
@@ -5,33 +5,49 @@
#ifndef CHROME_BROWSER_GTK_FIND_BAR_GTK_H_
#define CHROME_BROWSER_GTK_FIND_BAR_GTK_H_
-#include <string>
+#include "chrome/browser/find_bar.h"
#include <gtk/gtk.h>
+#include <string>
+
+class FindBarController;
class TabContentsContainerGtk;
class WebContents;
// Currently this class contains both a model and a view. We may want to
// eventually pull out the model specific bits and share with Windows.
-class FindBarGtk {
+class FindBarGtk : public FindBar {
public:
FindBarGtk();
- ~FindBarGtk() { }
+ virtual ~FindBarGtk() { }
- // Show the find dialog if it's not already showing. The Find dialog is
- // positioned above the web contents area (TabContentsContainerGtk).
- void Show();
- void Hide();
+ void set_find_bar_controller(FindBarController* find_bar_controller) {
+ find_bar_controller_ = find_bar_controller;
+ }
// Callback when the text in the find box changes.
void ContentsChanged();
- // Callback from BrowserWindowGtk when the web contents changes.
- void ChangeWebContents(WebContents* contents);
+ // Callback when Escape is pressed.
+ void EscapePressed();
GtkWidget* gtk_widget() const { return container_; }
+ // Methods from FindBar.
+ virtual void Show();
+ virtual void Hide(bool animate);
+ virtual void SetFocusAndSelection();
+ virtual void ClearResults(const FindNotificationDetails& results);
+ virtual void StopAnimation();
+ virtual void SetFindText(const std::wstring& find_text);
+ virtual void UpdateUIForFindResult(const FindNotificationDetails& result,
+ const std::wstring& find_text);
+ virtual gfx::Rect GetDialogPosition(gfx::Rect avoid_overlapping_rect);
+ virtual void SetDialogPosition(const gfx::Rect& new_pos, bool no_redraw);
+ virtual bool IsFindBarVisible();
+ virtual void RestoreSavedFocus();
+
private:
// GtkHBox containing the find bar widgets.
GtkWidget* container_;
@@ -39,9 +55,10 @@ class FindBarGtk {
// The widget where text is entered.
GtkWidget* find_text_;
- // A non-owning pointer to the web contents associated with the find bar.
- // This can be NULL.
- WebContents* web_contents_;
+ // Pointer back to the owning controller.
+ FindBarController* find_bar_controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(FindBarGtk);
};
#endif // CHROME_BROWSER_GTK_FIND_BAR_GTK_H_