| Index: chrome/browser/ui/webui/signin/sync_confirmation_handler.cc
|
| diff --git a/chrome/browser/ui/webui/signin/sync_confirmation_handler.cc b/chrome/browser/ui/webui/signin/sync_confirmation_handler.cc
|
| index df51a0d195a06e803804e9a1cb407d2a7358a3e3..12029478ffeeb2f98a057cd12a4666e8a97060fd 100644
|
| --- a/chrome/browser/ui/webui/signin/sync_confirmation_handler.cc
|
| +++ b/chrome/browser/ui/webui/signin/sync_confirmation_handler.cc
|
| @@ -10,6 +10,7 @@
|
| #include "chrome/browser/signin/signin_manager_factory.h"
|
| #include "chrome/browser/ui/browser_finder.h"
|
| #include "chrome/browser/ui/browser_window.h"
|
| +#include "chrome/browser/ui/signin_view_controller_delegate.h"
|
| #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
|
| #include "components/signin/core/browser/account_tracker_service.h"
|
| #include "content/public/browser/user_metrics.h"
|
| @@ -32,12 +33,12 @@ void SyncConfirmationHandler::RegisterMessages() {
|
| base::Unretained(this)));
|
| web_ui()->RegisterMessageCallback("undo",
|
| base::Bind(&SyncConfirmationHandler::HandleUndo, base::Unretained(this)));
|
| - web_ui()->RegisterMessageCallback("initialized",
|
| - base::Bind(&SyncConfirmationHandler::HandleInitialized,
|
| - base::Unretained(this)));
|
| web_ui()->RegisterMessageCallback("goToSettings",
|
| base::Bind(&SyncConfirmationHandler::HandleGoToSettings,
|
| base::Unretained(this)));
|
| + web_ui()->RegisterMessageCallback("initializedWithSize",
|
| + base::Bind(&SyncConfirmationHandler::HandleInitializedWithSize,
|
| + base::Unretained(this)));
|
| }
|
|
|
| void SyncConfirmationHandler::HandleConfirm(const base::ListValue* args) {
|
| @@ -59,23 +60,6 @@ void SyncConfirmationHandler::HandleUndo(const base::ListValue* args) {
|
| browser->CloseModalSigninWindow();
|
| }
|
|
|
| -void SyncConfirmationHandler::HandleInitialized(const base::ListValue* args) {
|
| - Browser* browser = GetDesktopBrowser();
|
| - Profile* profile = browser->profile();
|
| - std::vector<AccountInfo> accounts =
|
| - AccountTrackerServiceFactory::GetForProfile(profile)->GetAccounts();
|
| -
|
| - if (accounts.empty())
|
| - return;
|
| -
|
| - AccountInfo primary_account_info = accounts[0];
|
| -
|
| - if (!primary_account_info.IsValid())
|
| - AccountTrackerServiceFactory::GetForProfile(profile)->AddObserver(this);
|
| - else
|
| - SetUserImageURL(primary_account_info.picture_url);
|
| -}
|
| -
|
| void SyncConfirmationHandler::SetUserImageURL(const std::string& picture_url) {
|
| GURL url;
|
| if (profiles::GetImageURLWithThumbnailSize(GURL(picture_url),
|
| @@ -111,3 +95,28 @@ void SyncConfirmationHandler::CloseModalSigninWindow(
|
| SyncConfirmationUIClosed(results);
|
| browser->CloseModalSigninWindow();
|
| }
|
| +
|
| +void SyncConfirmationHandler::HandleInitializedWithSize(
|
| + const base::ListValue* args) {
|
| + Browser* browser = GetDesktopBrowser();
|
| + Profile* profile = browser->profile();
|
| + std::vector<AccountInfo> accounts =
|
| + AccountTrackerServiceFactory::GetForProfile(profile)->GetAccounts();
|
| +
|
| + if (accounts.empty())
|
| + return;
|
| +
|
| + AccountInfo primary_account_info = accounts[0];
|
| +
|
| + if (!primary_account_info.IsValid())
|
| + AccountTrackerServiceFactory::GetForProfile(profile)->AddObserver(this);
|
| + else
|
| + SetUserImageURL(primary_account_info.picture_url);
|
| +
|
| + double height;
|
| + bool success = args->GetDouble(0, &height);
|
| + DCHECK(success);
|
| +
|
| + browser->signin_view_controller()->delegate()->ResizeNativeView(
|
| + static_cast<int>(height));
|
| +}
|
|
|