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

Side by Side Diff: chrome/browser/profiles/profile.h

Issue 9609024: Reland 124817 - Take extensions out of Profile into a profile-keyed service, ExtensionSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
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 // This class gathers state related to a single user profile. 5 // This class gathers state related to a single user profile.
6 6
7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_H_ 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_H_
8 #define CHROME_BROWSER_PROFILES_PROFILE_H_ 8 #define CHROME_BROWSER_PROFILES_PROFILE_H_
9 #pragma once 9 #pragma once
10 10
11 #include <string> 11 #include <string>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/hash_tables.h" 14 #include "base/hash_tables.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "chrome/browser/net/preconnect.h" // TODO: remove this. 16 #include "chrome/browser/net/preconnect.h" // TODO: remove this.
17 #include "chrome/browser/net/pref_proxy_config_tracker.h" 17 #include "chrome/browser/net/pref_proxy_config_tracker.h"
18 #include "chrome/common/extensions/extension_constants.h"
19 #include "content/public/browser/browser_context.h" 18 #include "content/public/browser/browser_context.h"
20 19
21 class AutocompleteClassifier; 20 class AutocompleteClassifier;
22 class BookmarkModel; 21 class BookmarkModel;
23 class ChromeAppCacheService; 22 class ChromeAppCacheService;
24 class ChromeURLDataManager; 23 class ChromeURLDataManager;
25 class Extension; 24 class Extension;
26 class ExtensionDevToolsManager;
27 class ExtensionEventRouter; 25 class ExtensionEventRouter;
28 class ExtensionInfoMap; 26 class ExtensionPrefValueMap;
29 class ExtensionMessageService;
30 class ExtensionProcessManager; 27 class ExtensionProcessManager;
31 class ExtensionService; 28 class ExtensionService;
32 class ExtensionSpecialStoragePolicy; 29 class ExtensionSpecialStoragePolicy;
33 class FaviconService; 30 class FaviconService;
34 class GAIAInfoUpdateService; 31 class GAIAInfoUpdateService;
35 class HistoryService; 32 class HistoryService;
36 class HostContentSettingsMap; 33 class HostContentSettingsMap;
37 class PasswordStore; 34 class PasswordStore;
38 class PrefService; 35 class PrefService;
39 class PromoCounter; 36 class PromoCounter;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 virtual history::TopSites* GetTopSites() = 0; 208 virtual history::TopSites* GetTopSites() = 0;
212 209
213 // Variant of GetTopSites that doesn't force creation. 210 // Variant of GetTopSites that doesn't force creation.
214 virtual history::TopSites* GetTopSitesWithoutCreating() = 0; 211 virtual history::TopSites* GetTopSitesWithoutCreating() = 0;
215 212
216 // Retrieves a pointer to the VisitedLinkMaster associated with this 213 // Retrieves a pointer to the VisitedLinkMaster associated with this
217 // profile. The VisitedLinkMaster is lazily created the first time 214 // profile. The VisitedLinkMaster is lazily created the first time
218 // that this method is called. 215 // that this method is called.
219 virtual VisitedLinkMaster* GetVisitedLinkMaster() = 0; 216 virtual VisitedLinkMaster* GetVisitedLinkMaster() = 0;
220 217
218 // Accessor. The instance is created upon first access.
219 // TODO(yoz): make this a ProfileKeyedService.
220 virtual ExtensionPrefValueMap* GetExtensionPrefValueMap() = 0;
221
222 // DEPRECATED. Instead, use ExtensionSystemFactory::extension_service().
221 // Retrieves a pointer to the ExtensionService associated with this 223 // Retrieves a pointer to the ExtensionService associated with this
222 // profile. The ExtensionService is created at startup. 224 // profile. The ExtensionService is created at startup.
225 // TODO(yoz): remove this accessor (bug 104095).
223 virtual ExtensionService* GetExtensionService() = 0; 226 virtual ExtensionService* GetExtensionService() = 0;
224 227
228 // DEPRECATED. Instead, use ExtensionSystemFactory::user_script_master().
225 // Retrieves a pointer to the UserScriptMaster associated with this 229 // Retrieves a pointer to the UserScriptMaster associated with this
226 // profile. The UserScriptMaster is lazily created the first time 230 // profile. The UserScriptMaster is lazily created the first time
227 // that this method is called. 231 // that this method is called.
232 // TODO(yoz): remove this accessor (bug 104095).
228 virtual UserScriptMaster* GetUserScriptMaster() = 0; 233 virtual UserScriptMaster* GetUserScriptMaster() = 0;
229 234
230 // Retrieves a pointer to the ExtensionDevToolsManager associated with this 235 // DEPRECATED. Instead, use ExtensionSystemFactory::process_manager().
231 // profile. The instance is created at startup.
232 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() = 0;
233
234 // Retrieves a pointer to the ExtensionProcessManager associated with this 236 // Retrieves a pointer to the ExtensionProcessManager associated with this
235 // profile. The instance is created at startup. 237 // profile. The instance is created at startup.
238 // TODO(yoz): remove this accessor (bug 104095).
236 virtual ExtensionProcessManager* GetExtensionProcessManager() = 0; 239 virtual ExtensionProcessManager* GetExtensionProcessManager() = 0;
237 240
238 // Retrieves a pointer to the ExtensionMessageService associated with this 241 // DEPRECATED. Instead, use ExtensionSystemFactory::event_router().
239 // profile. The instance is created at startup.
240 virtual ExtensionMessageService* GetExtensionMessageService() = 0;
241
242 // Accessor. The instance is created at startup. 242 // Accessor. The instance is created at startup.
243 // TODO(yoz): remove this accessor (bug 104095).
243 virtual ExtensionEventRouter* GetExtensionEventRouter() = 0; 244 virtual ExtensionEventRouter* GetExtensionEventRouter() = 0;
244 245
245 // Accessor. The instance is created upon first access. 246 // Accessor. The instance is created upon first access.
246 virtual ExtensionSpecialStoragePolicy* 247 virtual ExtensionSpecialStoragePolicy*
247 GetExtensionSpecialStoragePolicy() = 0; 248 GetExtensionSpecialStoragePolicy() = 0;
248 249
249 // Retrieves a pointer to the FaviconService associated with this 250 // Retrieves a pointer to the FaviconService associated with this
250 // profile. The FaviconService is lazily created the first time 251 // profile. The FaviconService is lazily created the first time
251 // that this method is called. 252 // that this method is called.
252 // 253 //
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 323
323 // Returns the request context used for extension-related requests. This 324 // Returns the request context used for extension-related requests. This
324 // is only used for a separate cookie store currently. 325 // is only used for a separate cookie store currently.
325 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; 326 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0;
326 327
327 // Returns the request context used within an installed app that has 328 // Returns the request context used within an installed app that has
328 // requested isolated storage. 329 // requested isolated storage.
329 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( 330 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp(
330 const std::string& app_id) = 0; 331 const std::string& app_id) = 0;
331 332
332 // Called by the ExtensionService that lives in this profile. Gives the
333 // profile a chance to react to the load event before the EXTENSION_LOADED
334 // notification has fired. The purpose for handling this event first is to
335 // avoid race conditions by making sure URLRequestContexts learn about new
336 // extensions before anything else needs them to know.
337 virtual void RegisterExtensionWithRequestContexts(
338 const Extension* extension) {}
339
340 // Called by the ExtensionService that lives in this profile. Lets the
341 // profile clean up its RequestContexts once all the listeners to the
342 // EXTENSION_UNLOADED notification have finished running.
343 virtual void UnregisterExtensionWithRequestContexts(
344 const std::string& extension_id,
345 const extension_misc::UnloadedExtensionReason) {}
346
347 // Returns the SSLConfigService for this profile. 333 // Returns the SSLConfigService for this profile.
348 virtual net::SSLConfigService* GetSSLConfigService() = 0; 334 virtual net::SSLConfigService* GetSSLConfigService() = 0;
349 335
350 // Returns the Hostname <-> Content settings map for this profile. 336 // Returns the Hostname <-> Content settings map for this profile.
351 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; 337 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0;
352 338
353 // Returns the user style sheet watcher. 339 // Returns the user style sheet watcher.
354 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() = 0; 340 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() = 0;
355 341
356 // Returns the BookmarkModel, creating if not yet created. 342 // Returns the BookmarkModel, creating if not yet created.
(...skipping 13 matching lines...) Expand all
370 // this profile. For the single profile case, this corresponds to the time 356 // this profile. For the single profile case, this corresponds to the time
371 // the user started chrome. 357 // the user started chrome.
372 virtual base::Time GetStartTime() const = 0; 358 virtual base::Time GetStartTime() const = 0;
373 359
374 // Marks the profile as cleanly shutdown. 360 // Marks the profile as cleanly shutdown.
375 // 361 //
376 // NOTE: this is invoked internally on a normal shutdown, but is public so 362 // NOTE: this is invoked internally on a normal shutdown, but is public so
377 // that it can be invoked when the user logs out/powers down (WM_ENDSESSION). 363 // that it can be invoked when the user logs out/powers down (WM_ENDSESSION).
378 virtual void MarkAsCleanShutdown() = 0; 364 virtual void MarkAsCleanShutdown() = 0;
379 365
380 // Initializes extensions machinery.
381 // Component extensions are always enabled, external and user extensions
382 // are controlled by |extensions_enabled|.
383 virtual void InitExtensions(bool extensions_enabled) = 0;
384
385 // Start up service that gathers data from a promo resource feed. 366 // Start up service that gathers data from a promo resource feed.
386 virtual void InitPromoResources() = 0; 367 virtual void InitPromoResources() = 0;
387 368
388 // Register URLRequestFactories for protocols registered with 369 // Register URLRequestFactories for protocols registered with
389 // registerProtocolHandler. 370 // registerProtocolHandler.
390 virtual void InitRegisteredProtocolHandlers() = 0; 371 virtual void InitRegisteredProtocolHandlers() = 0;
391 372
392 // Returns the last directory that was chosen for uploading or opening a file. 373 // Returns the last directory that was chosen for uploading or opening a file.
393 virtual FilePath last_selected_directory() = 0; 374 virtual FilePath last_selected_directory() = 0;
394 virtual void set_last_selected_directory(const FilePath& path) = 0; 375 virtual void set_last_selected_directory(const FilePath& path) = 0;
395 376
396 // Returns the IO-thread-accessible profile data for this profile.
397 virtual ExtensionInfoMap* GetExtensionInfoMap() = 0;
398
399 // Returns the PromoCounter for Instant, or NULL if not applicable. 377 // Returns the PromoCounter for Instant, or NULL if not applicable.
400 virtual PromoCounter* GetInstantPromoCounter() = 0; 378 virtual PromoCounter* GetInstantPromoCounter() = 0;
401 379
402 // Returns the ChromeURLDataManager for this profile. 380 // Returns the ChromeURLDataManager for this profile.
403 virtual ChromeURLDataManager* GetChromeURLDataManager() = 0; 381 virtual ChromeURLDataManager* GetChromeURLDataManager() = 0;
404 382
405 #if defined(OS_CHROMEOS) 383 #if defined(OS_CHROMEOS)
406 enum AppLocaleChangedVia { 384 enum AppLocaleChangedVia {
407 // Caused by chrome://settings change. 385 // Caused by chrome://settings change.
408 APP_LOCALE_CHANGED_VIA_SETTINGS, 386 APP_LOCALE_CHANGED_VIA_SETTINGS,
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 struct hash<Profile*> { 496 struct hash<Profile*> {
519 std::size_t operator()(Profile* const& p) const { 497 std::size_t operator()(Profile* const& p) const {
520 return reinterpret_cast<std::size_t>(p); 498 return reinterpret_cast<std::size_t>(p);
521 } 499 }
522 }; 500 };
523 501
524 } // namespace BASE_HASH_NAMESPACE 502 } // namespace BASE_HASH_NAMESPACE
525 #endif 503 #endif
526 504
527 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ 505 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_
OLDNEW
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_impl_unittest.cc ('k') | chrome/browser/profiles/profile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698