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

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

Issue 1003113003: [DevTools] Handle emulation in embedder, call into web API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests and mac popups compilation Created 5 years, 9 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
« no previous file with comments | « content/renderer/external_popup_menu.h ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/external_popup_menu.h" 5 #include "content/renderer/external_popup_menu.h"
6 6
7 #include "content/common/frame_messages.h" 7 #include "content/common/frame_messages.h"
8 #include "content/renderer/menu_item_builder.h" 8 #include "content/renderer/menu_item_builder.h"
9 #include "content/renderer/render_frame_impl.h" 9 #include "content/renderer/render_frame_impl.h"
10 #include "third_party/WebKit/public/platform/WebRect.h" 10 #include "third_party/WebKit/public/platform/WebRect.h"
11 #include "third_party/WebKit/public/web/WebExternalPopupMenuClient.h" 11 #include "third_party/WebKit/public/web/WebExternalPopupMenuClient.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 ExternalPopupMenu::ExternalPopupMenu( 15 ExternalPopupMenu::ExternalPopupMenu(
16 RenderFrameImpl* render_frame, 16 RenderFrameImpl* render_frame,
17 const blink::WebPopupMenuInfo& popup_menu_info, 17 const blink::WebPopupMenuInfo& popup_menu_info,
18 blink::WebExternalPopupMenuClient* popup_menu_client) 18 blink::WebExternalPopupMenuClient* popup_menu_client)
19 : render_frame_(render_frame), 19 : render_frame_(render_frame),
20 popup_menu_info_(popup_menu_info), 20 popup_menu_info_(popup_menu_info),
21 popup_menu_client_(popup_menu_client), 21 popup_menu_client_(popup_menu_client),
22 origin_scale_for_emulation_(0) { 22 origin_scale_for_emulation_(0) {
23 } 23 }
24 24
25 void ExternalPopupMenu::SetOriginScaleAndOffsetForEmulation( 25 void ExternalPopupMenu::SetOriginScaleAndOffsetForEmulation(
26 float scale, const gfx::Point& offset) { 26 float scale, const gfx::PointF& offset) {
27 origin_scale_for_emulation_ = scale; 27 origin_scale_for_emulation_ = scale;
28 origin_offset_for_emulation_ = offset; 28 origin_offset_for_emulation_ = offset;
29 } 29 }
30 30
31 void ExternalPopupMenu::show(const blink::WebRect& bounds) { 31 void ExternalPopupMenu::show(const blink::WebRect& bounds) {
32 blink::WebRect rect = bounds; 32 blink::WebRect rect = bounds;
33 if (origin_scale_for_emulation_) { 33 if (origin_scale_for_emulation_) {
34 rect.x *= origin_scale_for_emulation_; 34 rect.x *= origin_scale_for_emulation_;
35 rect.y *= origin_scale_for_emulation_; 35 rect.y *= origin_scale_for_emulation_;
36 } 36 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 if (!popup_menu_client_) 77 if (!popup_menu_client_)
78 return; 78 return;
79 if (canceled) 79 if (canceled)
80 popup_menu_client_->didCancel(); 80 popup_menu_client_->didCancel();
81 else 81 else
82 popup_menu_client_->didAcceptIndices(indices); 82 popup_menu_client_->didAcceptIndices(indices);
83 } 83 }
84 #endif 84 #endif
85 85
86 } // namespace content 86 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/external_popup_menu.h ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698