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

Unified Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc

Issue 763673002: Replace direct access to kGoogleServicesUsername with calls to SigninManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years 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/extensions/api/webstore_private/webstore_private_api.cc
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
index dad5c31ccf8e3801232b31bb790c48892c43e784..d5395c5a2b33239ce1a1a6c3d7f42c146f8049e5 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
@@ -26,6 +26,7 @@
#include "chrome/browser/extensions/webstore_installer.h"
#include "chrome/browser/gpu/gpu_feature_checker.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/app_list/app_list_service.h"
@@ -33,6 +34,7 @@
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/pref_names.h"
#include "components/crx_file/id_util.h"
+#include "components/signin/core/browser/signin_manager.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
@@ -523,8 +525,9 @@ bool WebstorePrivateEnableAppLauncherFunction::RunSync() {
bool WebstorePrivateGetBrowserLoginFunction::RunSync() {
GetBrowserLogin::Results::Info info;
- info.login = GetProfile()->GetOriginalProfile()->GetPrefs()->GetString(
- prefs::kGoogleServicesUsername);
+ info.login =
+ SigninManagerFactory::GetForProfile(GetProfile()->GetOriginalProfile())
+ ->GetAuthenticatedUsername();
results_ = GetBrowserLogin::Results::Create(info);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698