| 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 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 namespace user_prefs { | 68 namespace user_prefs { |
| 69 class PrefRegistrySyncable; | 69 class PrefRegistrySyncable; |
| 70 } | 70 } |
| 71 | 71 |
| 72 // Instead of adding more members to Profile, consider creating a | 72 // Instead of adding more members to Profile, consider creating a |
| 73 // KeyedService. See | 73 // KeyedService. See |
| 74 // http://dev.chromium.org/developers/design-documents/profile-architecture | 74 // http://dev.chromium.org/developers/design-documents/profile-architecture |
| 75 class Profile : public content::BrowserContext { | 75 class Profile : public content::BrowserContext { |
| 76 public: | 76 public: |
| 77 // Profile services are accessed with the following parameter. This parameter | |
| 78 // defines what the caller plans to do with the service. | |
| 79 // The caller is responsible for not performing any operation that would | |
| 80 // result in persistent implicit records while using an OffTheRecord profile. | |
| 81 // This flag allows the profile to perform an additional check. | |
| 82 // | |
| 83 // It also gives us an opportunity to perform further checks in the future. We | |
| 84 // could, for example, return an history service that only allow some specific | |
| 85 // methods. | |
| 86 enum ServiceAccessType { | |
| 87 // The caller plans to perform a read or write that takes place as a result | |
| 88 // of the user input. Use this flag when the operation you are doing can be | |
| 89 // performed while incognito. (ex: creating a bookmark) | |
| 90 // | |
| 91 // Since EXPLICIT_ACCESS means "as a result of a user action", this request | |
| 92 // always succeeds. | |
| 93 EXPLICIT_ACCESS, | |
| 94 | |
| 95 // The caller plans to call a method that will permanently change some data | |
| 96 // in the profile, as part of Chrome's implicit data logging. Use this flag | |
| 97 // when you are about to perform an operation which is incompatible with the | |
| 98 // incognito mode. | |
| 99 IMPLICIT_ACCESS | |
| 100 }; | |
| 101 | |
| 102 enum CreateStatus { | 77 enum CreateStatus { |
| 103 // Profile services were not created due to a local error (e.g., disk full). | 78 // Profile services were not created due to a local error (e.g., disk full). |
| 104 CREATE_STATUS_LOCAL_FAIL, | 79 CREATE_STATUS_LOCAL_FAIL, |
| 105 // Profile services were not created due to a remote error (e.g., network | 80 // Profile services were not created due to a remote error (e.g., network |
| 106 // down during limited-user registration). | 81 // down during limited-user registration). |
| 107 CREATE_STATUS_REMOTE_FAIL, | 82 CREATE_STATUS_REMOTE_FAIL, |
| 108 // Profile created but before initializing extensions and promo resources. | 83 // Profile created but before initializing extensions and promo resources. |
| 109 CREATE_STATUS_CREATED, | 84 CREATE_STATUS_CREATED, |
| 110 // Profile is created, extensions and promo resources are initialized. | 85 // Profile is created, extensions and promo resources are initialized. |
| 111 CREATE_STATUS_INITIALIZED, | 86 CREATE_STATUS_INITIALIZED, |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 | 394 |
| 420 DISALLOW_COPY_AND_ASSIGN(Profile); | 395 DISALLOW_COPY_AND_ASSIGN(Profile); |
| 421 }; | 396 }; |
| 422 | 397 |
| 423 // The comparator for profile pointers as key in a map. | 398 // The comparator for profile pointers as key in a map. |
| 424 struct ProfileCompare { | 399 struct ProfileCompare { |
| 425 bool operator()(Profile* a, Profile* b) const; | 400 bool operator()(Profile* a, Profile* b) const; |
| 426 }; | 401 }; |
| 427 | 402 |
| 428 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 403 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ |
| OLD | NEW |