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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache.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: nullptr 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/ui/webui/ntp/ntp_resource_cache.cc
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
index 71e751dbaff150c0a536afa2a57db2f2fe7bdb1d..3ba0bc9ce0464ffa6ee50d2cfffe40f5f2325321 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/search.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/themes/theme_properties.h"
@@ -40,6 +41,7 @@
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/locale_settings.h"
#include "components/google/core/browser/google_util.h"
+#include "components/signin/core/browser/signin_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_process_host.h"
@@ -553,8 +555,9 @@ void NTPResourceCache::CreateNewTabHTML() {
!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableNTPOtherSessionsMenu);
load_time_data.SetBoolean("showOtherSessionsMenu", show_other_sessions_menu);
- load_time_data.SetBoolean("isUserSignedIn",
- !prefs->GetString(prefs::kGoogleServicesUsername).empty());
+ load_time_data.SetBoolean(
+ "isUserSignedIn",
+ SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated());
// Load the new tab page appropriate for this build.
base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance().
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_login_handler.cc ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698