Chromium Code Reviews| 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 #include "chrome/browser/profiles/off_the_record_profile_impl.h" | 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 #include "content/public/browser/browser_thread.h" | 47 #include "content/public/browser/browser_thread.h" |
| 48 #include "content/public/browser/host_zoom_map.h" | 48 #include "content/public/browser/host_zoom_map.h" |
| 49 #include "content/public/browser/notification_service.h" | 49 #include "content/public/browser/notification_service.h" |
| 50 #include "content/public/browser/notification_types.h" | 50 #include "content/public/browser/notification_types.h" |
| 51 #include "content/public/browser/render_process_host.h" | 51 #include "content/public/browser/render_process_host.h" |
| 52 #include "content/public/browser/web_contents.h" | 52 #include "content/public/browser/web_contents.h" |
| 53 #include "net/base/transport_security_state.h" | 53 #include "net/base/transport_security_state.h" |
| 54 #include "net/http/http_server_properties.h" | 54 #include "net/http/http_server_properties.h" |
| 55 #include "webkit/database/database_tracker.h" | 55 #include "webkit/database/database_tracker.h" |
| 56 | 56 |
| 57 #if defined(OS_ANDROID) | |
| 58 #include "chrome/browser/prefs/scoped_user_pref_update.h" | |
| 59 #endif | |
| 60 | |
| 57 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
| 58 #include "chrome/browser/chromeos/preferences.h" | 62 #include "chrome/browser/chromeos/preferences.h" |
| 59 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 63 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
| 60 #endif | 64 #endif |
| 61 | 65 |
| 62 using content::BrowserThread; | 66 using content::BrowserThread; |
| 63 using content::DownloadManagerDelegate; | 67 using content::DownloadManagerDelegate; |
| 64 using content::HostZoomMap; | 68 using content::HostZoomMap; |
| 65 | 69 |
| 66 namespace { | 70 namespace { |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 77 original_profile, otr_profile); | 81 original_profile, otr_profile); |
| 78 } | 82 } |
| 79 | 83 |
| 80 } // namespace | 84 } // namespace |
| 81 | 85 |
| 82 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) | 86 OffTheRecordProfileImpl::OffTheRecordProfileImpl(Profile* real_profile) |
| 83 : profile_(real_profile), | 87 : profile_(real_profile), |
| 84 prefs_(real_profile->GetOffTheRecordPrefs()), | 88 prefs_(real_profile->GetOffTheRecordPrefs()), |
| 85 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), | 89 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), |
| 86 start_time_(Time::Now()) { | 90 start_time_(Time::Now()) { |
| 91 #if defined(OS_ANDROID) | |
|
rpetterson
2012/09/28 18:10:58
Is it possible to group these into a single functi
bengr (incorrect)
2012/10/01 18:52:45
Done.
| |
| 92 const char kProxyMode[] = "mode"; | |
| 93 const char kProxyServer[] = "server"; | |
| 94 const char kProxyBypassList[] = "bypass_list"; | |
| 95 DictionaryPrefUpdate update(prefs_, prefs::kProxy); | |
| 96 DictionaryValue* dict = update.Get(); | |
| 97 dict->SetString(kProxyMode, ProxyModeToString(ProxyPrefs::MODE_SYSTEM)); | |
| 98 dict->SetString(kProxyServer, ""); | |
| 99 dict->SetString(kProxyBypassList, ""); | |
| 100 #endif | |
| 87 } | 101 } |
| 88 | 102 |
| 89 void OffTheRecordProfileImpl::Init() { | 103 void OffTheRecordProfileImpl::Init() { |
| 90 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | 104 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); |
| 91 | 105 |
| 92 extensions::ExtensionSystem::Get(this)->InitForOTRProfile(); | 106 extensions::ExtensionSystem::Get(this)->InitForOTRProfile(); |
| 93 | 107 |
| 94 DCHECK_NE(IncognitoModePrefs::DISABLED, | 108 DCHECK_NE(IncognitoModePrefs::DISABLED, |
| 95 IncognitoModePrefs::GetAvailability(profile_->GetPrefs())); | 109 IncognitoModePrefs::GetAvailability(profile_->GetPrefs())); |
| 96 | 110 |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 470 if (!profile) | 484 if (!profile) |
| 471 profile = new OffTheRecordProfileImpl(this); | 485 profile = new OffTheRecordProfileImpl(this); |
| 472 profile->Init(); | 486 profile->Init(); |
| 473 return profile; | 487 return profile; |
| 474 } | 488 } |
| 475 | 489 |
| 476 base::Callback<ChromeURLDataManagerBackend*(void)> | 490 base::Callback<ChromeURLDataManagerBackend*(void)> |
| 477 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 491 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
| 478 return io_data_.GetChromeURLDataManagerBackendGetter(); | 492 return io_data_.GetChromeURLDataManagerBackendGetter(); |
| 479 } | 493 } |
| OLD | NEW |