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

Side by Side Diff: chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc

Issue 7558024: Add UMA metrics for blocked plugins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix 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
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/browser/ui/blocked_content/blocked_content_tab_helper.h" 5 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "chrome/browser/content_settings/host_content_settings_map.h" 8 #include "chrome/browser/content_settings/host_content_settings_map.h"
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 initial_pos, 97 initial_pos,
98 true); // user_gesture 98 true); // user_gesture
99 } else { 99 } else {
100 // Call blocked_contents_->AddTabContents with user_gesture == true 100 // Call blocked_contents_->AddTabContents with user_gesture == true
101 // so that the contents will not get blocked again. 101 // so that the contents will not get blocked again.
102 blocked_contents_->AddTabContents(new_contents, 102 blocked_contents_->AddTabContents(new_contents,
103 NEW_POPUP, 103 NEW_POPUP,
104 initial_pos, 104 initial_pos,
105 true); // user_gesture 105 true); // user_gesture
106 tab_contents_wrapper_->content_settings()->OnContentBlocked( 106 tab_contents_wrapper_->content_settings()->OnContentBlocked(
107 CONTENT_SETTINGS_TYPE_POPUPS, std::string()); 107 CONTENT_SETTINGS_TYPE_POPUPS, std::string(), CONTENT_SETTING_BLOCK);
108 } 108 }
109 } 109 }
110 110
111 void BlockedContentTabHelper::LaunchForContents( 111 void BlockedContentTabHelper::LaunchForContents(
112 TabContentsWrapper* tab_contents) { 112 TabContentsWrapper* tab_contents) {
113 blocked_contents_->LaunchForContents(tab_contents); 113 blocked_contents_->LaunchForContents(tab_contents);
114 if (!blocked_contents_->GetBlockedContentsCount()) 114 if (!blocked_contents_->GetBlockedContentsCount())
115 PopupNotificationVisibilityChanged(false); 115 PopupNotificationVisibilityChanged(false);
116 } 116 }
117 117
118 size_t BlockedContentTabHelper::GetBlockedContentsCount() const { 118 size_t BlockedContentTabHelper::GetBlockedContentsCount() const {
119 return blocked_contents_->GetBlockedContentsCount(); 119 return blocked_contents_->GetBlockedContentsCount();
120 } 120 }
121 121
122 void BlockedContentTabHelper::GetBlockedContents( 122 void BlockedContentTabHelper::GetBlockedContents(
123 std::vector<TabContentsWrapper*>* blocked_contents) const { 123 std::vector<TabContentsWrapper*>* blocked_contents) const {
124 blocked_contents_->GetBlockedContents(blocked_contents); 124 blocked_contents_->GetBlockedContents(blocked_contents);
125 } 125 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698