summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/find_bar_bridge.h1
-rw-r--r--chrome/browser/cocoa/find_bar_bridge.mm5
-rw-r--r--chrome/browser/find_bar.h4
-rw-r--r--chrome/browser/find_bar_controller.cc1
-rw-r--r--chrome/browser/gtk/find_bar_gtk.cc4
-rw-r--r--chrome/browser/gtk/find_bar_gtk.h1
-rw-r--r--chrome/browser/views/find_bar_view.cc1
-rw-r--r--chrome/browser/views/find_bar_win.cc6
-rw-r--r--chrome/browser/views/find_bar_win.h1
9 files changed, 23 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/find_bar_bridge.h b/chrome/browser/cocoa/find_bar_bridge.h
index 2388733..d54d57a 100644
--- a/chrome/browser/cocoa/find_bar_bridge.h
+++ b/chrome/browser/cocoa/find_bar_bridge.h
@@ -62,6 +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 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 8cb37e4..e7c2f9b 100644
--- a/chrome/browser/cocoa/find_bar_bridge.mm
+++ b/chrome/browser/cocoa/find_bar_bridge.mm
@@ -38,6 +38,11 @@ void FindBarBridge::UpdateUIForFindResult(const FindNotificationDetails& result,
[cocoa_controller_ updateUIForFindResult:result withText:find_text];
}
+void FindBarBridge::AudibleAlertIfNotFound(
+ const FindNotificationDetails& result) {
+ // TODO(rohitrao): Beep beep, beep beep, Yeah!
+}
+
bool FindBarBridge::IsFindBarVisible() {
return [cocoa_controller_ isFindBarVisible] ? true : false;
}
diff --git a/chrome/browser/find_bar.h b/chrome/browser/find_bar.h
index 7321113..c912b81 100644
--- a/chrome/browser/find_bar.h
+++ b/chrome/browser/find_bar.h
@@ -60,6 +60,10 @@ 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;
+
// Returns the rectangle representing where to position the find bar. It uses
// GetDialogBounds and positions itself within that, either to the left (if an
// InfoBar is present) or to the right (no InfoBar). If
diff --git a/chrome/browser/find_bar_controller.cc b/chrome/browser/find_bar_controller.cc
index 07cd5e6..2d273f1 100644
--- a/chrome/browser/find_bar_controller.cc
+++ b/chrome/browser/find_bar_controller.cc
@@ -121,6 +121,7 @@ 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());
}
} 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 f3e0b05..8fd0dbe 100644
--- a/chrome/browser/gtk/find_bar_gtk.cc
+++ b/chrome/browser/gtk/find_bar_gtk.cc
@@ -210,6 +210,10 @@ void FindBarGtk::UpdateUIForFindResult(const FindNotificationDetails& result,
const string16& find_text) {
}
+void FindBarGtk::AudibleAlertIfNotFound(const FindNotificationDetails& result) {
+ // TODO(estade): Beep beep, beep beep, Yeah!
+}
+
gfx::Rect FindBarGtk::GetDialogPosition(gfx::Rect avoid_overlapping_rect) {
// TODO(estade): Logic for the positioning of the find bar should be factored
// out of here and browser/views/* and into FindBarController.
diff --git a/chrome/browser/gtk/find_bar_gtk.h b/chrome/browser/gtk/find_bar_gtk.h
index 721df0a..592b50c 100644
--- a/chrome/browser/gtk/find_bar_gtk.h
+++ b/chrome/browser/gtk/find_bar_gtk.h
@@ -45,6 +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 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_view.cc b/chrome/browser/views/find_bar_view.cc
index 4aaccee..2869cff1 100644
--- a/chrome/browser/views/find_bar_view.cc
+++ b/chrome/browser/views/find_bar_view.cc
@@ -231,7 +231,6 @@ void FindBarView::UpdateForResult(const FindNotificationDetails& result,
match_count_text_->set_background(
views::Background::CreateSolidBackground(kBackgroundColorNoMatch));
match_count_text_->SetColor(kTextColorNoMatch);
- MessageBeep(MB_OK);
}
// Make sure Find Next and Find Previous are enabled if we found any matches.
diff --git a/chrome/browser/views/find_bar_win.cc b/chrome/browser/views/find_bar_win.cc
index 5c4d7e75..a579130 100644
--- a/chrome/browser/views/find_bar_win.cc
+++ b/chrome/browser/views/find_bar_win.cc
@@ -549,3 +549,9 @@ void FindBarWin::UpdateUIForFindResult(const FindNotificationDetails& result,
if (result.number_of_matches() > 0)
focus_tracker_.reset(NULL);
}
+
+void FindBarWin::AudibleAlertIfNotFound(
+ const FindNotificationDetails& result) {
+ if (result.final_update() && result.number_of_matches() == 0)
+ MessageBeep(MB_OK);
+}
diff --git a/chrome/browser/views/find_bar_win.h b/chrome/browser/views/find_bar_win.h
index 81e9176..4f6cf31 100644
--- a/chrome/browser/views/find_bar_win.h
+++ b/chrome/browser/views/find_bar_win.h
@@ -82,6 +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 gfx::Rect GetDialogPosition(gfx::Rect avoid_overlapping_rect);
virtual void SetDialogPosition(const gfx::Rect& new_pos, bool no_redraw);
virtual bool IsFindBarVisible();