summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlwchkg <lwchkg@gmail.com>2016-03-12 22:29:54 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-13 06:30:58 +0000
commit9c18394adda7145297537795714906a3354e1529 (patch)
tree0f2683eb8a274bd55b8e0cc4ae2676e0402e47c2
parent202db51d82dbbade9baa3e69a9062e73a18b22e7 (diff)
downloadchromium_src-9c18394adda7145297537795714906a3354e1529.zip
chromium_src-9c18394adda7145297537795714906a3354e1529.tar.gz
chromium_src-9c18394adda7145297537795714906a3354e1529.tar.bz2
Refactor ProfileInfoCache in most of chrome/browser
ProfileInfoCache is being refactored into ProfileAttributesStorage and ProfileAttributesEntry, which use profile paths instead of numerical indices in the interface. See https://crrev.com/94dacdb8289038b7fa68c9f2bd57d5311b2cb5cb for details. This CL does not include files in chrome/browser/profiles BUG=305720 Review URL: https://codereview.chromium.org/1768813002 Cr-Commit-Position: refs/heads/master@{#380892}
-rw-r--r--chrome/browser/app_controller_mac.h4
-rw-r--r--chrome/browser/app_controller_mac.mm26
-rw-r--r--chrome/browser/app_controller_mac_browsertest.mm11
-rw-r--r--chrome/browser/apps/shortcut_manager.cc6
-rw-r--r--chrome/browser/apps/shortcut_manager.h2
-rw-r--r--chrome/browser/browser_process_impl.cc12
-rw-r--r--chrome/browser/chrome_browser_main.cc13
-rw-r--r--chrome/browser/chrome_browser_main_win.cc1
-rw-r--r--chrome/browser/lifetime/browser_close_manager_browsertest.cc7
-rw-r--r--chrome/browser/media/webrtc_log_util.cc15
-rw-r--r--chrome/browser/notifications/message_center_settings_controller.cc1
-rw-r--r--chrome/browser/notifications/message_center_settings_controller_unittest.cc3
-rw-r--r--chrome/browser/task_manager/renderer_resource.cc2
-rw-r--r--chrome/browser/task_manager/task_manager_util.cc21
-rw-r--r--chrome/browser/task_manager/task_manager_util.h4
-rw-r--r--chrome/browser/ui/webui/signin/signin_create_profile_handler.cc18
16 files changed, 75 insertions, 71 deletions
diff --git a/chrome/browser/app_controller_mac.h b/chrome/browser/app_controller_mac.h
index 432e120..850b270 100644
--- a/chrome/browser/app_controller_mac.h
+++ b/chrome/browser/app_controller_mac.h
@@ -49,9 +49,9 @@ class WorkAreaWatcherObserver;
// build the user-data specific main menu items.
Profile* lastProfile_;
- // The ProfileObserver observes the ProfileInfoCache and gets notified
+ // The ProfileObserver observes the ProfileAttrbutesStorage and gets notified
// when a profile has been deleted.
- scoped_ptr<AppControllerProfileObserver> profileInfoCacheObserver_;
+ scoped_ptr<AppControllerProfileObserver> profileAttributesStorageObserver_;
// Management of the bookmark menu which spans across all windows
// (and Browser*s). |profileBookmarkMenuBridgeMap_| is a cache that owns one
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 819b204..0acf13e 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -38,7 +38,8 @@
#include "chrome/browser/lifetime/scoped_keep_alive.h"
#include "chrome/browser/mac/mac_startup_profiler.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
-#include "chrome/browser/profiles/profile_info_cache_observer.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/profiles/profiles_state.h"
#include "chrome/browser/sessions/session_restore.h"
@@ -201,12 +202,11 @@ bool IsProfileSignedOut(Profile* profile) {
// --new-profile-management flag.
if (!switches::IsNewProfileManagement())
return false;
- ProfileInfoCache& cache =
- g_browser_process->profile_manager()->GetProfileInfoCache();
- size_t profile_index = cache.GetIndexOfProfileWithPath(profile->GetPath());
- if (profile_index == std::string::npos)
- return false;
- return cache.ProfileIsSigninRequiredAtIndex(profile_index);
+ ProfileAttributesEntry* entry;
+ bool has_entry =
+ g_browser_process->profile_manager()->GetProfileAttributesStorage().
+ GetProfileAttributesWithPath(profile->GetPath(), &entry);
+ return has_entry && entry->IsSigninRequired();
}
} // namespace
@@ -260,7 +260,7 @@ bool IsProfileSignedOut(Profile* profile) {
- (GURL)handoffURLFromWebContents:(content::WebContents*)webContents;
@end
-class AppControllerProfileObserver : public ProfileInfoCacheObserver {
+class AppControllerProfileObserver : public ProfileAttributesStorage::Observer {
public:
AppControllerProfileObserver(
ProfileManager* profile_manager, AppController* app_controller)
@@ -268,16 +268,16 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
app_controller_(app_controller) {
DCHECK(profile_manager_);
DCHECK(app_controller_);
- profile_manager_->GetProfileInfoCache().AddObserver(this);
+ profile_manager_->GetProfileAttributesStorage().AddObserver(this);
}
~AppControllerProfileObserver() override {
DCHECK(profile_manager_);
- profile_manager_->GetProfileInfoCache().RemoveObserver(this);
+ profile_manager_->GetProfileAttributesStorage().RemoveObserver(this);
}
private:
- // ProfileInfoCacheObserver implementation:
+ // ProfileAttributesStorage::Observer implementation:
void OnProfileAdded(const base::FilePath& profile_path) override {}
@@ -756,9 +756,9 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
EncodingMenuControllerDelegate::BuildEncodingMenu([self lastProfile],
encodingMenu);
- // Instantiate the ProfileInfoCache observer so that we can get
+ // Instantiate the ProfileAttributesStorage observer so that we can get
// notified when a profile is deleted.
- profileInfoCacheObserver_.reset(new AppControllerProfileObserver(
+ profileAttributesStorageObserver_.reset(new AppControllerProfileObserver(
g_browser_process->profile_manager(), self));
// Since Chrome is localized to more languages than the OS, tell Cocoa which
diff --git a/chrome/browser/app_controller_mac_browsertest.mm b/chrome/browser/app_controller_mac_browsertest.mm
index 7e1b3b5..1616175 100644
--- a/chrome/browser/app_controller_mac_browsertest.mm
+++ b/chrome/browser/app_controller_mac_browsertest.mm
@@ -261,11 +261,12 @@ IN_PROC_BROWSER_TEST_F(AppControllerNewProfileManagementBrowserTest,
// Lock the active profile.
Profile* profile = [ac lastProfile];
- ProfileInfoCache& cache =
- g_browser_process->profile_manager()->GetProfileInfoCache();
- size_t profile_index = cache.GetIndexOfProfileWithPath(profile->GetPath());
- cache.SetProfileSigninRequiredAtIndex(profile_index, true);
- EXPECT_TRUE(cache.ProfileIsSigninRequiredAtIndex(profile_index));
+ ProfileAttributesEntry* entry;
+ ASSERT_TRUE(g_browser_process->profile_manager()->
+ GetProfileAttributesStorage().
+ GetProfileAttributesWithPath(profile->GetPath(), &entry));
+ entry->SetIsSigninRequired(true);
+ EXPECT_TRUE(entry->IsSigninRequired());
EXPECT_EQ(1u, active_browser_list_->size());
BOOL result = [ac applicationShouldHandleReopen:NSApp hasVisibleWindows:NO];
diff --git a/chrome/browser/apps/shortcut_manager.cc b/chrome/browser/apps/shortcut_manager.cc
index bb4e1ca..91f2330 100644
--- a/chrome/browser/apps/shortcut_manager.cc
+++ b/chrome/browser/apps/shortcut_manager.cc
@@ -70,7 +70,7 @@ void AppShortcutManager::RegisterProfilePrefs(
AppShortcutManager::AppShortcutManager(Profile* profile)
: profile_(profile),
- is_profile_info_cache_observer_(false),
+ is_profile_attributes_storage_observer_(false),
prefs_(profile->GetPrefs()),
extension_registry_observer_(this),
weak_ptr_factory_(this) {
@@ -93,12 +93,12 @@ AppShortcutManager::AppShortcutManager(Profile* profile)
// profile_manager might be NULL in testing environments.
if (profile_manager) {
profile_manager->GetProfileAttributesStorage().AddObserver(this);
- is_profile_info_cache_observer_ = true;
+ is_profile_attributes_storage_observer_ = true;
}
}
AppShortcutManager::~AppShortcutManager() {
- if (g_browser_process && is_profile_info_cache_observer_) {
+ if (g_browser_process && is_profile_attributes_storage_observer_) {
ProfileManager* profile_manager = g_browser_process->profile_manager();
// profile_manager might be NULL in testing environments or during shutdown.
if (profile_manager)
diff --git a/chrome/browser/apps/shortcut_manager.h b/chrome/browser/apps/shortcut_manager.h
index 561f5ea..11c2688e 100644
--- a/chrome/browser/apps/shortcut_manager.h
+++ b/chrome/browser/apps/shortcut_manager.h
@@ -55,7 +55,7 @@ class AppShortcutManager : public KeyedService,
void DeleteApplicationShortcuts(const extensions::Extension* extension);
Profile* profile_;
- bool is_profile_info_cache_observer_;
+ bool is_profile_attributes_storage_observer_;
PrefService* prefs_;
ScopedObserver<extensions::ExtensionRegistry,
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index d5d441a..5507acd 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -282,8 +282,8 @@ void BrowserProcessImpl::StartTearDown() {
// those things during teardown.
notification_ui_manager_.reset();
- // The SupervisedUserWhitelistInstaller observes the ProfileInfoCache, so it
- // needs to be shut down before the ProfileManager.
+ // The SupervisedUserWhitelistInstaller observes the ProfileAttributesStorage,
+ // so it needs to be shut down before the ProfileManager.
supervised_user_whitelist_installer_.reset();
#if !defined(OS_ANDROID)
@@ -973,7 +973,8 @@ BrowserProcessImpl::supervised_user_whitelist_installer() {
if (!supervised_user_whitelist_installer_) {
supervised_user_whitelist_installer_ =
component_updater::SupervisedUserWhitelistInstaller::Create(
- component_updater(), &profile_manager()->GetProfileInfoCache(),
+ component_updater(),
+ &profile_manager()->GetProfileAttributesStorage(),
local_state());
}
return supervised_user_whitelist_installer_.get();
@@ -1143,8 +1144,9 @@ void BrowserProcessImpl::CreateBackgroundModeManager() {
#if BUILDFLAG(ENABLE_BACKGROUND)
DCHECK(background_mode_manager_.get() == NULL);
background_mode_manager_.reset(
- new BackgroundModeManager(*base::CommandLine::ForCurrentProcess(),
- &profile_manager()->GetProfileInfoCache()));
+ new BackgroundModeManager(
+ *base::CommandLine::ForCurrentProcess(),
+ &profile_manager()->GetProfileAttributesStorage()));
#endif
}
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 7a59f02..2c58ed6 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -74,6 +74,8 @@
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h"
#include "chrome/browser/process_singleton.h"
#include "chrome/browser/profiles/profile.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/profiles/profiles_state.h"
#include "chrome/browser/shell_integration.h"
@@ -401,12 +403,11 @@ Profile* CreatePrimaryProfile(const content::MainFunctionParams& parameters,
if (switches::IsNewProfileManagement() &&
profile &&
!profile->IsGuestSession()) {
- ProfileInfoCache& cache =
- g_browser_process->profile_manager()->GetProfileInfoCache();
- size_t profile_index = cache.GetIndexOfProfileWithPath(profile_path);
-
- if (profile_index != std::string::npos &&
- cache.ProfileIsSigninRequiredAtIndex(profile_index)) {
+ ProfileAttributesEntry* entry;
+ bool has_entry = g_browser_process->profile_manager()->
+ GetProfileAttributesStorage().
+ GetProfileAttributesWithPath(profile_path, &entry);
+ if (has_entry && entry->IsSigninRequired()) {
profile = g_browser_process->profile_manager()->GetProfile(
ProfileManager::GetGuestProfilePath());
}
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc
index 4a9bbd5..3273de1e 100644
--- a/chrome/browser/chrome_browser_main_win.cc
+++ b/chrome/browser/chrome_browser_main_win.cc
@@ -33,7 +33,6 @@
#include "chrome/browser/chrome_elf_init_win.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/install_verification/win/install_verification.h"
-#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_shortcut_manager.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/ui/simple_message_box.h"
diff --git a/chrome/browser/lifetime/browser_close_manager_browsertest.cc b/chrome/browser/lifetime/browser_close_manager_browsertest.cc
index 53bcbb9..a1aeac6 100644
--- a/chrome/browser/lifetime/browser_close_manager_browsertest.cc
+++ b/chrome/browser/lifetime/browser_close_manager_browsertest.cc
@@ -184,9 +184,9 @@ class TestDownloadManagerDelegate : public ChromeDownloadManagerDelegate {
class FakeBackgroundModeManager : public BackgroundModeManager {
public:
FakeBackgroundModeManager()
- : BackgroundModeManager(
- *base::CommandLine::ForCurrentProcess(),
- &g_browser_process->profile_manager()->GetProfileInfoCache()),
+ : BackgroundModeManager(*base::CommandLine::ForCurrentProcess(),
+ &g_browser_process->profile_manager()
+ ->GetProfileAttributesStorage()),
suspended_(false) {}
void SuspendBackgroundMode() override {
@@ -1000,7 +1000,6 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithBackgroundModeBrowserTest,
EXPECT_TRUE(browser_shutdown::IsTryingToQuit());
EXPECT_TRUE(BrowserList::GetInstance()->empty());
EXPECT_FALSE(IsBackgroundModeSuspended());
-
}
// Check that closing the last browser window individually does not affect
diff --git a/chrome/browser/media/webrtc_log_util.cc b/chrome/browser/media/webrtc_log_util.cc
index caae2a4..e8714a7 100644
--- a/chrome/browser/media/webrtc_log_util.cc
+++ b/chrome/browser/media/webrtc_log_util.cc
@@ -6,6 +6,9 @@
#include <stddef.h>
+#include <string>
+#include <vector>
+
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/logging.h"
@@ -14,6 +17,8 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/media/webrtc_log_list.h"
#include "chrome/browser/profiles/profile.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 "content/public/browser/browser_thread.h"
@@ -107,15 +112,15 @@ void WebRtcLogUtil::DeleteOldAndRecentWebRtcLogFiles(
void WebRtcLogUtil::DeleteOldWebRtcLogFilesForAllProfiles() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- ProfileInfoCache& profile_cache =
- g_browser_process->profile_manager()->GetProfileInfoCache();
- size_t profiles_count = profile_cache.GetNumberOfProfiles();
- for (size_t i = 0; i < profiles_count; ++i) {
+ std::vector<ProfileAttributesEntry*> entries =
+ g_browser_process->profile_manager()->GetProfileAttributesStorage().
+ GetAllProfilesAttributes();
+ for (ProfileAttributesEntry* entry : entries) {
content::BrowserThread::PostTask(
content::BrowserThread::FILE,
FROM_HERE,
base::Bind(&DeleteOldWebRtcLogFiles,
WebRtcLogList::GetWebRtcLogDirectoryForProfile(
- profile_cache.GetPathOfProfileAtIndex(i))));
+ entry->GetPath())));
}
}
diff --git a/chrome/browser/notifications/message_center_settings_controller.cc b/chrome/browser/notifications/message_center_settings_controller.cc
index 6459b29..e16109e 100644
--- a/chrome/browser/notifications/message_center_settings_controller.cc
+++ b/chrome/browser/notifications/message_center_settings_controller.cc
@@ -25,7 +25,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_attributes_entry.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
-#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/extensions/api/notifications.h"
#include "chrome/common/extensions/extension_constants.h"
diff --git a/chrome/browser/notifications/message_center_settings_controller_unittest.cc b/chrome/browser/notifications/message_center_settings_controller_unittest.cc
index a89a2a7..770b31c 100644
--- a/chrome/browser/notifications/message_center_settings_controller_unittest.cc
+++ b/chrome/browser/notifications/message_center_settings_controller_unittest.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/extensions/test_extension_system.h"
#include "chrome/browser/notifications/desktop_notification_profile_util.h"
#include "chrome/browser/notifications/message_center_settings_controller.h"
-#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile_manager.h"
@@ -167,7 +166,7 @@ TEST_F(MessageCenterSettingsControllerChromeOSTest, NotifierGroups) {
base::UTF8ToUTF16("Profile-1"));
}
// TODO(mukai): write a test case to reproduce the actual guest session scenario
-// in ChromeOS -- no profiles in the profile_info_cache.
+// in ChromeOS -- no profiles in |profile_attributes_storage_|.
#endif // !defined(OS_CHROMEOS)
TEST_F(MessageCenterSettingsControllerTest, NotifierSortOrder) {
diff --git a/chrome/browser/task_manager/renderer_resource.cc b/chrome/browser/task_manager/renderer_resource.cc
index 9914b3d..1100e11 100644
--- a/chrome/browser/task_manager/renderer_resource.cc
+++ b/chrome/browser/task_manager/renderer_resource.cc
@@ -52,7 +52,7 @@ size_t RendererResource::GetV8MemoryUsed() const {
}
base::string16 RendererResource::GetProfileName() const {
- return util::GetProfileNameFromInfoCache(Profile::FromBrowserContext(
+ return util::GetProfileNameFromAttributesStorage(Profile::FromBrowserContext(
render_view_host_->GetProcess()->GetBrowserContext()));
}
diff --git a/chrome/browser/task_manager/task_manager_util.cc b/chrome/browser/task_manager/task_manager_util.cc
index 95c5630..955cd5d 100644
--- a/chrome/browser/task_manager/task_manager_util.cc
+++ b/chrome/browser/task_manager/task_manager_util.cc
@@ -11,7 +11,8 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.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/grit/generated_resources.h"
#include "content/public/browser/web_contents.h"
@@ -45,17 +46,15 @@ int GetMessagePrefixID(bool is_app,
return IDS_TASK_MANAGER_TAB_PREFIX;
}
-base::string16 GetProfileNameFromInfoCache(Profile* profile) {
- DCHECK(profile);
+base::string16 GetProfileNameFromAttributesStorage(Profile* profile) {
+ DCHECK(g_browser_process->profile_manager()->IsValidProfile(profile));
- ProfileInfoCache& cache =
- g_browser_process->profile_manager()->GetProfileInfoCache();
- size_t index = cache.GetIndexOfProfileWithPath(
- profile->GetOriginalProfile()->GetPath());
- if (index == std::string::npos)
- return base::string16();
- else
- return cache.GetNameOfProfileAtIndex(index);
+ ProfileAttributesEntry* entry;
+ bool has_entry = g_browser_process->profile_manager()->
+ GetProfileAttributesStorage().
+ GetProfileAttributesWithPath(
+ profile->GetOriginalProfile()->GetPath(), &entry);
+ return has_entry ? entry->GetName() : base::string16();
}
base::string16 GetTitleFromWebContents(content::WebContents* web_contents) {
diff --git a/chrome/browser/task_manager/task_manager_util.h b/chrome/browser/task_manager/task_manager_util.h
index 7a9c611..c9d2c04 100644
--- a/chrome/browser/task_manager/task_manager_util.h
+++ b/chrome/browser/task_manager/task_manager_util.h
@@ -25,8 +25,8 @@ int GetMessagePrefixID(bool is_app,
bool is_prerender,
bool is_background);
-// Returns the name of profile from InfoCache.
-base::string16 GetProfileNameFromInfoCache(Profile* profile);
+// Returns the name of profile from ProfileAttributesStorage.
+base::string16 GetProfileNameFromAttributesStorage(Profile* profile);
// Returns the title from web contents.
base::string16 GetTitleFromWebContents(content::WebContents* web_contents);
diff --git a/chrome/browser/ui/webui/signin/signin_create_profile_handler.cc b/chrome/browser/ui/webui/signin/signin_create_profile_handler.cc
index 7509b10..531399c 100644
--- a/chrome/browser/ui/webui/signin/signin_create_profile_handler.cc
+++ b/chrome/browser/ui/webui/signin/signin_create_profile_handler.cc
@@ -18,6 +18,8 @@
#include "base/value_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/profiles/profile_attributes_entry.h"
+#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_metrics.h"
@@ -131,11 +133,10 @@ void SigninCreateProfileHandler::RequestDefaultProfileIcons(
void SigninCreateProfileHandler::RequestSignedInProfiles(
const base::ListValue* args) {
base::ListValue user_info_list;
- ProfileInfoCache& cache =
- g_browser_process->profile_manager()->GetProfileInfoCache();
std::vector<ProfileAttributesEntry*> entries =
- cache.GetAllProfilesAttributes();
- for (auto& entry : entries) {
+ g_browser_process->profile_manager()->
+ GetProfileAttributesStorage().GetAllProfilesAttributesSortedByName();
+ for (ProfileAttributesEntry* entry : entries) {
base::string16 username = entry->GetUserName();
if (username.empty())
continue;
@@ -144,7 +145,7 @@ void SigninCreateProfileHandler::RequestSignedInProfiles(
user_info->SetString("username", username);
user_info->SetString("profilePath", profile_path);
- user_info_list.Append(user_info.release());
+ user_info_list.Append(std::move(user_info));
}
web_ui()->CallJavascriptFunction("cr.webUIListenerCallback",
base::StringValue("signedin-users-received"),
@@ -505,11 +506,10 @@ void SigninCreateProfileHandler::DoCreateProfileIfPossible(
return;
// Check if this supervised user already exists on this machine.
- ProfileInfoCache& cache =
- g_browser_process->profile_manager()->GetProfileInfoCache();
std::vector<ProfileAttributesEntry*> entries =
- cache.GetAllProfilesAttributes();
- for (auto& entry : entries) {
+ g_browser_process->profile_manager()->
+ GetProfileAttributesStorage().GetAllProfilesAttributes();
+ for (ProfileAttributesEntry* entry : entries) {
if (supervised_user_id == entry->GetSupervisedUserId()) {
// TODO(mahmadi): see whether we need a more specific error message here.
ShowProfileCreationError(nullptr, GetProfileCreationErrorMessageLocal());