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

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

Issue 306044: Refactor implementation of BrowserActions, and add support for (Closed)
Patch Set: Make it work on linux too Created 11 years, 2 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) 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 // Look up an extension by ID. 100 // Look up an extension by ID.
101 Extension* GetExtensionById(const std::string& id) { 101 Extension* GetExtensionById(const std::string& id) {
102 return GetExtensionByIdInternal(id, true, false); 102 return GetExtensionByIdInternal(id, true, false);
103 } 103 }
104 104
105 // Retrieves a vector of all page actions, irrespective of which extension 105 // Retrieves a vector of all page actions, irrespective of which extension
106 // they belong to. 106 // they belong to.
107 std::vector<ExtensionAction*> GetPageActions() const; 107 std::vector<ExtensionAction*> GetPageActions() const;
108 108
109 // Retrieves a vector of all browser actions, irrespective of which extension
110 // they belong to.
111 std::vector<ExtensionAction*> GetBrowserActions(bool include_popups) const;
112
113 // Install the extension file at |extension_path|. Will install as an 109 // Install the extension file at |extension_path|. Will install as an
114 // update if an older version is already installed. 110 // update if an older version is already installed.
115 // For fresh installs, this method also causes the extension to be 111 // For fresh installs, this method also causes the extension to be
116 // immediately loaded. 112 // immediately loaded.
117 // TODO(aa): This method can be removed. It is only used by the unit tests, 113 // TODO(aa): This method can be removed. It is only used by the unit tests,
118 // and they could use CrxInstaller directly instead. 114 // and they could use CrxInstaller directly instead.
119 void InstallExtension(const FilePath& extension_path); 115 void InstallExtension(const FilePath& extension_path);
120 116
121 // Updates a currently-installed extension with the contents from 117 // Updates a currently-installed extension with the contents from
122 // |extension_path|. 118 // |extension_path|.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 void LoadInstalledExtension( 238 void LoadInstalledExtension(
243 DictionaryValue* manifest, const std::string& id, 239 DictionaryValue* manifest, const std::string& id,
244 const FilePath& path, Extension::Location location); 240 const FilePath& path, Extension::Location location);
245 241
246 // Handles sending notification that |extension| was loaded. 242 // Handles sending notification that |extension| was loaded.
247 void NotifyExtensionLoaded(Extension* extension); 243 void NotifyExtensionLoaded(Extension* extension);
248 244
249 // Handles sending notification that |extension| was unloaded. 245 // Handles sending notification that |extension| was unloaded.
250 void NotifyExtensionUnloaded(Extension* extension); 246 void NotifyExtensionUnloaded(Extension* extension);
251 247
252 // Retrieves a vector of all page actions or browser actions, irrespective of
253 // which extension they belong to. If |include_popups| is false, actions that
254 // are popups are excluded.
255 std::vector<ExtensionAction*> GetExtensionActions(
256 ExtensionAction::ExtensionActionType action_type,
257 bool include_popups) const;
258
259 // The profile this ExtensionsService is part of. 248 // The profile this ExtensionsService is part of.
260 Profile* profile_; 249 Profile* profile_;
261 250
262 // Preferences for the owning profile. 251 // Preferences for the owning profile.
263 scoped_ptr<ExtensionPrefs> extension_prefs_; 252 scoped_ptr<ExtensionPrefs> extension_prefs_;
264 253
265 // The message loop to use with the backend. 254 // The message loop to use with the backend.
266 MessageLoop* backend_loop_; 255 MessageLoop* backend_loop_;
267 256
268 // The current list of installed extensions. 257 // The current list of installed extensions.
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 375
387 // A map of all external extension providers. 376 // A map of all external extension providers.
388 typedef std::map<Extension::Location, 377 typedef std::map<Extension::Location,
389 linked_ptr<ExternalExtensionProvider> > ProviderMap; 378 linked_ptr<ExternalExtensionProvider> > ProviderMap;
390 ProviderMap external_extension_providers_; 379 ProviderMap external_extension_providers_;
391 380
392 DISALLOW_COPY_AND_ASSIGN(ExtensionsServiceBackend); 381 DISALLOW_COPY_AND_ASSIGN(ExtensionsServiceBackend);
393 }; 382 };
394 383
395 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ 384 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_file_util.cc ('k') | chrome/browser/extensions/extensions_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698