summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/browser_commands.cc
diff options
context:
space:
mode:
authorvasilii@chromium.org <vasilii@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-26 12:42:09 +0000
committervasilii@chromium.org <vasilii@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-26 12:42:09 +0000
commitc08433271bb53515c7ebb4a83171eac63bef1283 (patch)
tree04ab51b51da080c302933cdaf34e164ee537d1b5 /chrome/browser/ui/browser_commands.cc
parentd692a7c804728a3b83bfe8c40d10d95a6e30cace (diff)
downloadchromium_src-c08433271bb53515c7ebb4a83171eac63bef1283.zip
chromium_src-c08433271bb53515c7ebb4a83171eac63bef1283.tar.gz
chromium_src-c08433271bb53515c7ebb4a83171eac63bef1283.tar.bz2
This is a follow-up to https://chromiumcodereview.appspot.com/16305010/. To eradicate the discrepancy between find bar text and actual search term we'll always search for current find bar text on Mac. This is correct because find bar updates itself whenever the find pboard changes.
The test strengthened to reproduce the bug. BUG=272291 TBR=estade@chromium.org Review URL: https://chromiumcodereview.appspot.com/22796022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219530 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser_commands.cc')
-rw-r--r--chrome/browser/ui/browser_commands.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index 46ce8f1..48c7076 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -41,6 +41,7 @@
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/find_bar/find_bar.h"
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/browser/ui/find_bar/find_tab_helper.h"
#include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
@@ -71,10 +72,6 @@
#include "net/base/escape.h"
#include "webkit/common/user_agent/user_agent_util.h"
-#if defined(OS_MACOSX)
-#include "ui/base/cocoa/find_pasteboard.h"
-#endif
-
#if defined(OS_WIN)
#include "chrome/browser/ui/metro_pin_tab_helper_win.h"
#include "win8/util/win8_util.h"
@@ -829,12 +826,12 @@ void FindInPage(Browser* browser, bool find_next, bool forward_direction) {
FindTabHelper* find_helper = FindTabHelper::FromWebContents(
browser->tab_strip_model()->GetActiveWebContents());
#if defined(OS_MACOSX)
- // We always want to search for the contents of the find pasteboard on OS X.
- // But Incognito window doesn't write to the find pboard. Therefore, its own
- // find text has higher priority.
- if (!browser->profile()->IsOffTheRecord() ||
- find_helper->find_text().empty())
- find_text = GetFindPboardText();
+ // We always want to search for the current contents of the find bar on
+ // OS X. For regular profile it's always the current find pboard. For
+ // Incognito window it's the newest value of the find pboard content and
+ // user-typed text.
+ FindBar* find_bar = browser->GetFindBarController()->find_bar();
+ find_text = find_bar->GetFindText();
#endif
find_helper->StartFinding(find_text, forward_direction, false);
}