Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Unified Diff: chrome/browser/ui/app_list/app_list_service_mac.mm

Issue 1631373003: Refactor ProfileInfoCache in c/b/ui/app_list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to std::cref Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/app_list_service_mac.mm
diff --git a/chrome/browser/ui/app_list/app_list_service_mac.mm b/chrome/browser/ui/app_list/app_list_service_mac.mm
index 03a81b15c4c50f5654cb407553db5ef90312ed67..a25a88f9d26cd2dff9d83041bd8641fa61b5fe9c 100644
--- a/chrome/browser/ui/app_list/app_list_service_mac.mm
+++ b/chrome/browser/ui/app_list/app_list_service_mac.mm
@@ -20,7 +20,8 @@
#import "chrome/browser/app_controller_mac.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/profiles/profile_info_cache.h"
+#include "chrome/browser/profiles/profile_attributes_entry.h"
+#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/app_list/app_list_positioner.h"
#include "chrome/browser/ui/app_list/app_list_service.h"
@@ -388,13 +389,11 @@ void AppListServiceMac::InitWithProfilePath(
// Do not show the launcher window when the profile is locked, or if it
// can't be displayed unpopulated. In the latter case, the Show will occur
// in OnShimLaunch() or AppListService::HandleLaunchCommandLine().
- const ProfileInfoCache& profile_info_cache =
- g_browser_process->profile_manager()->GetProfileInfoCache();
- size_t profile_index = profile_info_cache.
- GetIndexOfProfileWithPath(profile_path);
- if (profile_index != std::string::npos &&
- !profile_info_cache.ProfileIsSigninRequiredAtIndex(profile_index) &&
- ReadyToShow())
+ ProfileAttributesEntry* entry = nullptr;
+ bool has_entry = g_browser_process->profile_manager()->
+ GetProfileAttributesStorage().
+ GetProfileAttributesWithPath(profile_path, &entry);
+ if (has_entry && !entry->IsSigninRequired() && ReadyToShow())
ShowWindowNearDock();
}
}

Powered by Google App Engine
This is Rietveld 408576698