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

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

Issue 164369: Merge 22244 - Try again to land: http://codereview.chromium.org/160483... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 4 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
Property Changes:
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/extensions/extensions_service.h:r22244
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_EXTENSIONS_SERVICE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 MessageLoop* frontend_loop, 82 MessageLoop* frontend_loop,
83 MessageLoop* backend_loop, 83 MessageLoop* backend_loop,
84 bool autoupdate_enabled); 84 bool autoupdate_enabled);
85 virtual ~ExtensionsService(); 85 virtual ~ExtensionsService();
86 86
87 // Gets the list of currently installed extensions. 87 // Gets the list of currently installed extensions.
88 virtual const ExtensionList* extensions() const { 88 virtual const ExtensionList* extensions() const {
89 return &extensions_; 89 return &extensions_;
90 } 90 }
91 91
92 const FilePath& install_directory() const { return install_directory_; }
93
92 // Initialize and start all installed extensions. 94 // Initialize and start all installed extensions.
93 void Init(); 95 void Init();
94 96
95 // Install the extension file at |extension_path|. Will install as an 97 // Install the extension file at |extension_path|. Will install as an
96 // update if an older version is already installed. 98 // update if an older version is already installed.
97 // For fresh installs, this method also causes the extension to be 99 // For fresh installs, this method also causes the extension to be
98 // immediately loaded. 100 // immediately loaded.
101 // TODO(aa): This method can be removed. It is only used by the unit tests,
102 // and they could use CrxInstaller directly instead.
99 void InstallExtension(const FilePath& extension_path); 103 void InstallExtension(const FilePath& extension_path);
100 104
101 // XXX Hack: This is a temporary nasty hack to get theme installation working
102 // without a dialog. Will be fixed by making ExtensionsService more modular.
103 void InstallExtension(const FilePath& extension_path,
104 const GURL& download_url,
105 const GURL& referrer_url);
106
107 // Updates a currently-installed extension with the contents from 105 // Updates a currently-installed extension with the contents from
108 // |extension_path|. 106 // |extension_path|.
107 // TODO(aa): This method can be removed. ExtensionUpdater could use
108 // CrxInstaller directly instead.
109 virtual void UpdateExtension(const std::string& id, 109 virtual void UpdateExtension(const std::string& id,
110 const FilePath& extension_path); 110 const FilePath& extension_path);
111 111
112 // Uninstalls the specified extension. Callers should only call this method 112 // Uninstalls the specified extension. Callers should only call this method
113 // with extensions that exist. |external_uninstall| is a magical parameter 113 // with extensions that exist. |external_uninstall| is a magical parameter
114 // that is only used to send information to ExtensionPrefs, which external 114 // that is only used to send information to ExtensionPrefs, which external
115 // callers should never set to true. 115 // callers should never set to true.
116 // TODO(aa): Remove |external_uninstall| -- this information should be passed 116 // TODO(aa): Remove |external_uninstall| -- this information should be passed
117 // to ExtensionPrefs some other way. 117 // to ExtensionPrefs some other way.
118 void UninstallExtension(const std::string& extension_id, 118 void UninstallExtension(const std::string& extension_id,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 // Profile calls this when it is destroyed so that we know not to call it. 186 // Profile calls this when it is destroyed so that we know not to call it.
187 void ProfileDestroyed() { profile_ = NULL; } 187 void ProfileDestroyed() { profile_ = NULL; }
188 188
189 ExtensionPrefs* extension_prefs() { return extension_prefs_.get(); } 189 ExtensionPrefs* extension_prefs() { return extension_prefs_.get(); }
190 190
191 // Whether the extension service is ready. 191 // Whether the extension service is ready.
192 bool is_ready() { return ready_; } 192 bool is_ready() { return ready_; }
193 193
194 private: 194 private:
195 // Show a confirm installation infobar on the currently active tab.
196 // TODO(aa): This should be moved up into the UI and attached to the tab it
197 // actually occured in. This requires some modularization of
198 // ExtensionsService.
199 bool ShowThemePreviewInfobar(Extension* extension);
200
201 // The profile this ExtensionsService is part of. 195 // The profile this ExtensionsService is part of.
202 Profile* profile_; 196 Profile* profile_;
203 197
204 // Preferences for the owning profile. 198 // Preferences for the owning profile.
205 scoped_ptr<ExtensionPrefs> extension_prefs_; 199 scoped_ptr<ExtensionPrefs> extension_prefs_;
206 200
207 // The message loop to use with the backend. 201 // The message loop to use with the backend.
208 MessageLoop* backend_loop_; 202 MessageLoop* backend_loop_;
209 203
210 // The current list of installed extensions. 204 // The current list of installed extensions.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 334
341 // A map of all external extension providers. 335 // A map of all external extension providers.
342 typedef std::map<Extension::Location, 336 typedef std::map<Extension::Location,
343 linked_ptr<ExternalExtensionProvider> > ProviderMap; 337 linked_ptr<ExternalExtensionProvider> > ProviderMap;
344 ProviderMap external_extension_providers_; 338 ProviderMap external_extension_providers_;
345 339
346 DISALLOW_COPY_AND_ASSIGN(ExtensionsServiceBackend); 340 DISALLOW_COPY_AND_ASSIGN(ExtensionsServiceBackend);
347 }; 341 };
348 342
349 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ 343 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_install_ui.cc ('k') | chrome/browser/extensions/extensions_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698