Commit 0f857554 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Convert MediaRouterWebUIMessageHandler to use IdentityManager

Bug: 798408
Change-Id: I6983b0468743607e8dd2a8722885a4861aaba8b2
Reviewed-on: https://chromium-review.googlesource.com/1096772Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Reviewed-by: default avatarDerek Cheng <imcheng@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567200}
parent f4a39626
...@@ -1025,6 +1025,7 @@ split_static_library("ui") { ...@@ -1025,6 +1025,7 @@ split_static_library("ui") {
"//ppapi/buildflags", "//ppapi/buildflags",
"//printing/buildflags", "//printing/buildflags",
"//rlz/buildflags", "//rlz/buildflags",
"//services/identity/public/cpp",
"//services/metrics/public/cpp:ukm_builders", "//services/metrics/public/cpp:ukm_builders",
"//services/network/public/mojom", "//services/network/public/mojom",
"//services/service_manager/runner/common", "//services/service_manager/runner/common",
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/media/router/media_router_metrics.h" #include "chrome/browser/media/router/media_router_metrics.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/webui/media_router/media_router_ui.h" #include "chrome/browser/ui/webui/media_router/media_router_ui.h"
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
#include "components/browser_sync/profile_sync_service.h" #include "components/browser_sync/profile_sync_service.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/signin/core/browser/account_tracker_service.h" #include "components/signin/core/browser/account_tracker_service.h"
#include "components/signin/core/browser/signin_manager.h"
#include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
namespace media_router { namespace media_router {
...@@ -1075,9 +1075,9 @@ void MediaRouterWebUIMessageHandler::MaybeUpdateFirstRunFlowData() { ...@@ -1075,9 +1075,9 @@ void MediaRouterWebUIMessageHandler::MaybeUpdateFirstRunFlowData() {
// the user opting into Google services, including cloud services, if the // the user opting into Google services, including cloud services, if the
// browser is a Chrome branded build. // browser is a Chrome branded build.
if (!pref_service->GetBoolean(prefs::kMediaRouterCloudServicesPrefSet)) { if (!pref_service->GetBoolean(prefs::kMediaRouterCloudServicesPrefSet)) {
SigninManagerBase* signin_manager = identity::IdentityManager* identity_manager =
SigninManagerFactory::GetForProfile(profile); IdentityManagerFactory::GetForProfile(profile);
if (signin_manager && signin_manager->IsAuthenticated()) { if (identity_manager && identity_manager->HasPrimaryAccount()) {
// If the user had previously acknowledged the first run flow without // If the user had previously acknowledged the first run flow without
// being shown the cloud services option, and is now logged in with sync // being shown the cloud services option, and is now logged in with sync
// enabled, turn on cloud services. // enabled, turn on cloud services.
...@@ -1112,10 +1112,10 @@ void MediaRouterWebUIMessageHandler::MaybeUpdateFirstRunFlowData() { ...@@ -1112,10 +1112,10 @@ void MediaRouterWebUIMessageHandler::MaybeUpdateFirstRunFlowData() {
} }
AccountInfo MediaRouterWebUIMessageHandler::GetAccountInfo() { AccountInfo MediaRouterWebUIMessageHandler::GetAccountInfo() {
SigninManagerBase* signin_manager = identity::IdentityManager* identity_manager =
SigninManagerFactory::GetForProfile(Profile::FromWebUI(web_ui())); IdentityManagerFactory::GetForProfile(Profile::FromWebUI(web_ui()));
return signin_manager ? signin_manager->GetAuthenticatedAccountInfo() return identity_manager ? identity_manager->GetPrimaryAccountInfo()
: AccountInfo(); : AccountInfo();
} }
int MediaRouterWebUIMessageHandler::CurrentCastModeForRouteId( int MediaRouterWebUIMessageHandler::CurrentCastModeForRouteId(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment