Commit d778d6e8 authored by mirandac@chromium.org's avatar mirandac@chromium.org

Change kNotSignedInProfile to kInitialProfile to better reflect its usage.

Change ProfileManager::GetCurrentProfile to ProfileManager::GetInitialProfile as well.

BUG=none
TEST=no change in profile behavior

Review URL: http://codereview.chromium.org/7619008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96540 0039d316-1c4b-4281-b951-d872f2087c98
parent 9a0c6f58
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -49,5 +49,5 @@ FilePath DiagnosticTest::GetUserDefaultProfileDir() { ...@@ -49,5 +49,5 @@ FilePath DiagnosticTest::GetUserDefaultProfileDir() {
FilePath path; FilePath path;
if (!PathService::Get(chrome::DIR_USER_DATA, &path)) if (!PathService::Get(chrome::DIR_USER_DATA, &path))
return FilePath(); return FilePath();
return path.AppendASCII(chrome::kNotSignedInProfile); return path.AppendASCII(chrome::kInitialProfile);
} }
...@@ -53,7 +53,7 @@ static void GetCookie( ...@@ -53,7 +53,7 @@ static void GetCookie(
const scoped_refptr<base::ThreadTestHelper>& thread_helper) { const scoped_refptr<base::ThreadTestHelper>& thread_helper) {
scoped_refptr<SQLitePersistentCookieStore> cookie_store( scoped_refptr<SQLitePersistentCookieStore> cookie_store(
new SQLitePersistentCookieStore( new SQLitePersistentCookieStore(
user_data_dir.AppendASCII(chrome::kNotSignedInProfile) user_data_dir.AppendASCII(chrome::kInitialProfile)
.Append(chrome::kCookieFilename))); .Append(chrome::kCookieFilename)));
HERE(1); HERE(1);
std::vector<net::CookieMonster::CanonicalCookie*> cookies; std::vector<net::CookieMonster::CanonicalCookie*> cookies;
......
...@@ -129,7 +129,7 @@ FilePath ProfileManager::GetDefaultProfileDir( ...@@ -129,7 +129,7 @@ FilePath ProfileManager::GetDefaultProfileDir(
const FilePath& user_data_dir) { const FilePath& user_data_dir) {
FilePath default_profile_dir(user_data_dir); FilePath default_profile_dir(user_data_dir);
default_profile_dir = default_profile_dir =
default_profile_dir.AppendASCII(chrome::kNotSignedInProfile); default_profile_dir.AppendASCII(chrome::kInitialProfile);
return default_profile_dir; return default_profile_dir;
} }
...@@ -140,7 +140,7 @@ FilePath ProfileManager::GetProfilePrefsPath( ...@@ -140,7 +140,7 @@ FilePath ProfileManager::GetProfilePrefsPath(
return default_prefs_path; return default_prefs_path;
} }
FilePath ProfileManager::GetCurrentProfileDir() { FilePath ProfileManager::GetInitialProfileDir() {
FilePath relative_profile_dir; FilePath relative_profile_dir;
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); const CommandLine& command_line = *CommandLine::ForCurrentProcess();
...@@ -160,7 +160,7 @@ FilePath ProfileManager::GetCurrentProfileDir() { ...@@ -160,7 +160,7 @@ FilePath ProfileManager::GetCurrentProfileDir() {
#endif #endif
// TODO(mirandac): should not automatically be default profile. // TODO(mirandac): should not automatically be default profile.
relative_profile_dir = relative_profile_dir =
relative_profile_dir.AppendASCII(chrome::kNotSignedInProfile); relative_profile_dir.AppendASCII(chrome::kInitialProfile);
return relative_profile_dir; return relative_profile_dir;
} }
...@@ -173,7 +173,7 @@ Profile* ProfileManager::GetLastUsedProfile(const FilePath& user_data_dir) { ...@@ -173,7 +173,7 @@ Profile* ProfileManager::GetLastUsedProfile(const FilePath& user_data_dir) {
if (local_state->HasPrefPath(prefs::kProfileLastUsed)) if (local_state->HasPrefPath(prefs::kProfileLastUsed))
last_profile_used = local_state->GetString(prefs::kProfileLastUsed); last_profile_used = local_state->GetString(prefs::kProfileLastUsed);
last_used_profile_dir = last_profile_used.empty() ? last_used_profile_dir = last_profile_used.empty() ?
last_used_profile_dir.AppendASCII(chrome::kNotSignedInProfile) : last_used_profile_dir.AppendASCII(chrome::kInitialProfile) :
last_used_profile_dir.AppendASCII(last_profile_used); last_used_profile_dir.AppendASCII(last_profile_used);
return GetProfile(last_used_profile_dir); return GetProfile(last_used_profile_dir);
} }
...@@ -192,7 +192,7 @@ void ProfileManager::RegisterProfileName(Profile* profile) { ...@@ -192,7 +192,7 @@ void ProfileManager::RegisterProfileName(Profile* profile) {
Profile* ProfileManager::GetDefaultProfile(const FilePath& user_data_dir) { Profile* ProfileManager::GetDefaultProfile(const FilePath& user_data_dir) {
FilePath default_profile_dir(user_data_dir); FilePath default_profile_dir(user_data_dir);
default_profile_dir = default_profile_dir.Append(GetCurrentProfileDir()); default_profile_dir = default_profile_dir.Append(GetInitialProfileDir());
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
if (!logged_in_) { if (!logged_in_) {
Profile* profile; Profile* profile;
...@@ -293,7 +293,7 @@ void ProfileManager::CreateDefaultProfileAsync( ...@@ -293,7 +293,7 @@ void ProfileManager::CreateDefaultProfileAsync(
PathService::Get(chrome::DIR_USER_DATA, &default_profile_dir); PathService::Get(chrome::DIR_USER_DATA, &default_profile_dir);
// TODO(mirandac): current directory will not always be default in the future // TODO(mirandac): current directory will not always be default in the future
default_profile_dir = default_profile_dir.Append( default_profile_dir = default_profile_dir.Append(
profile_manager->GetCurrentProfileDir()); profile_manager->GetInitialProfileDir());
profile_manager->CreateProfileAsync(default_profile_dir, profile_manager->CreateProfileAsync(default_profile_dir,
observer); observer);
......
...@@ -98,9 +98,9 @@ class ProfileManager : public base::NonThreadSafe, ...@@ -98,9 +98,9 @@ class ProfileManager : public base::NonThreadSafe,
// profile. // profile.
bool IsValidProfile(Profile* profile); bool IsValidProfile(Profile* profile);
// Returns the directory where the currently active profile is // Returns the directory where the first created profile is stored,
// stored, relative to the user data directory currently in use.. // relative to the user data directory currently in use..
FilePath GetCurrentProfileDir(); FilePath GetInitialProfileDir();
// Get the Profile last used with this Chrome build. If no signed profile has // Get the Profile last used with this Chrome build. If no signed profile has
// been stored in Local State, hand back the Default profile. // been stored in Local State, hand back the Default profile.
......
...@@ -105,9 +105,9 @@ TEST_F(ProfileManagerTest, DefaultProfileDir) { ...@@ -105,9 +105,9 @@ TEST_F(ProfileManagerTest, DefaultProfileDir) {
cl->AppendSwitch(switches::kTestType); cl->AppendSwitch(switches::kTestType);
FilePath expected_default = FilePath expected_default =
FilePath().AppendASCII(chrome::kNotSignedInProfile); FilePath().AppendASCII(chrome::kInitialProfile);
EXPECT_EQ(expected_default.value(), EXPECT_EQ(expected_default.value(),
profile_manager_->GetCurrentProfileDir().value()); profile_manager_->GetInitialProfileDir().value());
} }
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
...@@ -120,18 +120,18 @@ TEST_F(ProfileManagerTest, LoggedInProfileDir) { ...@@ -120,18 +120,18 @@ TEST_F(ProfileManagerTest, LoggedInProfileDir) {
cl->AppendSwitch(switches::kTestType); cl->AppendSwitch(switches::kTestType);
FilePath expected_default = FilePath expected_default =
FilePath().AppendASCII(chrome::kNotSignedInProfile); FilePath().AppendASCII(chrome::kInitialProfile);
EXPECT_EQ(expected_default.value(), EXPECT_EQ(expected_default.value(),
profile_manager_->GetCurrentProfileDir().value()); profile_manager_->GetInitialProfileDir().value());
profile_manager_->Observe(chrome::NOTIFICATION_LOGIN_USER_CHANGED, profile_manager_->Observe(chrome::NOTIFICATION_LOGIN_USER_CHANGED,
NotificationService::AllSources(), NotificationService::AllSources(),
NotificationService::NoDetails()); NotificationService::NoDetails());
FilePath expected_logged_in(profile_dir); FilePath expected_logged_in(profile_dir);
EXPECT_EQ(expected_logged_in.value(), EXPECT_EQ(expected_logged_in.value(),
profile_manager_->GetCurrentProfileDir().value()); profile_manager_->GetInitialProfileDir().value());
VLOG(1) << temp_dir_.path().Append( VLOG(1) << temp_dir_.path().Append(
profile_manager_->GetCurrentProfileDir()).value(); profile_manager_->GetInitialProfileDir()).value();
} }
#endif #endif
......
...@@ -342,7 +342,7 @@ TEST(ShellIntegrationTest, GetChromiumAppIdTest) { ...@@ -342,7 +342,7 @@ TEST(ShellIntegrationTest, GetChromiumAppIdTest) {
FilePath default_user_data_dir; FilePath default_user_data_dir;
chrome::GetDefaultUserDataDirectory(&default_user_data_dir); chrome::GetDefaultUserDataDirectory(&default_user_data_dir);
FilePath default_profile_path = FilePath default_profile_path =
default_user_data_dir.AppendASCII(chrome::kNotSignedInProfile); default_user_data_dir.AppendASCII(chrome::kInitialProfile);
EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId(), EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId(),
ShellIntegration::GetChromiumAppId(default_profile_path)); ShellIntegration::GetChromiumAppId(default_profile_path));
......
...@@ -50,7 +50,7 @@ std::wstring GetProfileIdFromPath(const FilePath& profile_path) { ...@@ -50,7 +50,7 @@ std::wstring GetProfileIdFromPath(const FilePath& profile_path) {
if (chrome::GetDefaultUserDataDirectory(&default_user_data_dir) && if (chrome::GetDefaultUserDataDirectory(&default_user_data_dir) &&
profile_path.DirName() == default_user_data_dir && profile_path.DirName() == default_user_data_dir &&
profile_path.BaseName().value() == profile_path.BaseName().value() ==
ASCIIToUTF16(chrome::kNotSignedInProfile)) { ASCIIToUTF16(chrome::kInitialProfile)) {
return std::wstring(); return std::wstring();
} }
...@@ -223,7 +223,7 @@ bool MigrateChromiumShortcutsTask::GetExpectedAppId( ...@@ -223,7 +223,7 @@ bool MigrateChromiumShortcutsTask::GetExpectedAppId(
if (command_line.HasSwitch(switches::kUserDataDir)) { if (command_line.HasSwitch(switches::kUserDataDir)) {
profile_path = profile_path =
command_line.GetSwitchValuePath(switches::kUserDataDir).AppendASCII( command_line.GetSwitchValuePath(switches::kUserDataDir).AppendASCII(
chrome::kNotSignedInProfile); chrome::kInitialProfile);
} }
std::wstring app_name; std::wstring app_name;
......
...@@ -111,7 +111,7 @@ const wchar_t kStatusTrayWindowClass[] = L"Chrome_StatusTrayWindow"; ...@@ -111,7 +111,7 @@ const wchar_t kStatusTrayWindowClass[] = L"Chrome_StatusTrayWindow";
const wchar_t kMessageWindowClass[] = L"Chrome_MessageWindow"; const wchar_t kMessageWindowClass[] = L"Chrome_MessageWindow";
const wchar_t kCrashReportLog[] = L"Reported Crashes.txt"; const wchar_t kCrashReportLog[] = L"Reported Crashes.txt";
const wchar_t kTestingInterfaceDLL[] = L"testing_interface.dll"; const wchar_t kTestingInterfaceDLL[] = L"testing_interface.dll";
const char kNotSignedInProfile[] = "Default"; const char kInitialProfile[] = "Default";
const char kMultiProfileDirPrefix[] = "profile_"; const char kMultiProfileDirPrefix[] = "profile_";
const wchar_t kBrowserResourcesDll[] = L"chrome.dll"; const wchar_t kBrowserResourcesDll[] = L"chrome.dll";
const FilePath::CharType kExtensionFileExtension[] = FPL(".crx"); const FilePath::CharType kExtensionFileExtension[] = FPL(".crx");
......
...@@ -34,7 +34,7 @@ extern const wchar_t kStatusTrayWindowClass[]; ...@@ -34,7 +34,7 @@ extern const wchar_t kStatusTrayWindowClass[];
extern const wchar_t kMessageWindowClass[]; extern const wchar_t kMessageWindowClass[];
extern const wchar_t kCrashReportLog[]; extern const wchar_t kCrashReportLog[];
extern const wchar_t kTestingInterfaceDLL[]; extern const wchar_t kTestingInterfaceDLL[];
extern const char kNotSignedInProfile[]; extern const char kInitialProfile[];
extern const char kMultiProfileDirPrefix[]; extern const char kMultiProfileDirPrefix[];
extern const char kStatsFilename[]; extern const char kStatsFilename[];
extern const wchar_t kBrowserResourcesDll[]; extern const wchar_t kBrowserResourcesDll[];
......
...@@ -572,7 +572,7 @@ DictionaryValue* UITest::GetLocalState() { ...@@ -572,7 +572,7 @@ DictionaryValue* UITest::GetLocalState() {
DictionaryValue* UITest::GetDefaultProfilePreferences() { DictionaryValue* UITest::GetDefaultProfilePreferences() {
FilePath path; FilePath path;
PathService::Get(chrome::DIR_USER_DATA, &path); PathService::Get(chrome::DIR_USER_DATA, &path);
path = path.AppendASCII(chrome::kNotSignedInProfile); path = path.AppendASCII(chrome::kInitialProfile);
return LoadDictionaryValueFromPath(path.Append(chrome::kPreferencesFilename)); return LoadDictionaryValueFromPath(path.Append(chrome::kPreferencesFilename));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment