diff options
Diffstat (limited to 'chrome/browser/gtk/find_bar_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/find_bar_gtk.cc | 52 |
1 files changed, 42 insertions, 10 deletions
diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc index 5bfe1c6..2398770 100644 --- a/chrome/browser/gtk/find_bar_gtk.cc +++ b/chrome/browser/gtk/find_bar_gtk.cc @@ -7,6 +7,7 @@ #include <gdk/gdkkeysyms.h> #include "base/string_util.h" +#include "chrome/browser/find_bar_controller.h" #include "chrome/browser/gtk/tab_contents_container_gtk.h" #include "chrome/browser/tab_contents/web_contents.h" @@ -20,13 +21,13 @@ gboolean EntryContentsChanged(GtkWindow* window, FindBarGtk* find_bar) { gboolean KeyPressEvent(GtkWindow* window, GdkEventKey* event, FindBarGtk* find_bar) { if (GDK_Escape == event->keyval) - find_bar->Hide(); + find_bar->EscapePressed(); return FALSE; } } -FindBarGtk::FindBarGtk() : web_contents_(NULL) { +FindBarGtk::FindBarGtk() { find_text_ = gtk_entry_new(); gtk_widget_show(find_text_); @@ -45,26 +46,57 @@ void FindBarGtk::Show() { gtk_widget_grab_focus(find_text_); } -void FindBarGtk::Hide() { +void FindBarGtk::Hide(bool animate) { + // TODO(tc): Animated slide away. gtk_widget_hide(container_); - if (web_contents_) - web_contents_->StopFinding(true); +} + +void FindBarGtk::SetFocusAndSelection() { +} + +void FindBarGtk::ClearResults(const FindNotificationDetails& results) { +} + +void FindBarGtk::StopAnimation() { + // No animation yet, so do nothing. +} + +void FindBarGtk::SetFindText(const std::wstring& find_text) { +} + +void FindBarGtk::UpdateUIForFindResult(const FindNotificationDetails& result, + const std::wstring& find_text) { +} + +gfx::Rect FindBarGtk::GetDialogPosition(gfx::Rect avoid_overlapping_rect) { + return gfx::Rect(); +} + +void FindBarGtk::SetDialogPosition(const gfx::Rect& new_pos, bool no_redraw) { +} + +bool FindBarGtk::IsFindBarVisible() { + return true; +} + +void FindBarGtk::RestoreSavedFocus() { } void FindBarGtk::ContentsChanged() { - if (!web_contents_) + WebContents* web_contents = find_bar_controller_->web_contents(); + if (!web_contents) return; std::string new_contents(gtk_entry_get_text(GTK_ENTRY(find_text_))); if (new_contents.length() > 0) { - web_contents_->StartFinding(UTF8ToWide(new_contents), true); + web_contents->StartFinding(UTF8ToWide(new_contents), true); } else { // The textbox is empty so we reset. - web_contents_->StopFinding(true); // true = clear selection on page. + web_contents->StopFinding(true); // true = clear selection on page. } } -void FindBarGtk::ChangeWebContents(WebContents* contents) { - web_contents_ = contents; +void FindBarGtk::EscapePressed() { + find_bar_controller_->EndFindSession(); } |