| 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 <string.h> | 7 #include <string.h> | 
| 8 #include <algorithm> | 8 #include <algorithm> | 
| 9 #include <map> | 9 #include <map> | 
| 10 #include <string> | 10 #include <string> | 
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 293 using blink::WebURLResponse; | 293 using blink::WebURLResponse; | 
| 294 using blink::WebUserGestureIndicator; | 294 using blink::WebUserGestureIndicator; | 
| 295 using blink::WebVector; | 295 using blink::WebVector; | 
| 296 using blink::WebView; | 296 using blink::WebView; | 
| 297 | 297 | 
| 298 #if defined(OS_ANDROID) | 298 #if defined(OS_ANDROID) | 
| 299 using blink::WebFloatPoint; | 299 using blink::WebFloatPoint; | 
| 300 using blink::WebFloatRect; | 300 using blink::WebFloatRect; | 
| 301 #endif | 301 #endif | 
| 302 | 302 | 
| 303 #define STATIC_ASSERT_ENUM(a, b)                            \ | 303 #define STATIC_ASSERT_RENDER_ENUM(a, b)                            \ | 
| 304   static_assert(static_cast<int>(a) == static_cast<int>(b), \ | 304   static_assert(static_cast<int>(a) == static_cast<int>(b), \ | 
| 305                 "mismatching enums: " #a) | 305                 "mismatching enums: " #a) | 
| 306 | 306 | 
| 307 namespace content { | 307 namespace content { | 
| 308 | 308 | 
| 309 namespace { | 309 namespace { | 
| 310 | 310 | 
| 311 const int kExtraCharsBeforeAndAfterSelection = 100; | 311 const int kExtraCharsBeforeAndAfterSelection = 100; | 
| 312 | 312 | 
| 313 typedef std::map<int, RenderFrameImpl*> RoutingIDFrameMap; | 313 typedef std::map<int, RenderFrameImpl*> RoutingIDFrameMap; | 
| (...skipping 5473 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5787   frame_->RequestFind(request_id, WebString::FromUTF16(search_text), options); | 5787   frame_->RequestFind(request_id, WebString::FromUTF16(search_text), options); | 
| 5788 } | 5788 } | 
| 5789 | 5789 | 
| 5790 void RenderFrameImpl::OnClearActiveFindMatch() { | 5790 void RenderFrameImpl::OnClearActiveFindMatch() { | 
| 5791   frame_->ExecuteCommand(WebString::FromUTF8("CollapseSelection")); | 5791   frame_->ExecuteCommand(WebString::FromUTF8("CollapseSelection")); | 
| 5792   frame_->ClearActiveFindMatch(); | 5792   frame_->ClearActiveFindMatch(); | 
| 5793 } | 5793 } | 
| 5794 | 5794 | 
| 5795 // Ensure that content::StopFindAction and blink::WebLocalFrame::StopFindAction | 5795 // Ensure that content::StopFindAction and blink::WebLocalFrame::StopFindAction | 
| 5796 // are kept in sync. | 5796 // are kept in sync. | 
| 5797 STATIC_ASSERT_ENUM(STOP_FIND_ACTION_CLEAR_SELECTION, | 5797 STATIC_ASSERT_RENDER_ENUM(STOP_FIND_ACTION_CLEAR_SELECTION, | 
| 5798                    WebLocalFrame::kStopFindActionClearSelection); | 5798                    WebLocalFrame::kStopFindActionClearSelection); | 
| 5799 STATIC_ASSERT_ENUM(STOP_FIND_ACTION_KEEP_SELECTION, | 5799 STATIC_ASSERT_RENDER_ENUM(STOP_FIND_ACTION_KEEP_SELECTION, | 
| 5800                    WebLocalFrame::kStopFindActionKeepSelection); | 5800                    WebLocalFrame::kStopFindActionKeepSelection); | 
| 5801 STATIC_ASSERT_ENUM(STOP_FIND_ACTION_ACTIVATE_SELECTION, | 5801 STATIC_ASSERT_RENDER_ENUM(STOP_FIND_ACTION_ACTIVATE_SELECTION, | 
| 5802                    WebLocalFrame::kStopFindActionActivateSelection); | 5802                    WebLocalFrame::kStopFindActionActivateSelection); | 
| 5803 | 5803 | 
| 5804 void RenderFrameImpl::OnStopFinding(StopFindAction action) { | 5804 void RenderFrameImpl::OnStopFinding(StopFindAction action) { | 
| 5805   blink::WebPlugin* plugin = GetWebPluginForFind(); | 5805   blink::WebPlugin* plugin = GetWebPluginForFind(); | 
| 5806   if (plugin) { | 5806   if (plugin) { | 
| 5807     plugin->StopFind(); | 5807     plugin->StopFind(); | 
| 5808     return; | 5808     return; | 
| 5809   } | 5809   } | 
| 5810 | 5810 | 
| 5811   frame_->StopFinding(static_cast<WebLocalFrame::StopFindAction>(action)); | 5811   frame_->StopFinding(static_cast<WebLocalFrame::StopFindAction>(action)); | 
| (...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 7162       triggering_event_info(info.triggering_event_info), | 7162       triggering_event_info(info.triggering_event_info), | 
| 7163       cache_disabled(info.is_cache_disabled), | 7163       cache_disabled(info.is_cache_disabled), | 
| 7164       form(info.form), | 7164       form(info.form), | 
| 7165       source_location(info.source_location) {} | 7165       source_location(info.source_location) {} | 
| 7166 | 7166 | 
| 7167 void RenderFrameImpl::BindWidget(mojom::WidgetRequest request) { | 7167 void RenderFrameImpl::BindWidget(mojom::WidgetRequest request) { | 
| 7168   GetRenderWidget()->SetWidgetBinding(std::move(request)); | 7168   GetRenderWidget()->SetWidgetBinding(std::move(request)); | 
| 7169 } | 7169 } | 
| 7170 | 7170 | 
| 7171 }  // namespace content | 7171 }  // namespace content | 
| OLD | NEW | 
|---|