| Index: chrome/test/base/ui_test_utils.cc
|
| ===================================================================
|
| --- chrome/test/base/ui_test_utils.cc (revision 152084)
|
| +++ chrome/test/base/ui_test_utils.cc (working copy)
|
| @@ -106,8 +106,8 @@
|
| }
|
|
|
| int active_match_ordinal() const { return active_match_ordinal_; }
|
| -
|
| int number_of_matches() const { return number_of_matches_; }
|
| + gfx::Rect selection_rect() const { return selection_rect_; }
|
|
|
| virtual void Observe(int type, const content::NotificationSource& source,
|
| const content::NotificationDetails& details) {
|
| @@ -116,8 +116,10 @@
|
| if (find_details->request_id() == current_find_request_id_) {
|
| // We get multiple responses and one of those will contain the ordinal.
|
| // This message comes to us before the final update is sent.
|
| - if (find_details->active_match_ordinal() > -1)
|
| + if (find_details->active_match_ordinal() > -1) {
|
| active_match_ordinal_ = find_details->active_match_ordinal();
|
| + selection_rect_ = find_details->selection_rect();
|
| + }
|
| if (find_details->final_update()) {
|
| number_of_matches_ = find_details->number_of_matches();
|
| message_loop_runner_->Quit();
|
| @@ -137,6 +139,7 @@
|
| // we need to preserve it so we can send it later.
|
| int active_match_ordinal_;
|
| int number_of_matches_;
|
| + gfx::Rect selection_rect_;
|
| // The id of the current find request, obtained from WebContents. Allows us
|
| // to monitor when the search completes.
|
| int current_find_request_id_;
|
| @@ -367,12 +370,15 @@
|
| }
|
|
|
| int FindInPage(TabContents* tab_contents, const string16& search_string,
|
| - bool forward, bool match_case, int* ordinal) {
|
| + bool forward, bool match_case, int* ordinal,
|
| + gfx::Rect* selection_rect) {
|
| tab_contents->
|
| find_tab_helper()->StartFinding(search_string, forward, match_case);
|
| FindInPageNotificationObserver observer(tab_contents);
|
| if (ordinal)
|
| *ordinal = observer.active_match_ordinal();
|
| + if (selection_rect)
|
| + *selection_rect = observer.selection_rect();
|
| return observer.number_of_matches();
|
| }
|
|
|
|
|