OLD | NEW |
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_EXTERNAL_PROVIDER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 virtual void SetPrefs(base::DictionaryValue* prefs); | 57 virtual void SetPrefs(base::DictionaryValue* prefs); |
58 | 58 |
59 // Updates the underlying prefs and notifies provider. | 59 // Updates the underlying prefs and notifies provider. |
60 // Only to be called by the owned ExternalLoader instance. | 60 // Only to be called by the owned ExternalLoader instance. |
61 void UpdatePrefs(base::DictionaryValue* prefs); | 61 void UpdatePrefs(base::DictionaryValue* prefs); |
62 | 62 |
63 // ExternalProvider implementation: | 63 // ExternalProvider implementation: |
64 void ServiceShutdown() override; | 64 void ServiceShutdown() override; |
65 void VisitRegisteredExtension() override; | 65 void VisitRegisteredExtension() override; |
66 bool HasExtension(const std::string& id) const override; | 66 bool HasExtension(const std::string& id) const override; |
67 bool GetExtensionDetails(const std::string& id, | 67 bool GetExtensionDetails( |
68 Manifest::Location* location, | 68 const std::string& id, |
69 scoped_ptr<base::Version>* version) const override; | 69 Manifest::Location* location, |
| 70 std::unique_ptr<base::Version>* version) const override; |
70 | 71 |
71 bool IsReady() const override; | 72 bool IsReady() const override; |
72 | 73 |
73 static const char kExternalCrx[]; | 74 static const char kExternalCrx[]; |
74 static const char kExternalVersion[]; | 75 static const char kExternalVersion[]; |
75 static const char kExternalUpdateUrl[]; | 76 static const char kExternalUpdateUrl[]; |
76 static const char kInstallParam[]; | 77 static const char kInstallParam[]; |
77 static const char kIsBookmarkApp[]; | 78 static const char kIsBookmarkApp[]; |
78 static const char kIsFromWebstore[]; | 79 static const char kIsFromWebstore[]; |
79 static const char kKeepIfPresent[]; | 80 static const char kKeepIfPresent[]; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 114 |
114 // Location for external extensions that are provided by this provider from | 115 // Location for external extensions that are provided by this provider from |
115 // update URLs. | 116 // update URLs. |
116 const Manifest::Location download_location_; | 117 const Manifest::Location download_location_; |
117 | 118 |
118 // Weak pointer to the object that consumes the external extensions. | 119 // Weak pointer to the object that consumes the external extensions. |
119 // This is zeroed out by: ServiceShutdown() | 120 // This is zeroed out by: ServiceShutdown() |
120 VisitorInterface* service_; // weak | 121 VisitorInterface* service_; // weak |
121 | 122 |
122 // Dictionary of the external extensions that are provided by this provider. | 123 // Dictionary of the external extensions that are provided by this provider. |
123 scoped_ptr<base::DictionaryValue> prefs_; | 124 std::unique_ptr<base::DictionaryValue> prefs_; |
124 | 125 |
125 // Indicates that the extensions provided by this provider are loaded | 126 // Indicates that the extensions provided by this provider are loaded |
126 // entirely. | 127 // entirely. |
127 bool ready_; | 128 bool ready_; |
128 | 129 |
129 // The loader that loads the list of external extensions and reports them | 130 // The loader that loads the list of external extensions and reports them |
130 // via |SetPrefs|. | 131 // via |SetPrefs|. |
131 scoped_refptr<ExternalLoader> loader_; | 132 scoped_refptr<ExternalLoader> loader_; |
132 | 133 |
133 // The profile that will be used to install external extensions. | 134 // The profile that will be used to install external extensions. |
134 Profile* profile_; | 135 Profile* profile_; |
135 | 136 |
136 // Creation flags to use for the extension. These flags will be used | 137 // Creation flags to use for the extension. These flags will be used |
137 // when calling Extension::Create() by the crx installer. | 138 // when calling Extension::Create() by the crx installer. |
138 int creation_flags_; | 139 int creation_flags_; |
139 | 140 |
140 // Whether loaded extensions should be automatically acknowledged, so that | 141 // Whether loaded extensions should be automatically acknowledged, so that |
141 // the user doesn't see an alert about them. | 142 // the user doesn't see an alert about them. |
142 bool auto_acknowledge_; | 143 bool auto_acknowledge_; |
143 | 144 |
144 // Whether the extensions from this provider should be installed immediately. | 145 // Whether the extensions from this provider should be installed immediately. |
145 bool install_immediately_; | 146 bool install_immediately_; |
146 | 147 |
147 DISALLOW_COPY_AND_ASSIGN(ExternalProviderImpl); | 148 DISALLOW_COPY_AND_ASSIGN(ExternalProviderImpl); |
148 }; | 149 }; |
149 | 150 |
150 } // namespace extensions | 151 } // namespace extensions |
151 | 152 |
152 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ | 153 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ |
OLD | NEW |