| OLD | NEW | 
|    1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2011 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 #include "chrome/browser/profiles/profile.h" |    5 #include "chrome/browser/profiles/profile.h" | 
|    6  |    6  | 
|    7 #include <string> |    7 #include <string> | 
|    8  |    8  | 
|    9 #include "base/command_line.h" |    9 #include "base/command_line.h" | 
|   10 #include "base/compiler_specific.h" |   10 #include "base/compiler_specific.h" | 
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   89 } |   89 } | 
|   90  |   90  | 
|   91 // static |   91 // static | 
|   92 const char* Profile::kProfileKey = "__PROFILE__"; |   92 const char* Profile::kProfileKey = "__PROFILE__"; | 
|   93  |   93  | 
|   94 // static |   94 // static | 
|   95 const ProfileId Profile::kInvalidProfileId = static_cast<ProfileId>(0); |   95 const ProfileId Profile::kInvalidProfileId = static_cast<ProfileId>(0); | 
|   96  |   96  | 
|   97 // static |   97 // static | 
|   98 void Profile::RegisterUserPrefs(PrefService* prefs) { |   98 void Profile::RegisterUserPrefs(PrefService* prefs) { | 
|   99   prefs->RegisterBooleanPref(prefs::kSearchSuggestEnabled, true); |   99   prefs->RegisterBooleanPref(prefs::kSearchSuggestEnabled, | 
|  100   prefs->RegisterBooleanPref(prefs::kSessionExitedCleanly, true); |  100                              true, | 
|  101   prefs->RegisterBooleanPref(prefs::kSafeBrowsingEnabled, true); |  101                              true /* sync pref */); | 
|  102   prefs->RegisterBooleanPref(prefs::kSafeBrowsingReportingEnabled, false); |  102   prefs->RegisterBooleanPref(prefs::kSessionExitedCleanly, | 
 |  103                              true, | 
 |  104                              false /* don't sync pref */); | 
 |  105   prefs->RegisterBooleanPref(prefs::kSafeBrowsingEnabled, | 
 |  106                              true, | 
 |  107                              true /* sync pref */); | 
 |  108   prefs->RegisterBooleanPref(prefs::kSafeBrowsingReportingEnabled, | 
 |  109                              false, | 
 |  110                              false /* don't sync pref */); | 
|  103   // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. |  111   // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. | 
|  104   prefs->RegisterLocalizedStringPref(prefs::kSpellCheckDictionary, |  112   prefs->RegisterLocalizedStringPref(prefs::kSpellCheckDictionary, | 
|  105       IDS_SPELLCHECK_DICTIONARY); |  113                                      IDS_SPELLCHECK_DICTIONARY, | 
|  106   prefs->RegisterBooleanPref(prefs::kEnableSpellCheck, true); |  114                                      false /* don't sync pref */); | 
|  107   prefs->RegisterBooleanPref(prefs::kEnableAutoSpellCorrect, true); |  115   prefs->RegisterBooleanPref(prefs::kEnableSpellCheck, | 
 |  116                              true, | 
 |  117                              true /* sync pref */); | 
 |  118   prefs->RegisterBooleanPref(prefs::kEnableAutoSpellCorrect, | 
 |  119                              true, | 
 |  120                              false /* don't sync pref */); | 
|  108 #if defined(TOOLKIT_USES_GTK) |  121 #if defined(TOOLKIT_USES_GTK) | 
|  109   prefs->RegisterBooleanPref(prefs::kUsesSystemTheme, |  122   prefs->RegisterBooleanPref(prefs::kUsesSystemTheme, | 
|  110                              GtkThemeService::DefaultUsesSystemTheme()); |  123                              GtkThemeService::DefaultUsesSystemTheme(), | 
 |  124                              false /* don't sync pref */); | 
|  111 #endif |  125 #endif | 
|  112   prefs->RegisterFilePathPref(prefs::kCurrentThemePackFilename, FilePath()); |  126   prefs->RegisterFilePathPref(prefs::kCurrentThemePackFilename, | 
 |  127                               FilePath(), | 
 |  128                               false /* don't sync pref */); | 
|  113   prefs->RegisterStringPref(prefs::kCurrentThemeID, |  129   prefs->RegisterStringPref(prefs::kCurrentThemeID, | 
|  114                             ThemeService::kDefaultThemeID); |  130                             ThemeService::kDefaultThemeID, | 
|  115   prefs->RegisterDictionaryPref(prefs::kCurrentThemeImages); |  131                             false /* don't sync pref */); | 
|  116   prefs->RegisterDictionaryPref(prefs::kCurrentThemeColors); |  132   prefs->RegisterDictionaryPref(prefs::kCurrentThemeImages, | 
|  117   prefs->RegisterDictionaryPref(prefs::kCurrentThemeTints); |  133                                 false /* don't sync pref */); | 
|  118   prefs->RegisterDictionaryPref(prefs::kCurrentThemeDisplayProperties); |  134   prefs->RegisterDictionaryPref(prefs::kCurrentThemeColors, | 
|  119   prefs->RegisterBooleanPref(prefs::kDisableExtensions, false); |  135                                 false /* don't sync pref */); | 
|  120   prefs->RegisterStringPref(prefs::kSelectFileLastDirectory, ""); |  136   prefs->RegisterDictionaryPref(prefs::kCurrentThemeTints, | 
 |  137                                 false /* don't sync pref */); | 
 |  138   prefs->RegisterDictionaryPref(prefs::kCurrentThemeDisplayProperties, | 
 |  139                                 false /* don't sync pref */); | 
 |  140   prefs->RegisterBooleanPref(prefs::kDisableExtensions, | 
 |  141                              false, | 
 |  142                              false /* don't sync pref */); | 
 |  143   prefs->RegisterStringPref(prefs::kSelectFileLastDirectory, | 
 |  144                             "", | 
 |  145                             false /* don't sync pref */); | 
|  121 #if defined(OS_CHROMEOS) |  146 #if defined(OS_CHROMEOS) | 
|  122   // TODO(dilmah): For OS_CHROMEOS we maintain kApplicationLocale in both |  147   // TODO(dilmah): For OS_CHROMEOS we maintain kApplicationLocale in both | 
|  123   // local state and user's profile.  For other platforms we maintain |  148   // local state and user's profile.  For other platforms we maintain | 
|  124   // kApplicationLocale only in local state. |  149   // kApplicationLocale only in local state. | 
|  125   // In the future we may want to maintain kApplicationLocale |  150   // In the future we may want to maintain kApplicationLocale | 
|  126   // in user's profile for other platforms as well. |  151   // in user's profile for other platforms as well. | 
|  127   prefs->RegisterStringPref(prefs::kApplicationLocale, ""); |  152   prefs->RegisterStringPref(prefs::kApplicationLocale, | 
|  128   prefs->RegisterStringPref(prefs::kApplicationLocaleBackup, ""); |  153                             "", | 
|  129   prefs->RegisterStringPref(prefs::kApplicationLocaleAccepted, ""); |  154                             true /* sync pref */); | 
 |  155   prefs->RegisterStringPref(prefs::kApplicationLocaleBackup, | 
 |  156                             "", | 
 |  157                             false /* don't sync pref */); | 
 |  158   prefs->RegisterStringPref(prefs::kApplicationLocaleAccepted, | 
 |  159                             "", | 
 |  160                             false /* don't sync pref */); | 
|  130 #endif |  161 #endif | 
|  131 } |  162 } | 
|  132  |  163  | 
|  133 // static |  164 // static | 
|  134 net::URLRequestContextGetter* Profile::GetDefaultRequestContext() { |  165 net::URLRequestContextGetter* Profile::GetDefaultRequestContext() { | 
|  135   return default_request_context_; |  166   return default_request_context_; | 
|  136 } |  167 } | 
|  137  |  168  | 
|  138 bool Profile::IsGuestSession() { |  169 bool Profile::IsGuestSession() { | 
|  139 #if defined(OS_CHROMEOS) |  170 #if defined(OS_CHROMEOS) | 
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  763 }; |  794 }; | 
|  764 #endif |  795 #endif | 
|  765  |  796  | 
|  766 Profile* Profile::CreateOffTheRecordProfile() { |  797 Profile* Profile::CreateOffTheRecordProfile() { | 
|  767 #if defined(OS_CHROMEOS) |  798 #if defined(OS_CHROMEOS) | 
|  768   if (Profile::IsGuestSession()) |  799   if (Profile::IsGuestSession()) | 
|  769     return new GuestSessionProfile(this); |  800     return new GuestSessionProfile(this); | 
|  770 #endif |  801 #endif | 
|  771   return new OffTheRecordProfileImpl(this); |  802   return new OffTheRecordProfileImpl(this); | 
|  772 } |  803 } | 
| OLD | NEW |