OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 5680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5691 const base::string16& search_text, | 5691 const base::string16& search_text, |
5692 const WebFindOptions& options) { | 5692 const WebFindOptions& options) { |
5693 DCHECK(!search_text.empty()); | 5693 DCHECK(!search_text.empty()); |
5694 | 5694 |
5695 blink::WebPlugin* plugin = GetWebPluginForFind(); | 5695 blink::WebPlugin* plugin = GetWebPluginForFind(); |
5696 // Check if the plugin still exists in the document. | 5696 // Check if the plugin still exists in the document. |
5697 if (plugin) { | 5697 if (plugin) { |
5698 if (options.findNext) { | 5698 if (options.findNext) { |
5699 // Just navigate back/forward. | 5699 // Just navigate back/forward. |
5700 plugin->selectFindResult(options.forward, request_id); | 5700 plugin->selectFindResult(options.forward, request_id); |
5701 } else { | 5701 render_view_->webview()->setFocusedFrame(frame_); |
5702 if (!plugin->startFind(WebString::fromUTF16(search_text), | 5702 } else if (!plugin->startFind(WebString::fromUTF16(search_text), |
5703 options.matchCase, request_id)) { | 5703 options.matchCase, request_id)) { |
5704 // Send "no results". | 5704 // Send "no results". |
5705 SendFindReply(request_id, 0 /* match_count */, 0 /* ordinal */, | 5705 SendFindReply(request_id, 0 /* match_count */, 0 /* ordinal */, |
5706 gfx::Rect(), true /* final_status_update */); | 5706 gfx::Rect(), true /* final_status_update */); |
5707 } | |
5708 } | 5707 } |
5709 return; | 5708 return; |
5710 } | 5709 } |
5711 | 5710 |
5712 frame_->requestFind(request_id, WebString::fromUTF16(search_text), options); | 5711 frame_->requestFind(request_id, WebString::fromUTF16(search_text), options); |
5713 } | 5712 } |
5714 | 5713 |
5715 void RenderFrameImpl::OnClearActiveFindMatch() { | 5714 void RenderFrameImpl::OnClearActiveFindMatch() { |
5716 frame_->executeCommand(WebString::fromUTF8("CollapseSelection")); | 5715 frame_->executeCommand(WebString::fromUTF8("CollapseSelection")); |
5717 frame_->clearActiveFindMatch(); | 5716 frame_->clearActiveFindMatch(); |
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6972 policy(info.defaultPolicy), | 6971 policy(info.defaultPolicy), |
6973 replaces_current_history_item(info.replacesCurrentHistoryItem), | 6972 replaces_current_history_item(info.replacesCurrentHistoryItem), |
6974 history_navigation_in_new_child_frame( | 6973 history_navigation_in_new_child_frame( |
6975 info.isHistoryNavigationInNewChildFrame), | 6974 info.isHistoryNavigationInNewChildFrame), |
6976 client_redirect(info.isClientRedirect), | 6975 client_redirect(info.isClientRedirect), |
6977 cache_disabled(info.isCacheDisabled), | 6976 cache_disabled(info.isCacheDisabled), |
6978 form(info.form), | 6977 form(info.form), |
6979 source_location(info.sourceLocation) {} | 6978 source_location(info.sourceLocation) {} |
6980 | 6979 |
6981 } // namespace content | 6980 } // namespace content |
OLD | NEW |