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

Side by Side Diff: chrome/browser/extensions/api/content_settings/content_settings_service.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/api/content_settings/content_settings_servic e.h" 5 #include "chrome/browser/extensions/api/content_settings/content_settings_servic e.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "chrome/browser/extensions/api/content_settings/content_settings_store. h" 8 #include "chrome/browser/extensions/api/content_settings/content_settings_store. h"
9 #include "extensions/browser/extension_prefs.h" 9 #include "extensions/browser/extension_prefs.h"
10 #include "extensions/browser/extension_prefs_scope.h" 10 #include "extensions/browser/extension_prefs_scope.h"
11 #include "extensions/browser/pref_names.h" 11 #include "extensions/browser/pref_names.h"
12 12
13 namespace extensions { 13 namespace extensions {
14 14
15 ContentSettingsService::ContentSettingsService(content::BrowserContext* context) 15 ContentSettingsService::ContentSettingsService(content::BrowserContext* context)
16 : content_settings_store_(new ContentSettingsStore()) {} 16 : content_settings_store_(new ContentSettingsStore()) {}
17 17
18 ContentSettingsService::~ContentSettingsService() {} 18 ContentSettingsService::~ContentSettingsService() {}
19 19
20 // static 20 // static
21 ContentSettingsService* ContentSettingsService::Get( 21 ContentSettingsService* ContentSettingsService::Get(
22 content::BrowserContext* context) { 22 content::BrowserContext* context) {
23 return BrowserContextKeyedAPIFactory<ContentSettingsService>::Get(context); 23 return BrowserContextKeyedAPIFactory<ContentSettingsService>::Get(context);
24 } 24 }
25 25
26 // BrowserContextKeyedAPI implementation. 26 // BrowserContextKeyedAPI implementation.
27 BrowserContextKeyedAPIFactory<ContentSettingsService>* 27 BrowserContextKeyedAPIFactory<ContentSettingsService>*
28 ContentSettingsService::GetFactoryInstance() { 28 ContentSettingsService::GetFactoryInstance() {
29 static base::LazyInstance< 29 static base::LazyInstance<
30 BrowserContextKeyedAPIFactory<ContentSettingsService> > factory = 30 BrowserContextKeyedAPIFactory<ContentSettingsService>>::DestructorAtExit
31 LAZY_INSTANCE_INITIALIZER; 31 factory = LAZY_INSTANCE_INITIALIZER;
32 return factory.Pointer(); 32 return factory.Pointer();
33 } 33 }
34 34
35 void ContentSettingsService::OnExtensionRegistered( 35 void ContentSettingsService::OnExtensionRegistered(
36 const std::string& extension_id, 36 const std::string& extension_id,
37 const base::Time& install_time, 37 const base::Time& install_time,
38 bool is_enabled) { 38 bool is_enabled) {
39 content_settings_store_->RegisterExtension( 39 content_settings_store_->RegisterExtension(
40 extension_id, install_time, is_enabled); 40 extension_id, install_time, is_enabled);
41 } 41 }
(...skipping 22 matching lines...) Expand all
64 content_settings_store_->UnregisterExtension(extension_id); 64 content_settings_store_->UnregisterExtension(extension_id);
65 } 65 }
66 66
67 void ContentSettingsService::OnExtensionStateChanged( 67 void ContentSettingsService::OnExtensionStateChanged(
68 const std::string& extension_id, 68 const std::string& extension_id,
69 bool state) { 69 bool state) {
70 content_settings_store_->SetExtensionState(extension_id, state); 70 content_settings_store_->SetExtensionState(extension_id, state);
71 } 71 }
72 72
73 } // namespace extensions 73 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/commands/command_service.cc ('k') | chrome/browser/extensions/api/cookies/cookies_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698