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

Side by Side Diff: chrome/browser/extensions/external_provider_impl.h

Issue 1495403002: Observe adding external extensions via windows registry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: guard updater_->CheckNow() call, rework Provider->ExtensionService interaction Created 4 years, 11 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 (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
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_vector.h"
13 #include "chrome/browser/extensions/external_loader.h" 14 #include "chrome/browser/extensions/external_loader.h"
14 #include "extensions/browser/external_provider_interface.h" 15 #include "extensions/browser/external_provider_interface.h"
15 #include "extensions/common/manifest.h" 16 #include "extensions/common/manifest.h"
16 17
17 class Profile; 18 class Profile;
18 19
19 namespace base { 20 namespace base {
20 class DictionaryValue; 21 class DictionaryValue;
21 class Version; 22 class Version;
22 } 23 }
(...skipping 25 matching lines...) Expand all
48 // Populates a list with providers for all known sources. 49 // Populates a list with providers for all known sources.
49 static void CreateExternalProviders( 50 static void CreateExternalProviders(
50 VisitorInterface* service, 51 VisitorInterface* service,
51 Profile* profile, 52 Profile* profile,
52 ProviderCollection* provider_list); 53 ProviderCollection* provider_list);
53 54
54 // Sets underlying prefs and notifies provider. Only to be called by the 55 // Sets underlying prefs and notifies provider. Only to be called by the
55 // owned ExternalLoader instance. 56 // owned ExternalLoader instance.
56 virtual void SetPrefs(base::DictionaryValue* prefs); 57 virtual void SetPrefs(base::DictionaryValue* prefs);
57 58
59 // Updates the underlying prefs and notifies provider.
60 // Only to be called by the owned ExternalLoader instance.
61 void UpdatePrefs(base::DictionaryValue* prefs);
62
58 // ExternalProvider implementation: 63 // ExternalProvider implementation:
59 void ServiceShutdown() override; 64 void ServiceShutdown() override;
60 void VisitRegisteredExtension() override; 65 void VisitRegisteredExtension() override;
61 bool HasExtension(const std::string& id) const override; 66 bool HasExtension(const std::string& id) const override;
62 bool GetExtensionDetails(const std::string& id, 67 bool GetExtensionDetails(const std::string& id,
63 Manifest::Location* location, 68 Manifest::Location* location,
64 scoped_ptr<base::Version>* version) const override; 69 scoped_ptr<base::Version>* version) const override;
65 70
66 bool IsReady() const override; 71 bool IsReady() const override;
67 72
(...skipping 21 matching lines...) Expand all
89 private: 94 private:
90 bool HandleMinProfileVersion(const base::DictionaryValue* extension, 95 bool HandleMinProfileVersion(const base::DictionaryValue* extension,
91 const std::string& extension_id, 96 const std::string& extension_id,
92 std::set<std::string>* unsupported_extensions); 97 std::set<std::string>* unsupported_extensions);
93 98
94 bool HandleDoNotInstallForEnterprise( 99 bool HandleDoNotInstallForEnterprise(
95 const base::DictionaryValue* extension, 100 const base::DictionaryValue* extension,
96 const std::string& extension_id, 101 const std::string& extension_id,
97 std::set<std::string>* unsupported_extensions); 102 std::set<std::string>* unsupported_extensions);
98 103
104 // Retrieves the extensions that were found in this provider.
105 void RetrieveExtensionsFromPrefs(
106 ScopedVector<UpdateUrlExtensionInfo>* external_update_url_extensions,
107 ScopedVector<FileExtensionInfo>* external_file_extensions);
108
99 // Location for external extensions that are provided by this provider from 109 // Location for external extensions that are provided by this provider from
100 // local crx files. 110 // local crx files.
101 const Manifest::Location crx_location_; 111 const Manifest::Location crx_location_;
102 112
103 // Location for external extensions that are provided by this provider from 113 // Location for external extensions that are provided by this provider from
104 // update URLs. 114 // update URLs.
105 const Manifest::Location download_location_; 115 const Manifest::Location download_location_;
106 116
107 // Weak pointer to the object that consumes the external extensions. 117 // Weak pointer to the object that consumes the external extensions.
108 // This is zeroed out by: ServiceShutdown() 118 // This is zeroed out by: ServiceShutdown()
(...skipping 23 matching lines...) Expand all
132 142
133 // Whether the extensions from this provider should be installed immediately. 143 // Whether the extensions from this provider should be installed immediately.
134 bool install_immediately_; 144 bool install_immediately_;
135 145
136 DISALLOW_COPY_AND_ASSIGN(ExternalProviderImpl); 146 DISALLOW_COPY_AND_ASSIGN(ExternalProviderImpl);
137 }; 147 };
138 148
139 } // namespace extensions 149 } // namespace extensions
140 150
141 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ 151 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698