| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 #include "third_party/WebKit/public/web/WebRange.h" | 172 #include "third_party/WebKit/public/web/WebRange.h" |
| 173 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" | 173 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" |
| 174 #include "third_party/WebKit/public/web/WebScriptSource.h" | 174 #include "third_party/WebKit/public/web/WebScriptSource.h" |
| 175 #include "third_party/WebKit/public/web/WebSearchableFormData.h" | 175 #include "third_party/WebKit/public/web/WebSearchableFormData.h" |
| 176 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 176 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
| 177 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" | 177 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" |
| 178 #include "third_party/WebKit/public/web/WebSettings.h" | 178 #include "third_party/WebKit/public/web/WebSettings.h" |
| 179 #include "third_party/WebKit/public/web/WebSurroundingText.h" | 179 #include "third_party/WebKit/public/web/WebSurroundingText.h" |
| 180 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 180 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
| 181 #include "third_party/WebKit/public/web/WebView.h" | 181 #include "third_party/WebKit/public/web/WebView.h" |
| 182 #include "url/url_constants.h" |
| 182 #include "url/url_util.h" | 183 #include "url/url_util.h" |
| 183 | 184 |
| 184 #if defined(ENABLE_PLUGINS) | 185 #if defined(ENABLE_PLUGINS) |
| 185 #include "content/renderer/npapi/webplugin_impl.h" | 186 #include "content/renderer/npapi/webplugin_impl.h" |
| 186 #include "content/renderer/pepper/pepper_browser_connection.h" | 187 #include "content/renderer/pepper/pepper_browser_connection.h" |
| 187 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 188 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 188 #include "content/renderer/pepper/pepper_webplugin_impl.h" | 189 #include "content/renderer/pepper/pepper_webplugin_impl.h" |
| 189 #include "content/renderer/pepper/plugin_module.h" | 190 #include "content/renderer/pepper/plugin_module.h" |
| 190 #endif | 191 #endif |
| 191 | 192 |
| (...skipping 3445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3637 if (GetRenderWidget()->has_host_context_menu_location()) { | 3638 if (GetRenderWidget()->has_host_context_menu_location()) { |
| 3638 params.x = GetRenderWidget()->host_context_menu_location().x(); | 3639 params.x = GetRenderWidget()->host_context_menu_location().x(); |
| 3639 params.y = GetRenderWidget()->host_context_menu_location().y(); | 3640 params.y = GetRenderWidget()->host_context_menu_location().y(); |
| 3640 } | 3641 } |
| 3641 | 3642 |
| 3642 // Serializing a GURL longer than kMaxURLChars will fail, so don't do | 3643 // Serializing a GURL longer than kMaxURLChars will fail, so don't do |
| 3643 // it. We replace it with an empty GURL so the appropriate items are disabled | 3644 // it. We replace it with an empty GURL so the appropriate items are disabled |
| 3644 // in the context menu. | 3645 // in the context menu. |
| 3645 // TODO(jcivelli): http://crbug.com/45160 This prevents us from saving large | 3646 // TODO(jcivelli): http://crbug.com/45160 This prevents us from saving large |
| 3646 // data encoded images. We should have a way to save them. | 3647 // data encoded images. We should have a way to save them. |
| 3647 if (params.src_url.spec().size() > kMaxURLChars) | 3648 if (params.src_url.spec().size() > url::kMaxURLChars) |
| 3648 params.src_url = GURL(); | 3649 params.src_url = GURL(); |
| 3649 context_menu_node_ = data.node; | 3650 context_menu_node_ = data.node; |
| 3650 | 3651 |
| 3651 #if defined(OS_ANDROID) | 3652 #if defined(OS_ANDROID) |
| 3652 gfx::Rect start_rect; | 3653 gfx::Rect start_rect; |
| 3653 gfx::Rect end_rect; | 3654 gfx::Rect end_rect; |
| 3654 GetRenderWidget()->GetSelectionBounds(&start_rect, &end_rect); | 3655 GetRenderWidget()->GetSelectionBounds(&start_rect, &end_rect); |
| 3655 params.selection_start = gfx::Point(start_rect.x(), start_rect.bottom()); | 3656 params.selection_start = gfx::Point(start_rect.x(), start_rect.bottom()); |
| 3656 params.selection_end = gfx::Point(end_rect.right(), end_rect.bottom()); | 3657 params.selection_end = gfx::Point(end_rect.right(), end_rect.bottom()); |
| 3657 #endif | 3658 #endif |
| (...skipping 2411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6069 int match_count, | 6070 int match_count, |
| 6070 int ordinal, | 6071 int ordinal, |
| 6071 const WebRect& selection_rect, | 6072 const WebRect& selection_rect, |
| 6072 bool final_status_update) { | 6073 bool final_status_update) { |
| 6073 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6074 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
| 6074 selection_rect, ordinal, | 6075 selection_rect, ordinal, |
| 6075 final_status_update)); | 6076 final_status_update)); |
| 6076 } | 6077 } |
| 6077 | 6078 |
| 6078 } // namespace content | 6079 } // namespace content |
| OLD | NEW |