| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/profile.h" | 5 #include "chrome/browser/profile.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 virtual Profile* GetOffTheRecordProfile() { | 135 virtual Profile* GetOffTheRecordProfile() { |
| 136 return this; | 136 return this; |
| 137 } | 137 } |
| 138 | 138 |
| 139 virtual Profile* GetOriginalProfile() { | 139 virtual Profile* GetOriginalProfile() { |
| 140 return profile_; | 140 return profile_; |
| 141 } | 141 } |
| 142 | 142 |
| 143 virtual VisitedLinkMaster* GetVisitedLinkMaster() { | 143 virtual VisitedLinkMaster* GetVisitedLinkMaster() { |
| 144 return profile_->GetVisitedLinkMaster(); | 144 // We don't provide access to the VisitedLinkMaster when we're OffTheRecord |
| 145 // because we don't want to leak the sites that the user has visited before. |
| 146 return NULL; |
| 145 } | 147 } |
| 146 | 148 |
| 147 virtual ExtensionsService* GetExtensionsService() { | 149 virtual ExtensionsService* GetExtensionsService() { |
| 148 return profile_->GetExtensionsService(); | 150 return profile_->GetExtensionsService(); |
| 149 } | 151 } |
| 150 | 152 |
| 151 virtual UserScriptMaster* GetUserScriptMaster() { | 153 virtual UserScriptMaster* GetUserScriptMaster() { |
| 152 return profile_->GetUserScriptMaster(); | 154 return profile_->GetUserScriptMaster(); |
| 153 } | 155 } |
| 154 | 156 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 PrefService* prefs = GetPrefs(); | 376 PrefService* prefs = GetPrefs(); |
| 375 bool user_scripts_enabled = | 377 bool user_scripts_enabled = |
| 376 command_line->HasSwitch(switches::kEnableUserScripts) || | 378 command_line->HasSwitch(switches::kEnableUserScripts) || |
| 377 prefs->GetBoolean(prefs::kEnableUserScripts); | 379 prefs->GetBoolean(prefs::kEnableUserScripts); |
| 378 bool extensions_enabled = | 380 bool extensions_enabled = |
| 379 command_line->HasSwitch(switches::kEnableExtensions) || | 381 command_line->HasSwitch(switches::kEnableExtensions) || |
| 380 prefs->GetBoolean(prefs::kEnableExtensions); | 382 prefs->GetBoolean(prefs::kEnableExtensions); |
| 381 | 383 |
| 382 FilePath script_dir; | 384 FilePath script_dir; |
| 383 if (user_scripts_enabled) { | 385 if (user_scripts_enabled) { |
| 384 | |
| 385 if (command_line->HasSwitch(switches::kUserScriptsDir)) { | 386 if (command_line->HasSwitch(switches::kUserScriptsDir)) { |
| 386 std::wstring path_string = | 387 std::wstring path_string = |
| 387 command_line->GetSwitchValue(switches::kUserScriptsDir); | 388 command_line->GetSwitchValue(switches::kUserScriptsDir); |
| 388 script_dir = FilePath::FromWStringHack(path_string); | 389 script_dir = FilePath::FromWStringHack(path_string); |
| 389 } else { | 390 } else { |
| 390 script_dir = GetPath(); | 391 script_dir = GetPath(); |
| 391 script_dir = script_dir.Append(chrome::kUserScriptsDirname); | 392 script_dir = script_dir.Append(chrome::kUserScriptsDirname); |
| 392 } | 393 } |
| 393 } | 394 } |
| 394 | 395 |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 | 870 |
| 870 #ifdef CHROME_PERSONALIZATION | 871 #ifdef CHROME_PERSONALIZATION |
| 871 ProfilePersonalization* ProfileImpl::GetProfilePersonalization() { | 872 ProfilePersonalization* ProfileImpl::GetProfilePersonalization() { |
| 872 DCHECK(!Personalization::IsP13NDisabled()); | 873 DCHECK(!Personalization::IsP13NDisabled()); |
| 873 if (!personalization_.get()) | 874 if (!personalization_.get()) |
| 874 personalization_.reset( | 875 personalization_.reset( |
| 875 Personalization::CreateProfilePersonalization(this)); | 876 Personalization::CreateProfilePersonalization(this)); |
| 876 return personalization_.get(); | 877 return personalization_.get(); |
| 877 } | 878 } |
| 878 #endif | 879 #endif |
| OLD | NEW |