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

Unified Diff: chrome/renderer/plugins/chrome_plugin_placeholder.cc

Issue 1412963003: Plugin Power Saver: Implement pixel tests for plugin placeholders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/plugins/chrome_plugin_placeholder.cc
diff --git a/chrome/renderer/plugins/chrome_plugin_placeholder.cc b/chrome/renderer/plugins/chrome_plugin_placeholder.cc
index c1fe2b4ef04a8fbdaceb151b947097bfab91283d..56565bdd1b56d261de0106968d5c143793c367c2 100644
--- a/chrome/renderer/plugins/chrome_plugin_placeholder.cc
+++ b/chrome/renderer/plugins/chrome_plugin_placeholder.cc
@@ -4,6 +4,7 @@
#include "chrome/renderer/plugins/chrome_plugin_placeholder.h"
+#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
@@ -16,6 +17,7 @@
#include "chrome/renderer/plugins/plugin_preroller.h"
#include "chrome/renderer/plugins/plugin_uma.h"
#include "components/content_settings/content/common/content_settings_messages.h"
+#include "content/public/common/content_switches.h"
#include "content/public/common/context_menu_params.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_thread.h"
@@ -358,15 +360,24 @@ blink::WebPlugin* ChromePluginPlaceholder::CreatePlugin() {
gin::ObjectTemplateBuilder ChromePluginPlaceholder::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
- return gin::Wrappable<ChromePluginPlaceholder>::GetObjectTemplateBuilder(
- isolate)
- .SetMethod<void (ChromePluginPlaceholder::*)()>(
- "hide", &ChromePluginPlaceholder::HideCallback)
- .SetMethod<void (ChromePluginPlaceholder::*)()>(
- "load", &ChromePluginPlaceholder::LoadCallback)
- .SetMethod<void (ChromePluginPlaceholder::*)()>(
- "didFinishLoading",
- &ChromePluginPlaceholder::DidFinishLoadingCallback)
- .SetMethod("openAboutPlugins",
- &ChromePluginPlaceholder::OpenAboutPluginsCallback);
+ gin::ObjectTemplateBuilder builder =
+ gin::Wrappable<ChromePluginPlaceholder>::GetObjectTemplateBuilder(isolate)
+ .SetMethod<void (ChromePluginPlaceholder::*)()>(
+ "hide", &ChromePluginPlaceholder::HideCallback)
+ .SetMethod<void (ChromePluginPlaceholder::*)()>(
+ "load", &ChromePluginPlaceholder::LoadCallback)
+ .SetMethod<void (ChromePluginPlaceholder::*)()>(
+ "didFinishLoading",
+ &ChromePluginPlaceholder::DidFinishLoadingCallback)
+ .SetMethod("openAboutPlugins",
+ &ChromePluginPlaceholder::OpenAboutPluginsCallback);
+
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnablePluginPlaceholderTesting)) {
+ builder.SetMethod<void (ChromePluginPlaceholder::*)()>(
+ "didFinishIconRepositionForTesting",
+ &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback);
+ }
+
+ return builder;
}
« no previous file with comments | « chrome/browser/plugins/plugin_power_saver_browsertest.cc ('k') | chrome/renderer/resources/plugins/plugin_poster.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698