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" | 7 #include "android_webview/browser/scoped_allow_wait_for_legacy_web_view_api.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
11 #include "content/public/common/stop_find_action.h" | 11 #include "content/public/common/stop_find_action.h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" | 12 #include "third_party/WebKit/public/web/WebFindOptions.h" |
13 | 13 |
14 using content::WebContents; | 14 using content::WebContents; |
15 using WebKit::WebFindOptions; | 15 using WebKit::WebFindOptions; |
16 | 16 |
17 namespace android_webview { | 17 namespace android_webview { |
18 | 18 |
19 FindHelper::FindHelper(WebContents* web_contents) | 19 FindHelper::FindHelper(WebContents* web_contents) |
20 : WebContentsObserver(web_contents), | 20 : WebContentsObserver(web_contents), |
21 listener_(NULL), | 21 listener_(NULL), |
22 async_find_started_(false), | 22 async_find_started_(false), |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
130 // WebView.FindListener active match ordinals are 0-based while WebKit sends | 130 // WebView.FindListener active match ordinals are 0-based while WebKit sends |
131 // 1-based ordinals. Still we can receive 0 ordinal in case of no results. | 131 // 1-based ordinals. Still we can receive 0 ordinal in case of no results. |
132 active_ordinal = std::max(active_ordinal - 1, 0); | 132 active_ordinal = std::max(active_ordinal - 1, 0); |
133 | 133 |
134 if (listener_) | 134 if (listener_) |
135 listener_->OnFindResultReceived(active_ordinal, match_count, finished); | 135 listener_->OnFindResultReceived(active_ordinal, match_count, finished); |
136 } | 136 } |
137 | 137 |
138 } // namespace android_webview | 138 } // namespace android_webview |
OLD | NEW |