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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 #include "third_party/WebKit/public/web/WebRange.h" | 173 #include "third_party/WebKit/public/web/WebRange.h" |
174 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" | 174 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" |
175 #include "third_party/WebKit/public/web/WebScriptSource.h" | 175 #include "third_party/WebKit/public/web/WebScriptSource.h" |
176 #include "third_party/WebKit/public/web/WebSearchableFormData.h" | 176 #include "third_party/WebKit/public/web/WebSearchableFormData.h" |
177 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 177 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
178 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" | 178 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" |
179 #include "third_party/WebKit/public/web/WebSettings.h" | 179 #include "third_party/WebKit/public/web/WebSettings.h" |
180 #include "third_party/WebKit/public/web/WebSurroundingText.h" | 180 #include "third_party/WebKit/public/web/WebSurroundingText.h" |
181 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 181 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
182 #include "third_party/WebKit/public/web/WebView.h" | 182 #include "third_party/WebKit/public/web/WebView.h" |
183 #include "url/url_constants.h" | |
184 #include "url/url_util.h" | 183 #include "url/url_util.h" |
185 | 184 |
186 #if defined(ENABLE_PLUGINS) | 185 #if defined(ENABLE_PLUGINS) |
187 #include "content/renderer/npapi/webplugin_impl.h" | 186 #include "content/renderer/npapi/webplugin_impl.h" |
188 #include "content/renderer/pepper/pepper_browser_connection.h" | 187 #include "content/renderer/pepper/pepper_browser_connection.h" |
189 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 188 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
190 #include "content/renderer/pepper/pepper_webplugin_impl.h" | 189 #include "content/renderer/pepper/pepper_webplugin_impl.h" |
191 #include "content/renderer/pepper/plugin_module.h" | 190 #include "content/renderer/pepper/plugin_module.h" |
192 #endif | 191 #endif |
193 | 192 |
(...skipping 3460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3654 if (GetRenderWidget()->has_host_context_menu_location()) { | 3653 if (GetRenderWidget()->has_host_context_menu_location()) { |
3655 params.x = GetRenderWidget()->host_context_menu_location().x(); | 3654 params.x = GetRenderWidget()->host_context_menu_location().x(); |
3656 params.y = GetRenderWidget()->host_context_menu_location().y(); | 3655 params.y = GetRenderWidget()->host_context_menu_location().y(); |
3657 } | 3656 } |
3658 | 3657 |
3659 // Serializing a GURL longer than kMaxURLChars will fail, so don't do | 3658 // Serializing a GURL longer than kMaxURLChars will fail, so don't do |
3660 // it. We replace it with an empty GURL so the appropriate items are disabled | 3659 // it. We replace it with an empty GURL so the appropriate items are disabled |
3661 // in the context menu. | 3660 // in the context menu. |
3662 // TODO(jcivelli): http://crbug.com/45160 This prevents us from saving large | 3661 // TODO(jcivelli): http://crbug.com/45160 This prevents us from saving large |
3663 // data encoded images. We should have a way to save them. | 3662 // data encoded images. We should have a way to save them. |
3664 if (params.src_url.spec().size() > url::kMaxURLChars) | 3663 if (params.src_url.spec().size() > kMaxURLChars) |
3665 params.src_url = GURL(); | 3664 params.src_url = GURL(); |
3666 context_menu_node_ = data.node; | 3665 context_menu_node_ = data.node; |
3667 | 3666 |
3668 #if defined(OS_ANDROID) | 3667 #if defined(OS_ANDROID) |
3669 gfx::Rect start_rect; | 3668 gfx::Rect start_rect; |
3670 gfx::Rect end_rect; | 3669 gfx::Rect end_rect; |
3671 GetRenderWidget()->GetSelectionBounds(&start_rect, &end_rect); | 3670 GetRenderWidget()->GetSelectionBounds(&start_rect, &end_rect); |
3672 params.selection_start = gfx::Point(start_rect.x(), start_rect.bottom()); | 3671 params.selection_start = gfx::Point(start_rect.x(), start_rect.bottom()); |
3673 params.selection_end = gfx::Point(end_rect.right(), end_rect.bottom()); | 3672 params.selection_end = gfx::Point(end_rect.right(), end_rect.bottom()); |
3674 #endif | 3673 #endif |
(...skipping 2436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6111 int match_count, | 6110 int match_count, |
6112 int ordinal, | 6111 int ordinal, |
6113 const WebRect& selection_rect, | 6112 const WebRect& selection_rect, |
6114 bool final_status_update) { | 6113 bool final_status_update) { |
6115 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6114 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
6116 selection_rect, ordinal, | 6115 selection_rect, ordinal, |
6117 final_status_update)); | 6116 final_status_update)); |
6118 } | 6117 } |
6119 | 6118 |
6120 } // namespace content | 6119 } // namespace content |
OLD | NEW |