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_impl.h" | 5 #include "chrome/browser/profiles/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/environment.h" | 10 #include "base/environment.h" |
(...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 | 1593 |
1594 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { | 1594 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { |
1595 if (!spellcheck_profile_.get()) | 1595 if (!spellcheck_profile_.get()) |
1596 spellcheck_profile_.reset(new SpellCheckProfile(path_)); | 1596 spellcheck_profile_.reset(new SpellCheckProfile(path_)); |
1597 return spellcheck_profile_.get(); | 1597 return spellcheck_profile_.get(); |
1598 } | 1598 } |
1599 | 1599 |
1600 void ProfileImpl::UpdateProfileUserNameCache() { | 1600 void ProfileImpl::UpdateProfileUserNameCache() { |
1601 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 1601 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
1602 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); | 1602 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
1603 size_t index = cache.GetIndexOfProfileWithPath(GetPath()); | 1603 ProfileInfoEntry entry; |
1604 if (index != std::string::npos) { | 1604 if (cache.GetInfoForProfile(GetPath(), &entry)) { |
1605 std::string user_name = | 1605 string16 user_name = |
1606 GetPrefs()->GetString(prefs::kGoogleServicesUsername); | 1606 UTF8ToUTF16(GetPrefs()->GetString(prefs::kGoogleServicesUsername)); |
1607 cache.SetUserNameOfProfileAtIndex(index, UTF8ToUTF16(user_name)); | 1607 entry.set_user_name(user_name); |
| 1608 cache.SetInfoForProfile(entry); |
1608 } | 1609 } |
1609 } | 1610 } |
OLD | NEW |