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 "chrome/renderer/plugins/chrome_plugin_placeholder.h" | 5 #include "chrome/renderer/plugins/chrome_plugin_placeholder.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 323 |
324 content::MenuItem hide_item; | 324 content::MenuItem hide_item; |
325 hide_item.action = chrome::MENU_COMMAND_PLUGIN_HIDE; | 325 hide_item.action = chrome::MENU_COMMAND_PLUGIN_HIDE; |
326 bool is_main_frame_plugin_document = | 326 bool is_main_frame_plugin_document = |
327 GetFrame()->view()->mainFrame()->isWebLocalFrame() && | 327 GetFrame()->view()->mainFrame()->isWebLocalFrame() && |
328 GetFrame()->view()->mainFrame()->document().isPluginDocument(); | 328 GetFrame()->view()->mainFrame()->document().isPluginDocument(); |
329 hide_item.enabled = !is_main_frame_plugin_document; | 329 hide_item.enabled = !is_main_frame_plugin_document; |
330 hide_item.label = l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLUGIN_HIDE); | 330 hide_item.label = l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLUGIN_HIDE); |
331 params.custom_items.push_back(hide_item); | 331 params.custom_items.push_back(hide_item); |
332 | 332 |
333 blink::WebPoint point(event.x, event.y); | 333 blink::WebPoint point(event.positionInWidget().x, event.positionInWidget().y); |
334 if (plugin() && plugin()->container()) | 334 if (plugin() && plugin()->container()) |
335 point = plugin()->container()->localToRootFramePoint(point); | 335 point = plugin()->container()->localToRootFramePoint(point); |
336 | 336 |
337 params.x = point.x; | 337 params.x = point.x; |
338 params.y = point.y; | 338 params.y = point.y; |
339 | 339 |
340 context_menu_request_id_ = render_frame()->ShowContextMenu(this, params); | 340 context_menu_request_id_ = render_frame()->ShowContextMenu(this, params); |
341 g_last_active_menu = this; | 341 g_last_active_menu = this; |
342 } | 342 } |
343 | 343 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 384 |
385 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 385 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
386 switches::kEnablePluginPlaceholderTesting)) { | 386 switches::kEnablePluginPlaceholderTesting)) { |
387 builder.SetMethod<void (ChromePluginPlaceholder::*)()>( | 387 builder.SetMethod<void (ChromePluginPlaceholder::*)()>( |
388 "didFinishIconRepositionForTesting", | 388 "didFinishIconRepositionForTesting", |
389 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback); | 389 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback); |
390 } | 390 } |
391 | 391 |
392 return builder; | 392 return builder; |
393 } | 393 } |
OLD | NEW |