| 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" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 ChromeViewHostMsg_GetPluginInfo_Output output; | 275 ChromeViewHostMsg_GetPluginInfo_Output output; |
| 276 std::string mime_type(GetPluginParams().mimeType.utf8()); | 276 std::string mime_type(GetPluginParams().mimeType.utf8()); |
| 277 render_view()->Send( | 277 render_view()->Send( |
| 278 new ChromeViewHostMsg_GetPluginInfo(routing_id(), | 278 new ChromeViewHostMsg_GetPluginInfo(routing_id(), |
| 279 GURL(GetPluginParams().url), | 279 GURL(GetPluginParams().url), |
| 280 document.url(), | 280 document.url(), |
| 281 mime_type, | 281 mime_type, |
| 282 &output)); | 282 &output)); |
| 283 if (output.status.value == status_->value) | 283 if (output.status.value == status_->value) |
| 284 return; | 284 return; |
| 285 WebPlugin* new_plugin = chrome::ChromeContentRendererClient::CreatePlugin( | 285 WebPlugin* new_plugin = ChromeContentRendererClient::CreatePlugin( |
| 286 render_view(), GetFrame(), GetPluginParams(), output); | 286 render_view(), GetFrame(), GetPluginParams(), output); |
| 287 ReplacePlugin(new_plugin); | 287 ReplacePlugin(new_plugin); |
| 288 if (!new_plugin) { | 288 if (!new_plugin) { |
| 289 PluginUMAReporter::GetInstance()->ReportPluginMissing( | 289 PluginUMAReporter::GetInstance()->ReportPluginMissing( |
| 290 GetPluginParams().mimeType.utf8(), GURL(GetPluginParams().url)); | 290 GetPluginParams().mimeType.utf8(), GURL(GetPluginParams().url)); |
| 291 } | 291 } |
| 292 } | 292 } |
| 293 | 293 |
| 294 void ChromePluginPlaceholder::OnMenuAction(int request_id, unsigned action) { | 294 void ChromePluginPlaceholder::OnMenuAction(int request_id, unsigned action) { |
| 295 DCHECK_EQ(context_menu_request_id_, request_id); | 295 DCHECK_EQ(context_menu_request_id_, request_id); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(WebKit::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 |