| Index: chrome/browser/ui/app_list/app_list_service_impl.cc
|
| diff --git a/chrome/browser/ui/app_list/app_list_service_impl.cc b/chrome/browser/ui/app_list/app_list_service_impl.cc
|
| index 57397697e8fd66d3db61fcb57c1763253a74ae02..67636fce338dbed53b6cd411de20d0f36d21536a 100644
|
| --- a/chrome/browser/ui/app_list/app_list_service_impl.cc
|
| +++ b/chrome/browser/ui/app_list/app_list_service_impl.cc
|
| @@ -206,6 +206,16 @@ void RecordAppListDiscoverability(PrefService* local_state,
|
| AppListService::ENABLE_NUM_ENABLE_SOURCES);
|
| }
|
|
|
| +// Checks whether a profile name is valid for the app list. Returns false if the
|
| +// name is empty, or represents a guest profile.
|
| +bool IsValidProfileName(const std::string& profile_name) {
|
| + if (profile_name.empty())
|
| + return false;
|
| +
|
| + return profile_name !=
|
| + base::FilePath(chrome::kGuestProfileDir).AsUTF8Unsafe();
|
| +}
|
| +
|
| } // namespace
|
|
|
| void AppListServiceImpl::RecordAppListLaunch() {
|
| @@ -291,13 +301,13 @@ base::FilePath AppListServiceImpl::GetProfilePath(
|
|
|
| // If the user has no profile preference for the app launcher, default to the
|
| // last browser profile used.
|
| - if (app_list_profile.empty() &&
|
| + if (!IsValidProfileName(app_list_profile) &&
|
| local_state_->HasPrefPath(prefs::kProfileLastUsed)) {
|
| app_list_profile = local_state_->GetString(prefs::kProfileLastUsed);
|
| }
|
|
|
| // If there is no last used profile recorded, use the initial profile.
|
| - if (app_list_profile.empty())
|
| + if (!IsValidProfileName(app_list_profile))
|
| app_list_profile = chrome::kInitialProfile;
|
|
|
| return user_data_dir.AppendASCII(app_list_profile);
|
|
|