diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-05 02:40:07 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-05 02:40:07 +0000 |
commit | 126f4120902008da93759d7256c87e1e6d3ae70b (patch) | |
tree | ba664f25a7d09be02fc6c05802b938fba53683be /chrome/browser/views | |
parent | 627f02642ffe7075b567ee85e77044d64d72e24d (diff) | |
download | chromium_src-126f4120902008da93759d7256c87e1e6d3ae70b.zip chromium_src-126f4120902008da93759d7256c87e1e6d3ae70b.tar.gz chromium_src-126f4120902008da93759d7256c87e1e6d3ae70b.tar.bz2 |
FindBarView::UpdateForResult is not a good place to
beep if nothing was found on the page. The reason is
that it is gets called when you switch from one tab
to the other. I've added a function to FindBar that
the controller can call and each platform can
implement whatever sound they want to use.
BUG=10823
TEST=Open google.com, search for z0, it should beep
(no matches). Open new tab, switch back to the old
tab and it should not beep.
Review URL: http://codereview.chromium.org/99372
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/find_bar_view.cc | 1 | ||||
-rw-r--r-- | chrome/browser/views/find_bar_win.cc | 6 | ||||
-rw-r--r-- | chrome/browser/views/find_bar_win.h | 1 |
3 files changed, 7 insertions, 1 deletions
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(); |