Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2785853002: Selection Action mode triggered like a context menu (Closed)
Patch Set: Fixing rebase bug Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 4247 matching lines...) Expand 10 before | Expand all | Expand 10 after
4258 params.src_url = GURL(); 4258 params.src_url = GURL();
4259 4259
4260 #if defined(OS_ANDROID) 4260 #if defined(OS_ANDROID)
4261 gfx::Rect start_rect; 4261 gfx::Rect start_rect;
4262 gfx::Rect end_rect; 4262 gfx::Rect end_rect;
4263 GetRenderWidget()->GetSelectionBounds(&start_rect, &end_rect); 4263 GetRenderWidget()->GetSelectionBounds(&start_rect, &end_rect);
4264 params.selection_start = gfx::Point(start_rect.x(), start_rect.bottom()); 4264 params.selection_start = gfx::Point(start_rect.x(), start_rect.bottom());
4265 params.selection_end = gfx::Point(end_rect.right(), end_rect.bottom()); 4265 params.selection_end = gfx::Point(end_rect.right(), end_rect.bottom());
4266 #endif 4266 #endif
4267 4267
4268 blink::WebRect selection_in_window(data.selection_rect);
4269 GetRenderWidget()->ConvertViewportToWindow(&selection_in_window);
4270 params.selection_rect = selection_in_window;
4271
4268 Send(new FrameHostMsg_ContextMenu(routing_id_, params)); 4272 Send(new FrameHostMsg_ContextMenu(routing_id_, params));
4269 } 4273 }
4270 4274
4271 void RenderFrameImpl::SaveImageFromDataURL(const blink::WebString& data_url) { 4275 void RenderFrameImpl::SaveImageFromDataURL(const blink::WebString& data_url) {
4272 // Note: We should basically send GURL but we use size-limited string instead 4276 // Note: We should basically send GURL but we use size-limited string instead
4273 // in order to send a larger data url to save a image for <canvas> or <img>. 4277 // in order to send a larger data url to save a image for <canvas> or <img>.
4274 if (data_url.length() < kMaxLengthOfDataURLString) { 4278 if (data_url.length() < kMaxLengthOfDataURLString) {
4275 Send(new FrameHostMsg_SaveImageFromDataURL(render_view_->GetRoutingID(), 4279 Send(new FrameHostMsg_SaveImageFromDataURL(render_view_->GetRoutingID(),
4276 routing_id_, data_url.Utf8())); 4280 routing_id_, data_url.Utf8()));
4277 } 4281 }
(...skipping 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after
6996 policy(info.default_policy), 7000 policy(info.default_policy),
6997 replaces_current_history_item(info.replaces_current_history_item), 7001 replaces_current_history_item(info.replaces_current_history_item),
6998 history_navigation_in_new_child_frame( 7002 history_navigation_in_new_child_frame(
6999 info.is_history_navigation_in_new_child_frame), 7003 info.is_history_navigation_in_new_child_frame),
7000 client_redirect(info.is_client_redirect), 7004 client_redirect(info.is_client_redirect),
7001 cache_disabled(info.is_cache_disabled), 7005 cache_disabled(info.is_cache_disabled),
7002 form(info.form), 7006 form(info.form),
7003 source_location(info.source_location) {} 7007 source_location(info.source_location) {}
7004 7008
7005 } // namespace content 7009 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698