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

Side by Side Diff: chrome/renderer/plugins/chrome_plugin_placeholder.cc

Issue 863813002: Plugin Power Saver: Make Unthrottle metric collection more consistent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | components/plugins/renderer/loadable_plugin_placeholder.h » ('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 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } 296 }
297 297
298 void ChromePluginPlaceholder::OnMenuAction(int request_id, unsigned action) { 298 void ChromePluginPlaceholder::OnMenuAction(int request_id, unsigned action) {
299 DCHECK_EQ(context_menu_request_id_, request_id); 299 DCHECK_EQ(context_menu_request_id_, request_id);
300 if (g_last_active_menu != this) 300 if (g_last_active_menu != this)
301 return; 301 return;
302 switch (action) { 302 switch (action) {
303 case chrome::MENU_COMMAND_PLUGIN_RUN: { 303 case chrome::MENU_COMMAND_PLUGIN_RUN: {
304 RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Load_Menu")); 304 RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Load_Menu"));
305 #if defined(ENABLE_PLUGINS) 305 #if defined(ENABLE_PLUGINS)
306 DisablePowerSaverForInstance(); 306 DisablePowerSaverForInstance(
307 content::PluginInstanceThrottler::UNTHROTTLE_METHOD_BY_CLICK);
307 #endif 308 #endif
308 LoadPlugin(); 309 LoadPlugin();
309 break; 310 break;
310 } 311 }
311 case chrome::MENU_COMMAND_PLUGIN_HIDE: { 312 case chrome::MENU_COMMAND_PLUGIN_HIDE: {
312 RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Hide_Menu")); 313 RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Hide_Menu"));
313 HidePlugin(); 314 HidePlugin();
314 break; 315 break;
315 } 316 }
316 default: 317 default:
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 v8::Handle<v8::Object> global = context->Global(); 372 v8::Handle<v8::Object> global = context->Global();
372 global->Set(gin::StringToV8(isolate, "plugin"), 373 global->Set(gin::StringToV8(isolate, "plugin"),
373 gin::CreateHandle(isolate, this).ToV8()); 374 gin::CreateHandle(isolate, this).ToV8());
374 } 375 }
375 376
376 gin::ObjectTemplateBuilder ChromePluginPlaceholder::GetObjectTemplateBuilder( 377 gin::ObjectTemplateBuilder ChromePluginPlaceholder::GetObjectTemplateBuilder(
377 v8::Isolate* isolate) { 378 v8::Isolate* isolate) {
378 return LoadablePluginPlaceholder::GetObjectTemplateBuilder(isolate).SetMethod( 379 return LoadablePluginPlaceholder::GetObjectTemplateBuilder(isolate).SetMethod(
379 "openAboutPlugins", &ChromePluginPlaceholder::OpenAboutPluginsCallback); 380 "openAboutPlugins", &ChromePluginPlaceholder::OpenAboutPluginsCallback);
380 } 381 }
OLDNEW
« no previous file with comments | « no previous file | components/plugins/renderer/loadable_plugin_placeholder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698