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

Side by Side Diff: chrome/browser/extensions/api/storage/managed_value_store_cache.h

Issue 2440473004: Add policy domain for signin screen apps (Closed)
Patch Set: More comments according to feedback Created 4 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/linked_ptr.h" 15 #include "base/memory/linked_ptr.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "components/policy/core/common/policy_namespace.h"
17 #include "components/policy/core/common/policy_service.h" 18 #include "components/policy/core/common/policy_service.h"
18 #include "extensions/browser/api/storage/settings_observer.h" 19 #include "extensions/browser/api/storage/settings_observer.h"
19 #include "extensions/browser/api/storage/value_store_cache.h" 20 #include "extensions/browser/api/storage/value_store_cache.h"
20 21
21 class Profile; 22 class Profile;
22 23
23 namespace content { 24 namespace content {
24 class BrowserContext; 25 class BrowserContext;
25 } 26 }
26 27
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // Returns an existing PolicyValueStore for |extension_id|, or NULL. 77 // Returns an existing PolicyValueStore for |extension_id|, or NULL.
77 PolicyValueStore* GetStoreFor(const std::string& extension_id); 78 PolicyValueStore* GetStoreFor(const std::string& extension_id);
78 79
79 // Returns true if a backing store has been created for |extension_id|. 80 // Returns true if a backing store has been created for |extension_id|.
80 bool HasStore(const std::string& extension_id) const; 81 bool HasStore(const std::string& extension_id) const;
81 82
82 // The profile that owns the extension system being used. This is used to 83 // The profile that owns the extension system being used. This is used to
83 // get the PolicyService, the EventRouter and the ExtensionService. 84 // get the PolicyService, the EventRouter and the ExtensionService.
84 Profile* profile_; 85 Profile* profile_;
85 86
87 // The policy domain. This is used for both updating the schema registry with
88 // the list of extensions and for observing the policy updates.
89 policy::PolicyDomain policy_domain_;
90
86 // The |profile_|'s PolicyService. 91 // The |profile_|'s PolicyService.
87 policy::PolicyService* policy_service_; 92 policy::PolicyService* policy_service_;
88 93
89 // Observes extension loading and unloading, and keeps the Profile's 94 // Observes extension loading and unloading, and keeps the Profile's
90 // PolicyService aware of the current list of extensions. 95 // PolicyService aware of the current list of extensions.
91 std::unique_ptr<ExtensionTracker> extension_tracker_; 96 std::unique_ptr<ExtensionTracker> extension_tracker_;
92 97
93 // These live on the FILE thread. 98 // These live on the FILE thread.
94 scoped_refptr<ValueStoreFactory> storage_factory_; 99 scoped_refptr<ValueStoreFactory> storage_factory_;
95 scoped_refptr<SettingsObserverList> observers_; 100 scoped_refptr<SettingsObserverList> observers_;
96 101
97 // All the PolicyValueStores live on the FILE thread, and |store_map_| can be 102 // All the PolicyValueStores live on the FILE thread, and |store_map_| can be
98 // accessed only on the FILE thread as well. 103 // accessed only on the FILE thread as well.
99 PolicyValueStoreMap store_map_; 104 PolicyValueStoreMap store_map_;
100 105
101 DISALLOW_COPY_AND_ASSIGN(ManagedValueStoreCache); 106 DISALLOW_COPY_AND_ASSIGN(ManagedValueStoreCache);
102 }; 107 };
103 108
104 } // namespace extensions 109 } // namespace extensions
105 110
106 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ 111 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698