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

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

Issue 904913003: Plugin Power Saver: Fix implicitly sized and below the fold plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 MarkPluginEssential(
307 content::PluginInstanceThrottler::UNTHROTTLE_METHOD_BY_CLICK); 307 content::PluginInstanceThrottler::UNTHROTTLE_METHOD_BY_CLICK);
308 #endif 308 #endif
309 LoadPlugin(); 309 LoadPlugin();
310 break; 310 break;
311 } 311 }
312 case chrome::MENU_COMMAND_PLUGIN_HIDE: { 312 case chrome::MENU_COMMAND_PLUGIN_HIDE: {
313 RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Hide_Menu")); 313 RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Hide_Menu"));
314 HidePlugin(); 314 HidePlugin();
315 break; 315 break;
316 } 316 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 v8::Handle<v8::Object> global = context->Global(); 372 v8::Handle<v8::Object> global = context->Global();
373 global->Set(gin::StringToV8(isolate, "plugin"), 373 global->Set(gin::StringToV8(isolate, "plugin"),
374 gin::CreateHandle(isolate, this).ToV8()); 374 gin::CreateHandle(isolate, this).ToV8());
375 } 375 }
376 376
377 gin::ObjectTemplateBuilder ChromePluginPlaceholder::GetObjectTemplateBuilder( 377 gin::ObjectTemplateBuilder ChromePluginPlaceholder::GetObjectTemplateBuilder(
378 v8::Isolate* isolate) { 378 v8::Isolate* isolate) {
379 return LoadablePluginPlaceholder::GetObjectTemplateBuilder(isolate).SetMethod( 379 return LoadablePluginPlaceholder::GetObjectTemplateBuilder(isolate).SetMethod(
380 "openAboutPlugins", &ChromePluginPlaceholder::OpenAboutPluginsCallback); 380 "openAboutPlugins", &ChromePluginPlaceholder::OpenAboutPluginsCallback);
381 } 381 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/plugins/plugin_preroller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698