| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 5 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 134 } |
| 135 | 135 |
| 136 void FindTabHelper::ActivateFindInPageResultForAccessibility() { | 136 void FindTabHelper::ActivateFindInPageResultForAccessibility() { |
| 137 web_contents()->GetMainFrame()->ActivateFindInPageResultForAccessibility( | 137 web_contents()->GetMainFrame()->ActivateFindInPageResultForAccessibility( |
| 138 current_find_request_id_); | 138 current_find_request_id_); |
| 139 } | 139 } |
| 140 | 140 |
| 141 #if defined(OS_ANDROID) | 141 #if defined(OS_ANDROID) |
| 142 void FindTabHelper::ActivateNearestFindResult(float x, float y) { | 142 void FindTabHelper::ActivateNearestFindResult(float x, float y) { |
| 143 if (!find_op_aborted_ && !find_text_.empty()) { | 143 if (!find_op_aborted_ && !find_text_.empty()) { |
| 144 web_contents()->GetRenderViewHost()->ActivateNearestFindResult( | 144 web_contents()->GetMainFrame()->ActivateNearestFindResult( |
| 145 current_find_request_id_, x, y); | 145 current_find_request_id_, x, y); |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 | 148 |
| 149 void FindTabHelper::RequestFindMatchRects(int current_version) { | 149 void FindTabHelper::RequestFindMatchRects(int current_version) { |
| 150 if (!find_op_aborted_ && !find_text_.empty()) | 150 if (!find_op_aborted_ && !find_text_.empty()) |
| 151 web_contents()->GetRenderViewHost()->RequestFindMatchRects(current_version); | 151 web_contents()->GetMainFrame()->RequestFindMatchRects(current_version); |
| 152 } | 152 } |
| 153 #endif | 153 #endif |
| 154 | 154 |
| 155 void FindTabHelper::HandleFindReply(int request_id, | 155 void FindTabHelper::HandleFindReply(int request_id, |
| 156 int number_of_matches, | 156 int number_of_matches, |
| 157 const gfx::Rect& selection_rect, | 157 const gfx::Rect& selection_rect, |
| 158 int active_match_ordinal, | 158 int active_match_ordinal, |
| 159 bool final_update) { | 159 bool final_update) { |
| 160 // Ignore responses for requests that have been aborted. | 160 // Ignore responses for requests that have been aborted. |
| 161 // Ignore responses for requests other than the one we have most recently | 161 // Ignore responses for requests other than the one we have most recently |
| (...skipping 15 matching lines...) Expand all Loading... |
| 177 // found. | 177 // found. |
| 178 last_search_result_ = FindNotificationDetails( | 178 last_search_result_ = FindNotificationDetails( |
| 179 request_id, number_of_matches, selection, active_match_ordinal, | 179 request_id, number_of_matches, selection, active_match_ordinal, |
| 180 final_update); | 180 final_update); |
| 181 content::NotificationService::current()->Notify( | 181 content::NotificationService::current()->Notify( |
| 182 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, | 182 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, |
| 183 content::Source<WebContents>(web_contents()), | 183 content::Source<WebContents>(web_contents()), |
| 184 content::Details<FindNotificationDetails>(&last_search_result_)); | 184 content::Details<FindNotificationDetails>(&last_search_result_)); |
| 185 } | 185 } |
| 186 } | 186 } |
| OLD | NEW |