| 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 "android_webview/browser/find_helper.h" | 5 #include "android_webview/browser/find_helper.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" | |
| 8 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 9 #include "content/public/browser/render_view_host.h" | 8 #include "content/public/browser/render_view_host.h" |
| 10 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 11 #include "content/public/common/stop_find_action.h" | 10 #include "content/public/common/stop_find_action.h" |
| 12 #include "third_party/WebKit/public/web/WebFindOptions.h" | 11 #include "third_party/WebKit/public/web/WebFindOptions.h" |
| 13 | 12 |
| 14 using content::WebContents; | 13 using content::WebContents; |
| 15 using blink::WebFindOptions; | 14 using blink::WebFindOptions; |
| 16 | 15 |
| 17 namespace android_webview { | 16 namespace android_webview { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 137 |
| 139 // WebView.FindListener active match ordinals are 0-based while WebKit sends | 138 // WebView.FindListener active match ordinals are 0-based while WebKit sends |
| 140 // 1-based ordinals. Still we can receive 0 ordinal in case of no results. | 139 // 1-based ordinals. Still we can receive 0 ordinal in case of no results. |
| 141 active_ordinal = std::max(active_ordinal - 1, 0); | 140 active_ordinal = std::max(active_ordinal - 1, 0); |
| 142 | 141 |
| 143 if (listener_) | 142 if (listener_) |
| 144 listener_->OnFindResultReceived(active_ordinal, match_count, finished); | 143 listener_->OnFindResultReceived(active_ordinal, match_count, finished); |
| 145 } | 144 } |
| 146 | 145 |
| 147 } // namespace android_webview | 146 } // namespace android_webview |
| OLD | NEW |