summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-01 16:24:09 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-01 16:24:09 +0000
commitfdfb032b5ba7f106ee7e44580bbda1580af15dbb (patch)
tree835b3086386b5c5e0abde993e6f082496a105443 /chrome/test
parentc80580c78a15a2436cce54088921d88540a962e1 (diff)
downloadchromium_src-fdfb032b5ba7f106ee7e44580bbda1580af15dbb.zip
chromium_src-fdfb032b5ba7f106ee7e44580bbda1580af15dbb.tar.gz
chromium_src-fdfb032b5ba7f106ee7e44580bbda1580af15dbb.tar.bz2
Move find-in-page from TabContents to TabContentsWrapper.
BUG=71097 TEST=Hammer on find-in-page on all platforms. Nothing should crash, break, or have any user-visible change. Review URL: http://codereview.chromium.org/6378014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73294 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/ui_test_utils.cc17
-rw-r--r--chrome/test/ui_test_utils.h3
2 files changed, 13 insertions, 7 deletions
diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc
index 0dd2504..407458d 100644
--- a/chrome/test/ui_test_utils.cc
+++ b/chrome/test/ui_test_utils.cc
@@ -31,6 +31,9 @@
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/thumbnail_generator.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/find_bar/find_manager.h"
+#include "chrome/browser/ui/find_bar/find_notification_details.h"
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension_action.h"
#include "chrome/common/notification_type.h"
@@ -223,13 +226,14 @@ class DownloadsCompleteObserver : public DownloadManager::Observer,
class FindInPageNotificationObserver : public NotificationObserver {
public:
- explicit FindInPageNotificationObserver(TabContents* parent_tab)
+ explicit FindInPageNotificationObserver(TabContentsWrapper* parent_tab)
: parent_tab_(parent_tab),
active_match_ordinal_(-1),
number_of_matches_(0) {
- current_find_request_id_ = parent_tab->current_find_request_id();
+ current_find_request_id_ =
+ parent_tab->GetFindManager()->current_find_request_id();
registrar_.Add(this, NotificationType::FIND_RESULT_AVAILABLE,
- Source<TabContents>(parent_tab_));
+ Source<TabContents>(parent_tab_->tab_contents()));
ui_test_utils::RunMessageLoop();
}
@@ -260,7 +264,7 @@ class FindInPageNotificationObserver : public NotificationObserver {
private:
NotificationRegistrar registrar_;
- TabContents* parent_tab_;
+ TabContentsWrapper* parent_tab_;
// We will at some point (before final update) be notified of the ordinal and
// we need to preserve it so we can send it later.
int active_match_ordinal_;
@@ -624,9 +628,10 @@ void WaitForFocusInBrowser(Browser* browser) {
Source<Browser>(browser));
}
-int FindInPage(TabContents* tab_contents, const string16& search_string,
+int FindInPage(TabContentsWrapper* tab_contents, const string16& search_string,
bool forward, bool match_case, int* ordinal) {
- tab_contents->StartFinding(search_string, forward, match_case);
+ tab_contents->
+ GetFindManager()->StartFinding(search_string, forward, match_case);
FindInPageNotificationObserver observer(tab_contents);
if (ordinal)
*ordinal = observer.active_match_ordinal();
diff --git a/chrome/test/ui_test_utils.h b/chrome/test/ui_test_utils.h
index d6a7cd6..89dd676 100644
--- a/chrome/test/ui_test_utils.h
+++ b/chrome/test/ui_test_utils.h
@@ -44,6 +44,7 @@ class RenderWidgetHost;
class ScopedTempDir;
class SkBitmap;
class TabContents;
+class TabContentsWrapper;
class Value;
namespace gfx {
@@ -209,7 +210,7 @@ void WaitForFocusInBrowser(Browser* browser);
// Performs a find in the page of the specified tab. Returns the number of
// matches found. |ordinal| is an optional parameter which is set to the index
// of the current match.
-int FindInPage(TabContents* tab,
+int FindInPage(TabContentsWrapper* tab,
const string16& search_string,
bool forward,
bool case_sensitive,