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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 7558024: Add UMA metrics for blocked plugins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/blocked_plugin.cc ('k') | chrome/tools/chromeactions.txt » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 } 454 }
455 return NULL; 455 return NULL;
456 } 456 }
457 457
458 return render_view->CreateNPAPIPlugin( 458 return render_view->CreateNPAPIPlugin(
459 frame, params, info.path, actual_mime_type); 459 frame, params, info.path, actual_mime_type);
460 } 460 }
461 461
462 observer->DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, resource); 462 observer->DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, resource);
463 if (plugin_setting == CONTENT_SETTING_ASK) { 463 if (plugin_setting == CONTENT_SETTING_ASK) {
464 render_view->Send(
465 new ViewHostMsg_UserMetricsRecordAction("Plugin_ClickToPlay"));
464 return CreatePluginPlaceholder( 466 return CreatePluginPlaceholder(
465 render_view, frame, params, *group, IDR_CLICK_TO_PLAY_PLUGIN_HTML, 467 render_view, frame, params, *group, IDR_CLICK_TO_PLAY_PLUGIN_HTML,
466 IDS_PLUGIN_LOAD, false, true); 468 IDS_PLUGIN_LOAD, false, true);
467 } else { 469 } else {
470 render_view->Send(
471 new ViewHostMsg_UserMetricsRecordAction("Plugin_Blocked"));
468 return CreatePluginPlaceholder( 472 return CreatePluginPlaceholder(
469 render_view, frame, params, *group, IDR_BLOCKED_PLUGIN_HTML, 473 render_view, frame, params, *group, IDR_BLOCKED_PLUGIN_HTML,
470 IDS_PLUGIN_BLOCKED, false, true); 474 IDS_PLUGIN_BLOCKED, false, true);
471 } 475 }
472 } 476 }
473 477
474 WebPlugin* ChromeContentRendererClient::CreatePluginPlaceholder( 478 WebPlugin* ChromeContentRendererClient::CreatePluginPlaceholder(
475 RenderView* render_view, 479 RenderView* render_view,
476 WebFrame* frame, 480 WebFrame* frame,
477 const WebPluginParams& params, 481 const WebPluginParams& params,
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 if (spellcheck_.get()) 702 if (spellcheck_.get())
699 thread->RemoveObserver(spellcheck_.get()); 703 thread->RemoveObserver(spellcheck_.get());
700 SpellCheck* new_spellcheck = new SpellCheck(); 704 SpellCheck* new_spellcheck = new SpellCheck();
701 if (spellcheck_provider_) 705 if (spellcheck_provider_)
702 spellcheck_provider_->SetSpellCheck(new_spellcheck); 706 spellcheck_provider_->SetSpellCheck(new_spellcheck);
703 spellcheck_.reset(new_spellcheck); 707 spellcheck_.reset(new_spellcheck);
704 thread->AddObserver(new_spellcheck); 708 thread->AddObserver(new_spellcheck);
705 } 709 }
706 710
707 } // namespace chrome 711 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/renderer/blocked_plugin.cc ('k') | chrome/tools/chromeactions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698