| 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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/common/prerender_messages.h" | 9 #include "chrome/common/prerender_messages.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| 11 #include "chrome/renderer/chrome_content_renderer_client.h" | 11 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 12 #include "chrome/renderer/custom_menu_commands.h" | 12 #include "chrome/renderer/custom_menu_commands.h" |
| 13 #include "chrome/renderer/plugins/plugin_uma.h" | 13 #include "chrome/renderer/plugins/plugin_uma.h" |
| 14 #include "content/public/common/context_menu_params.h" | 14 #include "content/public/common/context_menu_params.h" |
| 15 #include "content/public/renderer/render_thread.h" | 15 #include "content/public/renderer/render_thread.h" |
| 16 #include "content/public/renderer/render_view.h" | 16 #include "content/public/renderer/render_view.h" |
| 17 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 18 #include "grit/renderer_resources.h" | 18 #include "grit/renderer_resources.h" |
| 19 #include "grit/webkit_strings.h" | 19 #include "grit/webkit_strings.h" |
| 20 #include "third_party/WebKit/public/web/WebDocument.h" | 20 #include "third_party/WebKit/public/web/WebDocument.h" |
| 21 #include "third_party/WebKit/public/web/WebFrame.h" | 21 #include "third_party/WebKit/public/web/WebFrame.h" |
| 22 #include "third_party/WebKit/public/web/WebInputEvent.h" | 22 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 23 #include "third_party/WebKit/public/web/WebScriptSource.h" | 23 #include "third_party/WebKit/public/web/WebScriptSource.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
| 25 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
| 26 #include "ui/base/webui/jstemplate_builder.h" | 26 #include "ui/base/webui/jstemplate_builder.h" |
| 27 | 27 |
| 28 using content::RenderThread; | 28 using content::RenderThread; |
| 29 using content::RenderView; | 29 using content::RenderView; |
| 30 using WebKit::WebDocument; | 30 using blink::WebDocument; |
| 31 using WebKit::WebElement; | 31 using blink::WebElement; |
| 32 using WebKit::WebFrame; | 32 using blink::WebFrame; |
| 33 using WebKit::WebMouseEvent; | 33 using blink::WebMouseEvent; |
| 34 using WebKit::WebNode; | 34 using blink::WebNode; |
| 35 using WebKit::WebPlugin; | 35 using blink::WebPlugin; |
| 36 using WebKit::WebPluginContainer; | 36 using blink::WebPluginContainer; |
| 37 using WebKit::WebPluginParams; | 37 using blink::WebPluginParams; |
| 38 using webkit_glue::CppArgumentList; | 38 using webkit_glue::CppArgumentList; |
| 39 using webkit_glue::CppVariant; | 39 using webkit_glue::CppVariant; |
| 40 | 40 |
| 41 namespace { | 41 namespace { |
| 42 const plugins::PluginPlaceholder* g_last_active_menu = NULL; | 42 const plugins::PluginPlaceholder* g_last_active_menu = NULL; |
| 43 } // namespace | 43 } // namespace |
| 44 | 44 |
| 45 const char ChromePluginPlaceholder::kPluginPlaceholderDataURL[] = | 45 const char ChromePluginPlaceholder::kPluginPlaceholderDataURL[] = |
| 46 "chrome://pluginplaceholderdata/"; | 46 "chrome://pluginplaceholderdata/"; |
| 47 | 47 |
| 48 ChromePluginPlaceholder::ChromePluginPlaceholder( | 48 ChromePluginPlaceholder::ChromePluginPlaceholder( |
| 49 content::RenderView* render_view, | 49 content::RenderView* render_view, |
| 50 WebKit::WebFrame* frame, | 50 blink::WebFrame* frame, |
| 51 const WebKit::WebPluginParams& params, | 51 const blink::WebPluginParams& params, |
| 52 const std::string& html_data, | 52 const std::string& html_data, |
| 53 const string16& title) | 53 const string16& title) |
| 54 : plugins::PluginPlaceholder(render_view, | 54 : plugins::PluginPlaceholder(render_view, |
| 55 frame, | 55 frame, |
| 56 params, | 56 params, |
| 57 html_data, | 57 html_data, |
| 58 GURL(kPluginPlaceholderDataURL)), | 58 GURL(kPluginPlaceholderDataURL)), |
| 59 status_(new ChromeViewHostMsg_GetPluginInfo_Status), | 59 status_(new ChromeViewHostMsg_GetPluginInfo_Status), |
| 60 title_(title), | 60 title_(title), |
| 61 #if defined(ENABLE_PLUGIN_INSTALLATION) | 61 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 hide_item.label = l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLUGIN_HIDE); | 345 hide_item.label = l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLUGIN_HIDE); |
| 346 params.custom_items.push_back(hide_item); | 346 params.custom_items.push_back(hide_item); |
| 347 | 347 |
| 348 params.x = event.windowX; | 348 params.x = event.windowX; |
| 349 params.y = event.windowY; | 349 params.y = event.windowY; |
| 350 | 350 |
| 351 context_menu_request_id_ = render_view()->ShowContextMenu(this, params); | 351 context_menu_request_id_ = render_view()->ShowContextMenu(this, params); |
| 352 g_last_active_menu = this; | 352 g_last_active_menu = this; |
| 353 } | 353 } |
| 354 | 354 |
| 355 void ChromePluginPlaceholder::BindWebFrame(WebKit::WebFrame* frame) { | 355 void ChromePluginPlaceholder::BindWebFrame(blink::WebFrame* frame) { |
| 356 plugins::PluginPlaceholder::BindWebFrame(frame); | 356 plugins::PluginPlaceholder::BindWebFrame(frame); |
| 357 BindCallback("openAboutPlugins", | 357 BindCallback("openAboutPlugins", |
| 358 base::Bind(&ChromePluginPlaceholder::OpenAboutPluginsCallback, | 358 base::Bind(&ChromePluginPlaceholder::OpenAboutPluginsCallback, |
| 359 base::Unretained(this))); | 359 base::Unretained(this))); |
| 360 } | 360 } |
| OLD | NEW |