Commit 776b544c authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Convert PrivetPrinterHandler to use IdentityManager

IdentityManager is the recommended API to access the
Google account used by the user and SigninManager is
deprecated.

Convert PrivetPrinterHandler to the new API.

Bug: 798408
Change-Id: I9cd18bd698f88ecda52d085ba661641d7c6fe06d
Reviewed-on: https://chromium-review.googlesource.com/1100758Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Reviewed-by: default avatarWei Li <weili@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568781}
parent d7f274c2
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
#include "base/timer/timer.h" #include "base/timer/timer.h"
#include "chrome/browser/printing/cloud_print/privet_constants.h" #include "chrome/browser/printing/cloud_print/privet_constants.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/ui/webui/print_preview/print_preview_utils.h" #include "chrome/browser/ui/webui/print_preview/print_preview_utils.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "components/signin/core/browser/signin_manager.h" #include "services/identity/public/cpp/identity_manager.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
namespace { namespace {
...@@ -251,11 +251,11 @@ void PrivetPrinterHandler::StartPrint( ...@@ -251,11 +251,11 @@ void PrivetPrinterHandler::StartPrint(
privet_local_print_operation_->SetPageSize(page_size); privet_local_print_operation_->SetPageSize(page_size);
privet_local_print_operation_->SetData(print_data); privet_local_print_operation_->SetData(print_data);
SigninManagerBase* signin_manager = identity::IdentityManager* identity_manager =
SigninManagerFactory::GetForProfileIfExists(profile_); IdentityManagerFactory::GetForProfileIfExists(profile_);
if (signin_manager) { if (identity_manager) {
privet_local_print_operation_->SetUsername( privet_local_print_operation_->SetUsername(
signin_manager->GetAuthenticatedAccountInfo().email); identity_manager->GetPrimaryAccountInfo().email);
} }
privet_local_print_operation_->Start(); privet_local_print_operation_->Start();
......
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