summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 04:42:16 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 04:42:16 +0000
commitc7622f5da7a78a667ee6b31aab8ba38734ba69e1 (patch)
treeb70ce6322de45ed945dcd7b03e6ed7df929db7ff /chrome
parentd7dd9842e776eb4d512355d3b4eb1b2918cc2ea1 (diff)
downloadchromium_src-c7622f5da7a78a667ee6b31aab8ba38734ba69e1.zip
chromium_src-c7622f5da7a78a667ee6b31aab8ba38734ba69e1.tar.gz
chromium_src-c7622f5da7a78a667ee6b31aab8ba38734ba69e1.tar.bz2
Find bar:
- system bell for linux find bar when search not found - move "not found" logic to find bar controller Review URL: http://codereview.chromium.org/112002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15382 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/find_bar_bridge.h2
-rw-r--r--chrome/browser/cocoa/find_bar_bridge.mm3
-rw-r--r--chrome/browser/find_bar.h5
-rw-r--r--chrome/browser/find_bar_controller.cc5
-rw-r--r--chrome/browser/gtk/find_bar_gtk.cc4
-rw-r--r--chrome/browser/gtk/find_bar_gtk.h2
-rw-r--r--chrome/browser/views/find_bar_win.cc6
-rw-r--r--chrome/browser/views/find_bar_win.h2
8 files changed, 14 insertions, 15 deletions
diff --git a/chrome/browser/cocoa/find_bar_bridge.h b/chrome/browser/cocoa/find_bar_bridge.h
index d54d57a..970679c 100644
--- a/chrome/browser/cocoa/find_bar_bridge.h
+++ b/chrome/browser/cocoa/find_bar_bridge.h
@@ -62,7 +62,7 @@ class FindBarBridge : public FindBar {
virtual void SetFindText(const string16& find_text);
virtual void UpdateUIForFindResult(const FindNotificationDetails& result,
const string16& find_text);
- virtual void AudibleAlertIfNotFound(const FindNotificationDetails& result);
+ virtual void AudibleAlert();
virtual gfx::Rect GetDialogPosition(gfx::Rect avoid_overlapping_rect);
virtual void SetDialogPosition(const gfx::Rect& new_pos, bool no_redraw);
virtual bool IsFindBarVisible();
diff --git a/chrome/browser/cocoa/find_bar_bridge.mm b/chrome/browser/cocoa/find_bar_bridge.mm
index e7c2f9b..8e570f1 100644
--- a/chrome/browser/cocoa/find_bar_bridge.mm
+++ b/chrome/browser/cocoa/find_bar_bridge.mm
@@ -38,8 +38,7 @@ void FindBarBridge::UpdateUIForFindResult(const FindNotificationDetails& result,
[cocoa_controller_ updateUIForFindResult:result withText:find_text];
}
-void FindBarBridge::AudibleAlertIfNotFound(
- const FindNotificationDetails& result) {
+void FindBarBridge::AudibleAlert() {
// TODO(rohitrao): Beep beep, beep beep, Yeah!
}
diff --git a/chrome/browser/find_bar.h b/chrome/browser/find_bar.h
index c912b81..6fcd5d1 100644
--- a/chrome/browser/find_bar.h
+++ b/chrome/browser/find_bar.h
@@ -60,9 +60,8 @@ class FindBar {
virtual void UpdateUIForFindResult(const FindNotificationDetails& result,
const string16& find_text) = 0;
- // Play an audible alert if no match was found.
- virtual void AudibleAlertIfNotFound(
- const FindNotificationDetails& result) = 0;
+ // No match was found; play an audible alert.
+ virtual void AudibleAlert() = 0;
// Returns the rectangle representing where to position the find bar. It uses
// GetDialogBounds and positions itself within that, either to the left (if an
diff --git a/chrome/browser/find_bar_controller.cc b/chrome/browser/find_bar_controller.cc
index 2d273f1..087cb5a 100644
--- a/chrome/browser/find_bar_controller.cc
+++ b/chrome/browser/find_bar_controller.cc
@@ -121,7 +121,10 @@ void FindBarController::Observe(NotificationType type,
if (Source<TabContents>(source).ptr() == tab_contents_) {
find_bar_->UpdateUIForFindResult(tab_contents_->find_result(),
tab_contents_->find_text());
- find_bar_->AudibleAlertIfNotFound(tab_contents_->find_result());
+ if (tab_contents_->find_result().final_update() &&
+ tab_contents_->find_result().number_of_matches() == 0) {
+ find_bar_->AudibleAlert();
+ }
}
} else if (type == NotificationType::NAV_ENTRY_COMMITTED) {
NavigationController* source_controller =
diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc
index 6a9437f4..a7effc6 100644
--- a/chrome/browser/gtk/find_bar_gtk.cc
+++ b/chrome/browser/gtk/find_bar_gtk.cc
@@ -210,8 +210,8 @@ void FindBarGtk::UpdateUIForFindResult(const FindNotificationDetails& result,
const string16& find_text) {
}
-void FindBarGtk::AudibleAlertIfNotFound(const FindNotificationDetails& result) {
- // TODO(estade): Beep beep, beep beep, Yeah!
+void FindBarGtk::AudibleAlert() {
+ gtk_widget_error_bell(widget());
}
gfx::Rect FindBarGtk::GetDialogPosition(gfx::Rect avoid_overlapping_rect) {
diff --git a/chrome/browser/gtk/find_bar_gtk.h b/chrome/browser/gtk/find_bar_gtk.h
index 592b50c..585cf48 100644
--- a/chrome/browser/gtk/find_bar_gtk.h
+++ b/chrome/browser/gtk/find_bar_gtk.h
@@ -45,7 +45,7 @@ class FindBarGtk : public FindBar,
virtual void SetFindText(const string16& find_text);
virtual void UpdateUIForFindResult(const FindNotificationDetails& result,
const string16& find_text);
- virtual void AudibleAlertIfNotFound(const FindNotificationDetails& result);
+ virtual void AudibleAlert();
virtual gfx::Rect GetDialogPosition(gfx::Rect avoid_overlapping_rect);
virtual void SetDialogPosition(const gfx::Rect& new_pos, bool no_redraw);
virtual bool IsFindBarVisible();
diff --git a/chrome/browser/views/find_bar_win.cc b/chrome/browser/views/find_bar_win.cc
index a579130..7ada890 100644
--- a/chrome/browser/views/find_bar_win.cc
+++ b/chrome/browser/views/find_bar_win.cc
@@ -550,8 +550,6 @@ void FindBarWin::UpdateUIForFindResult(const FindNotificationDetails& result,
focus_tracker_.reset(NULL);
}
-void FindBarWin::AudibleAlertIfNotFound(
- const FindNotificationDetails& result) {
- if (result.final_update() && result.number_of_matches() == 0)
- MessageBeep(MB_OK);
+void FindBarWin::AudibleAlert() {
+ MessageBeep(MB_OK);
}
diff --git a/chrome/browser/views/find_bar_win.h b/chrome/browser/views/find_bar_win.h
index ccdb497..1073e76 100644
--- a/chrome/browser/views/find_bar_win.h
+++ b/chrome/browser/views/find_bar_win.h
@@ -82,7 +82,7 @@ class FindBarWin : public views::FocusChangeListener,
virtual void SetFindText(const string16& find_text);
virtual void UpdateUIForFindResult(const FindNotificationDetails& result,
const string16& find_text);
- virtual void AudibleAlertIfNotFound(const FindNotificationDetails& result);
+ virtual void AudibleAlert();
virtual gfx::Rect GetDialogPosition(gfx::Rect avoid_overlapping_rect);
virtual void SetDialogPosition(const gfx::Rect& new_pos, bool no_redraw);
virtual bool IsFindBarVisible();