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

Side by Side Diff: chrome/browser/content_settings/content_settings_internal_extension_provider.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/browser/content_settings/content_settings_internal_extension_pr ovider.h" 5 #include "chrome/browser/content_settings/content_settings_internal_extension_pr ovider.h"
6 6
7 #include "chrome/browser/content_settings/content_settings_rule.h" 7 #include "chrome/browser/content_settings/content_settings_rule.h"
8 #include "chrome/browser/extensions/extension_host.h" 8 #include "chrome/browser/extensions/extension_host.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
(...skipping 11 matching lines...) Expand all
22 22
23 namespace content_settings { 23 namespace content_settings {
24 24
25 InternalExtensionProvider::InternalExtensionProvider( 25 InternalExtensionProvider::InternalExtensionProvider(
26 ExtensionService* extension_service) 26 ExtensionService* extension_service)
27 : registrar_(new content::NotificationRegistrar) { 27 : registrar_(new content::NotificationRegistrar) {
28 // Whitelist all extensions loaded so far. 28 // Whitelist all extensions loaded so far.
29 const ExtensionSet* extensions = extension_service->extensions(); 29 const ExtensionSet* extensions = extension_service->extensions();
30 for (ExtensionSet::const_iterator it = extensions->begin(); 30 for (ExtensionSet::const_iterator it = extensions->begin();
31 it != extensions->end(); ++it) { 31 it != extensions->end(); ++it) {
32 if (extensions::PluginInfo::HasPlugins(*it)) 32 if (extensions::PluginInfo::HasPlugins(it->get()))
33 SetContentSettingForExtension(*it, CONTENT_SETTING_ALLOW); 33 SetContentSettingForExtension(it->get(), CONTENT_SETTING_ALLOW);
34 } 34 }
35 Profile* profile = extension_service->profile(); 35 Profile* profile = extension_service->profile();
36 registrar_->Add(this, chrome::NOTIFICATION_EXTENSION_HOST_CREATED, 36 registrar_->Add(this, chrome::NOTIFICATION_EXTENSION_HOST_CREATED,
37 content::Source<Profile>(profile)); 37 content::Source<Profile>(profile));
38 registrar_->Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 38 registrar_->Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
39 content::Source<Profile>(profile)); 39 content::Source<Profile>(profile));
40 registrar_->Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 40 registrar_->Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
41 content::Source<Profile>(profile)); 41 content::Source<Profile>(profile));
42 } 42 }
43 43
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 Value::CreateIntegerValue(setting)); 126 Value::CreateIntegerValue(setting));
127 } 127 }
128 } 128 }
129 NotifyObservers(primary_pattern, 129 NotifyObservers(primary_pattern,
130 secondary_pattern, 130 secondary_pattern,
131 CONTENT_SETTINGS_TYPE_PLUGINS, 131 CONTENT_SETTINGS_TYPE_PLUGINS,
132 ResourceIdentifier()); 132 ResourceIdentifier());
133 } 133 }
134 134
135 } // namespace content_settings 135 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698