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 // 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/browser/ui/webui/chrome_url_data_manager_factory.h" |
18 #include "content/public/browser/browser_context.h" | 19 #include "content/public/browser/browser_context.h" |
19 | 20 |
20 class AutocompleteClassifier; | 21 class AutocompleteClassifier; |
21 class BookmarkModel; | 22 class BookmarkModel; |
22 class ChromeAppCacheService; | 23 class ChromeAppCacheService; |
23 class ChromeURLDataManager; | 24 class ChromeURLDataManager; |
24 class Extension; | 25 class Extension; |
25 class ExtensionEventRouter; | 26 class ExtensionEventRouter; |
26 class ExtensionProcessManager; | 27 class ExtensionProcessManager; |
27 class ExtensionService; | 28 class ExtensionService; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 virtual void InitPromoResources() = 0; | 342 virtual void InitPromoResources() = 0; |
342 | 343 |
343 // Register URLRequestFactories for protocols registered with | 344 // Register URLRequestFactories for protocols registered with |
344 // registerProtocolHandler. | 345 // registerProtocolHandler. |
345 virtual void InitRegisteredProtocolHandlers() = 0; | 346 virtual void InitRegisteredProtocolHandlers() = 0; |
346 | 347 |
347 // Returns the last directory that was chosen for uploading or opening a file. | 348 // Returns the last directory that was chosen for uploading or opening a file. |
348 virtual FilePath last_selected_directory() = 0; | 349 virtual FilePath last_selected_directory() = 0; |
349 virtual void set_last_selected_directory(const FilePath& path) = 0; | 350 virtual void set_last_selected_directory(const FilePath& path) = 0; |
350 | 351 |
351 // Returns the ChromeURLDataManager for this profile. | |
352 virtual ChromeURLDataManager* GetChromeURLDataManager() = 0; | |
353 | |
354 #if defined(OS_CHROMEOS) | 352 #if defined(OS_CHROMEOS) |
355 enum AppLocaleChangedVia { | 353 enum AppLocaleChangedVia { |
356 // Caused by chrome://settings change. | 354 // Caused by chrome://settings change. |
357 APP_LOCALE_CHANGED_VIA_SETTINGS, | 355 APP_LOCALE_CHANGED_VIA_SETTINGS, |
358 // Locale has been reverted via LocaleChangeGuard. | 356 // Locale has been reverted via LocaleChangeGuard. |
359 APP_LOCALE_CHANGED_VIA_REVERT, | 357 APP_LOCALE_CHANGED_VIA_REVERT, |
360 // From login screen. | 358 // From login screen. |
361 APP_LOCALE_CHANGED_VIA_LOGIN, | 359 APP_LOCALE_CHANGED_VIA_LOGIN, |
362 // Source unknown. | 360 // Source unknown. |
363 APP_LOCALE_CHANGED_VIA_UNKNOWN | 361 APP_LOCALE_CHANGED_VIA_UNKNOWN |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 } | 432 } |
435 | 433 |
436 // Checks whether sync is configurable by the user. Returns false if sync is | 434 // Checks whether sync is configurable by the user. Returns false if sync is |
437 // disabled or controlled by configuration management. | 435 // disabled or controlled by configuration management. |
438 bool IsSyncAccessible(); | 436 bool IsSyncAccessible(); |
439 | 437 |
440 // Creates an OffTheRecordProfile which points to this Profile. | 438 // Creates an OffTheRecordProfile which points to this Profile. |
441 Profile* CreateOffTheRecordProfile(); | 439 Profile* CreateOffTheRecordProfile(); |
442 | 440 |
443 protected: | 441 protected: |
| 442 // TODO(erg, willchan): Remove friendship once |ProfileIOData| is made into |
| 443 // a |ProfileKeyedService|. |
| 444 friend class ChromeURLDataManagerFactory; |
444 friend class OffTheRecordProfileImpl; | 445 friend class OffTheRecordProfileImpl; |
445 | 446 |
| 447 // Returns a callback to a method returning a |ChromeURLDataManagerBackend|. |
| 448 // Used to create a |ChromeURLDataManager| for this |Profile|. |
| 449 // TODO(erg, willchan): Remove this once |ProfileIOData| is made into a |
| 450 // |ProfileKeyedService|. |
| 451 virtual base::Callback<ChromeURLDataManagerBackend*(void)> |
| 452 GetChromeURLDataManagerBackendGetter() const = 0; |
| 453 |
446 static net::URLRequestContextGetter* default_request_context_; | 454 static net::URLRequestContextGetter* default_request_context_; |
447 | 455 |
448 private: | 456 private: |
449 // ***DEPRECATED**: You should be passing in the specific profile's | 457 // ***DEPRECATED**: You should be passing in the specific profile's |
450 // URLRequestContextGetter or using the system URLRequestContextGetter. | 458 // URLRequestContextGetter or using the system URLRequestContextGetter. |
451 // | 459 // |
452 // Returns the request context for the "default" profile. This may be called | 460 // Returns the request context for the "default" profile. This may be called |
453 // from any thread. This CAN return NULL if a first request context has not | 461 // from any thread. This CAN return NULL if a first request context has not |
454 // yet been created. If necessary, listen on the UI thread for | 462 // yet been created. If necessary, listen on the UI thread for |
455 // NOTIFY_DEFAULT_REQUEST_CONTEXT_AVAILABLE. | 463 // NOTIFY_DEFAULT_REQUEST_CONTEXT_AVAILABLE. |
(...skipping 15 matching lines...) Expand all Loading... |
471 struct hash<Profile*> { | 479 struct hash<Profile*> { |
472 std::size_t operator()(Profile* const& p) const { | 480 std::size_t operator()(Profile* const& p) const { |
473 return reinterpret_cast<std::size_t>(p); | 481 return reinterpret_cast<std::size_t>(p); |
474 } | 482 } |
475 }; | 483 }; |
476 | 484 |
477 } // namespace BASE_HASH_NAMESPACE | 485 } // namespace BASE_HASH_NAMESPACE |
478 #endif | 486 #endif |
479 | 487 |
480 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 488 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ |
OLD | NEW |