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

Unified Diff: chrome/browser/profiles/off_the_record_profile_impl.cc

Issue 7791031: Move the otr profile into its own .cc file. Like what was done with the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/profiles/profile.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/off_the_record_profile_impl.cc
===================================================================
--- chrome/browser/profiles/off_the_record_profile_impl.cc (revision 98818)
+++ chrome/browser/profiles/off_the_record_profile_impl.cc (working copy)
@@ -54,18 +54,11 @@
#include "content/browser/in_process_webkit/webkit_context.h"
#include "content/browser/ssl/ssl_host_state.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/browser/webui/web_ui.h"
#include "content/common/notification_service.h"
-#include "grit/locale_settings.h"
#include "net/base/transport_security_state.h"
-#include "ui/base/resource/resource_bundle.h"
#include "webkit/database/database_tracker.h"
#include "webkit/quota/quota_manager.h"
-#if defined(TOOLKIT_USES_GTK)
-#include "chrome/browser/ui/gtk/gtk_theme_service.h"
-#endif
-
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/preferences.h"
#endif
@@ -73,15 +66,8 @@
using base::Time;
using base::TimeDelta;
-// A pointer to the request context for the default profile. See comments on
-// Profile::GetDefaultRequestContext.
-net::URLRequestContextGetter* Profile::default_request_context_;
-
namespace {
-// Used to tag the first profile launched in a Chrome session.
-bool g_first_profile_launched = true;
-
void NotifyOTRProfileCreatedOnIOThread(void* original_profile,
void* otr_profile) {
ExtensionWebRequestEventRouter::GetInstance()->OnOTRProfileCreated(
@@ -96,140 +82,6 @@
} // namespace
-Profile::Profile()
- : restored_last_session_(false),
- first_launched_(g_first_profile_launched),
- accessibility_pause_level_(0) {
- g_first_profile_launched = false;
-}
-
-// static
-Profile* Profile::FromBrowserContext(content::BrowserContext* browser_context) {
- // This is safe; this is the only implementation of the browser context.
- return static_cast<Profile*>(browser_context);
-}
-
-// static
-Profile* Profile::FromWebUI(WebUI* web_ui) {
- return FromBrowserContext(web_ui->tab_contents()->browser_context());
-}
-
-// static
-const char* const Profile::kProfileKey = "__PROFILE__";
-
-#if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX)
-// static
-const LocalProfileId Profile::kInvalidLocalProfileId =
- static_cast<LocalProfileId>(0);
-#endif
-
-// static
-void Profile::RegisterUserPrefs(PrefService* prefs) {
- prefs->RegisterBooleanPref(prefs::kSearchSuggestEnabled,
- true,
- PrefService::SYNCABLE_PREF);
- prefs->RegisterBooleanPref(prefs::kSessionExitedCleanly,
- true,
- PrefService::UNSYNCABLE_PREF);
- prefs->RegisterBooleanPref(prefs::kSafeBrowsingEnabled,
- true,
- PrefService::SYNCABLE_PREF);
- prefs->RegisterBooleanPref(prefs::kSafeBrowsingReportingEnabled,
- false,
- PrefService::UNSYNCABLE_PREF);
- // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string.
- prefs->RegisterLocalizedStringPref(prefs::kSpellCheckDictionary,
- IDS_SPELLCHECK_DICTIONARY,
- PrefService::UNSYNCABLE_PREF);
- prefs->RegisterBooleanPref(prefs::kEnableSpellCheck,
- true,
- PrefService::SYNCABLE_PREF);
- prefs->RegisterBooleanPref(prefs::kEnableAutoSpellCorrect,
- true,
- PrefService::UNSYNCABLE_PREF);
- prefs->RegisterBooleanPref(prefs::kSpeechInputCensorResults,
- true,
- PrefService::UNSYNCABLE_PREF);
-#if defined(TOOLKIT_USES_GTK)
- prefs->RegisterBooleanPref(prefs::kUsesSystemTheme,
- GtkThemeService::DefaultUsesSystemTheme(),
- PrefService::UNSYNCABLE_PREF);
-#endif
- prefs->RegisterFilePathPref(prefs::kCurrentThemePackFilename,
- FilePath(),
- PrefService::UNSYNCABLE_PREF);
- prefs->RegisterStringPref(prefs::kCurrentThemeID,
- ThemeService::kDefaultThemeID,
- PrefService::UNSYNCABLE_PREF);
- prefs->RegisterDictionaryPref(prefs::kCurrentThemeImages,
- PrefService::UNSYNCABLE_PREF);
- prefs->RegisterDictionaryPref(prefs::kCurrentThemeColors,
- PrefService::UNSYNCABLE_PREF);
- prefs->RegisterDictionaryPref(prefs::kCurrentThemeTints,
- PrefService::UNSYNCABLE_PREF);
- prefs->RegisterDictionaryPref(prefs::kCurrentThemeDisplayProperties,
- PrefService::UNSYNCABLE_PREF);
- prefs->RegisterBooleanPref(prefs::kDisableExtensions,
- false,
- PrefService::UNSYNCABLE_PREF);
- prefs->RegisterStringPref(prefs::kSelectFileLastDirectory,
- "",
- PrefService::UNSYNCABLE_PREF);
- prefs->RegisterDoublePref(prefs::kDefaultZoomLevel,
- 0.0,
- PrefService::UNSYNCABLE_PREF);
- prefs->RegisterDictionaryPref(prefs::kPerHostZoomLevels,
- PrefService::UNSYNCABLE_PREF);
-#if defined(OS_CHROMEOS)
- // TODO(dilmah): For OS_CHROMEOS we maintain kApplicationLocale in both
- // local state and user's profile. For other platforms we maintain
- // kApplicationLocale only in local state.
- // In the future we may want to maintain kApplicationLocale
- // in user's profile for other platforms as well.
- prefs->RegisterStringPref(prefs::kApplicationLocale,
- "",
- PrefService::SYNCABLE_PREF);
- prefs->RegisterStringPref(prefs::kApplicationLocaleBackup,
- "",
- PrefService::UNSYNCABLE_PREF);
- prefs->RegisterStringPref(prefs::kApplicationLocaleAccepted,
- "",
- PrefService::UNSYNCABLE_PREF);
-#endif
-
- prefs->RegisterBooleanPref(prefs::kSyncPromoExpanded,
- true,
- PrefService::UNSYNCABLE_PREF);
-}
-
-// static
-net::URLRequestContextGetter* Profile::GetDefaultRequestContext() {
- return default_request_context_;
-}
-
-std::string Profile::GetDebugName() {
- std::string name = GetPath().BaseName().MaybeAsASCII();
- if (name.empty()) {
- name = "UnknownProfile";
- }
- return name;
-}
-
-bool Profile::IsGuestSession() {
-#if defined(OS_CHROMEOS)
- static bool is_guest_session =
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession);
- return is_guest_session;
-#else
- return false;
-#endif
-}
-
-bool Profile::IsSyncAccessible() {
- ProfileSyncService* syncService = GetProfileSyncService();
- return syncService && !syncService->IsManaged();
-}
-
////////////////////////////////////////////////////////////////////////////////
//
// OffTheRecordProfileImpl is a profile subclass that wraps an existing profile
« no previous file with comments | « no previous file | chrome/browser/profiles/profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698