OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/app_list/app_list_service_impl.h" | 5 #include "chrome/browser/ui/app_list/app_list_service_impl.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 return user_data_dir.AppendASCII(profile_path); | 131 return user_data_dir.AppendASCII(profile_path); |
132 } | 132 } |
133 | 133 |
134 AppListControllerDelegate* AppListServiceImpl::CreateControllerDelegate() { | 134 AppListControllerDelegate* AppListServiceImpl::CreateControllerDelegate() { |
135 return NULL; | 135 return NULL; |
136 } | 136 } |
137 | 137 |
138 void AppListServiceImpl::OnSigninStatusChanged() {} | 138 void AppListServiceImpl::OnSigninStatusChanged() {} |
139 | 139 |
140 void AppListServiceImpl::OnProfileAdded(const base::FilePath& profilePath) {} | |
141 | |
142 void AppListServiceImpl::OnProfileWasRemoved( | |
143 const base::FilePath& profile_path, const string16& profile_name) {} | |
144 | |
145 void AppListServiceImpl::OnProfileNameChanged( | |
146 const base::FilePath& profile_path, const string16& profile_name) {} | |
147 | |
148 void AppListServiceImpl::OnProfileAvatarChanged( | |
149 const base::FilePath& profile_path) {} | |
150 | |
151 // We need to watch for profile removal to keep kAppListProfile updated. | 140 // We need to watch for profile removal to keep kAppListProfile updated. |
152 void AppListServiceImpl::OnProfileWillBeRemoved( | 141 void AppListServiceImpl::OnProfileWillBeRemoved( |
153 const base::FilePath& profile_path) { | 142 const base::FilePath& profile_path) { |
154 // If the profile the app list uses just got deleted, reset it to the last | 143 // If the profile the app list uses just got deleted, reset it to the last |
155 // used profile. | 144 // used profile. |
156 PrefService* local_state = g_browser_process->local_state(); | 145 PrefService* local_state = g_browser_process->local_state(); |
157 std::string app_list_last_profile = local_state->GetString( | 146 std::string app_list_last_profile = local_state->GetString( |
158 prefs::kAppListProfile); | 147 prefs::kAppListProfile); |
159 if (profile_path.BaseName().MaybeAsASCII() == app_list_last_profile) { | 148 if (profile_path.BaseName().MaybeAsASCII() == app_list_last_profile) { |
160 local_state->SetString(prefs::kAppListProfile, | 149 local_state->SetString(prefs::kAppListProfile, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 void AppListServiceImpl::InvalidatePendingProfileLoads() { | 189 void AppListServiceImpl::InvalidatePendingProfileLoads() { |
201 profile_loader_.InvalidatePendingProfileLoads(); | 190 profile_loader_.InvalidatePendingProfileLoads(); |
202 } | 191 } |
203 | 192 |
204 void AppListServiceImpl::SaveProfilePathToLocalState( | 193 void AppListServiceImpl::SaveProfilePathToLocalState( |
205 const base::FilePath& profile_file_path) { | 194 const base::FilePath& profile_file_path) { |
206 g_browser_process->local_state()->SetString( | 195 g_browser_process->local_state()->SetString( |
207 prefs::kAppListProfile, | 196 prefs::kAppListProfile, |
208 profile_file_path.BaseName().MaybeAsASCII()); | 197 profile_file_path.BaseName().MaybeAsASCII()); |
209 } | 198 } |
OLD | NEW |