Commit 5322df5b authored by guohui@chromium.org's avatar guohui@chromium.org

Parse extra parameters on x-chrome-manage-accounts header

BUG=375416

Review URL: https://codereview.chromium.org/345533005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278599 0039d316-1c4b-4281-b951-d872f2087c98
parent 20af2b63
...@@ -36,7 +36,7 @@ bool PrincipalsPrivateShowAvatarBubbleFunction::RunSyncSafe() { ...@@ -36,7 +36,7 @@ bool PrincipalsPrivateShowAvatarBubbleFunction::RunSyncSafe() {
if (browser) { if (browser) {
browser->window()->ShowAvatarBubbleFromAvatarButton( browser->window()->ShowAvatarBubbleFromAvatarButton(
BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT,
signin::GAIA_SERVICE_TYPE_NONE); signin::ManageAccountsParams());
} }
return true; return true;
} }
......
...@@ -101,7 +101,7 @@ void SigninGlobalError::ExecuteMenuItem(Browser* browser) { ...@@ -101,7 +101,7 @@ void SigninGlobalError::ExecuteMenuItem(Browser* browser) {
if (switches::IsNewAvatarMenu()) { if (switches::IsNewAvatarMenu()) {
browser->window()->ShowAvatarBubbleFromAvatarButton( browser->window()->ShowAvatarBubbleFromAvatarButton(
BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH, BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH,
signin::GAIA_SERVICE_TYPE_NONE); signin::ManageAccountsParams());
} else { } else {
chrome::ShowSingletonTab( chrome::ShowSingletonTab(
browser, browser,
......
...@@ -38,6 +38,12 @@ const char kGaiaIdAttrName[] = "id"; ...@@ -38,6 +38,12 @@ const char kGaiaIdAttrName[] = "id";
const char kProfileModeAttrName[] = "mode"; const char kProfileModeAttrName[] = "mode";
const char kEnableAccountConsistencyAttrName[] = "enable_account_consistency"; const char kEnableAccountConsistencyAttrName[] = "enable_account_consistency";
const char kServiceTypeAttrName[] = "action";
const char kEmailAttrName[] = "email";
const char kIsSamlAttrName[] = "is_saml";
const char kContinueUrlAttrName[] = "continue_url";
const char kIsSameTabAttrName[] = "is_same_tab";
// Determines the service type that has been passed from GAIA in the header. // Determines the service type that has been passed from GAIA in the header.
signin::GAIAServiceType GetGAIAServiceTypeFromHeader( signin::GAIAServiceType GetGAIAServiceTypeFromHeader(
const std::string& header_value) { const std::string& header_value) {
...@@ -69,7 +75,7 @@ MirrorResponseHeaderDictionary ParseMirrorResponseHeader( ...@@ -69,7 +75,7 @@ MirrorResponseHeaderDictionary ParseMirrorResponseHeader(
std::string field(*i); std::string field(*i);
std::vector<std::string> tokens; std::vector<std::string> tokens;
if (Tokenize(field, "=", &tokens) != 2) { if (Tokenize(field, "=", &tokens) != 2) {
DLOG(WARNING) << "Unexpected GAIA header filed '" << field << "'."; DLOG(WARNING) << "Unexpected GAIA header field '" << field << "'.";
continue; continue;
} }
dictionary[tokens[0]] = tokens[1]; dictionary[tokens[0]] = tokens[1];
...@@ -77,6 +83,34 @@ MirrorResponseHeaderDictionary ParseMirrorResponseHeader( ...@@ -77,6 +83,34 @@ MirrorResponseHeaderDictionary ParseMirrorResponseHeader(
return dictionary; return dictionary;
} }
// Returns the parameters contained in the X-Chrome-Manage-Accounts response
// header.
signin::ManageAccountsParams BuildManageAccountsParams(
const std::string& header_value) {
signin::ManageAccountsParams params;
MirrorResponseHeaderDictionary header_dictionary =
ParseMirrorResponseHeader(header_value);
MirrorResponseHeaderDictionary::const_iterator it = header_dictionary.begin();
for (; it != header_dictionary.end(); ++it) {
const std::string key_name(it->first);
if (key_name == kServiceTypeAttrName) {
params.service_type =
GetGAIAServiceTypeFromHeader(header_dictionary[kServiceTypeAttrName]);
} else if (key_name == kEmailAttrName) {
params.email = header_dictionary[kEmailAttrName];
} else if (key_name == kIsSamlAttrName) {
params.is_saml = header_dictionary[kIsSamlAttrName] == "true";
} else if (key_name == kContinueUrlAttrName) {
params.continue_url = header_dictionary[kContinueUrlAttrName];
} else if (key_name == kIsSameTabAttrName) {
params.is_same_tab = header_dictionary[kIsSameTabAttrName] == "true";
} else {
DLOG(WARNING) << "Unexpected GAIA header attribute '" << key_name << "'.";
}
}
return params;
}
#if !defined(OS_IOS) #if !defined(OS_IOS)
// Processes the mirror response header on the UI thread. Currently depending // Processes the mirror response header on the UI thread. Currently depending
// on the value of |header_value|, it either shows the profile avatar menu, or // on the value of |header_value|, it either shows the profile avatar menu, or
...@@ -112,7 +146,7 @@ void ProcessMirrorHeaderUIThread( ...@@ -112,7 +146,7 @@ void ProcessMirrorHeaderUIThread(
bubble_mode = BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT; bubble_mode = BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT;
} }
browser->window()->ShowAvatarBubbleFromAvatarButton( browser->window()->ShowAvatarBubbleFromAvatarButton(
bubble_mode, service_type); bubble_mode, manage_accounts_params);
} }
#else // defined(OS_ANDROID) #else // defined(OS_ANDROID)
if (service_type == signin::GAIA_SERVICE_TYPE_INCOGNITO) { if (service_type == signin::GAIA_SERVICE_TYPE_INCOGNITO) {
...@@ -141,6 +175,15 @@ bool IsDriveOrigin(const GURL& url) { ...@@ -141,6 +175,15 @@ bool IsDriveOrigin(const GURL& url) {
namespace signin { namespace signin {
ManageAccountsParams::ManageAccountsParams() :
service_type(GAIA_SERVICE_TYPE_NONE),
email(""),
is_saml(false),
continue_url(""),
is_same_tab(false),
child_id(0),
route_id(0) {}
bool AppendMirrorRequestHeaderIfPossible( bool AppendMirrorRequestHeaderIfPossible(
net::URLRequest* request, net::URLRequest* request,
const GURL& redirect_url, const GURL& redirect_url,
...@@ -198,31 +241,6 @@ bool AppendMirrorRequestHeaderIfPossible( ...@@ -198,31 +241,6 @@ bool AppendMirrorRequestHeaderIfPossible(
return true; return true;
} }
ManageAccountsParams GetManageAccountsParams(net::URLRequest* request,
ProfileIOData* io_data) {
ManageAccountsParams params;
params.service_type = GAIA_SERVICE_TYPE_NONE;
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
if (!gaia::IsGaiaSignonRealm(request->url().GetOrigin()))
return params;
std::string header_value;
if (!request->response_headers()->GetNormalizedHeader(
kChromeManageAccountsHeader, &header_value)) {
return params;
}
DCHECK(switches::IsNewProfileManagement() && !io_data->IsOffTheRecord());
MirrorResponseHeaderDictionary header_dictionary =
ParseMirrorResponseHeader(header_value);
if (header_dictionary.count("action")) {
params.service_type =
GetGAIAServiceTypeFromHeader(header_dictionary["action"]);
}
return params;
}
void ProcessMirrorResponseHeaderIfExists( void ProcessMirrorResponseHeaderIfExists(
net::URLRequest* request, net::URLRequest* request,
ProfileIOData* io_data, ProfileIOData* io_data,
...@@ -232,10 +250,22 @@ void ProcessMirrorResponseHeaderIfExists( ...@@ -232,10 +250,22 @@ void ProcessMirrorResponseHeaderIfExists(
NOTREACHED(); NOTREACHED();
#else #else
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
ManageAccountsParams params = GetManageAccountsParams(request, io_data); if (!gaia::IsGaiaSignonRealm(request->url().GetOrigin()))
return;
std::string header_value;
if (!request->response_headers()->GetNormalizedHeader(
kChromeManageAccountsHeader, &header_value)) {
return;
}
DCHECK(switches::IsNewProfileManagement() && !io_data->IsOffTheRecord());
ManageAccountsParams params(BuildManageAccountsParams(header_value));
if (params.service_type == GAIA_SERVICE_TYPE_NONE) if (params.service_type == GAIA_SERVICE_TYPE_NONE)
return; return;
params.child_id = child_id;
params.route_id = route_id;
content::BrowserThread::PostTask( content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE, content::BrowserThread::UI, FROM_HERE,
base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params)); base::Bind(ProcessMirrorHeaderUIThread, child_id, route_id, params));
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_SIGNIN_SIGNIN_HEADER_HELPER_H_ #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_HEADER_HELPER_H_
#define CHROME_BROWSER_SIGNIN_SIGNIN_HEADER_HELPER_H_ #define CHROME_BROWSER_SIGNIN_SIGNIN_HEADER_HELPER_H_
#include <string>
namespace net { namespace net {
class URLRequest; class URLRequest;
} }
...@@ -41,7 +43,23 @@ enum GAIAServiceType { ...@@ -41,7 +43,23 @@ enum GAIAServiceType {
// Struct describing the paramters received in the manage account header. // Struct describing the paramters received in the manage account header.
struct ManageAccountsParams { struct ManageAccountsParams {
// The requested service type such as "ADDSESSION".
GAIAServiceType service_type; GAIAServiceType service_type;
// The prefilled email.
std::string email;
// Whether |email| is a saml account.
bool is_saml;
// The continue URL after the requested service is completed successfully.
// Defaults to the current URL if empty.
std::string continue_url;
// Whether the continue URL should be loaded in the same tab.
bool is_same_tab;
// The child id associated with the web content of the request.
int child_id;
// The route id associated with the web content of the request.
int route_id;
ManageAccountsParams();
}; };
// Adds X-Chrome-Connected header to all Gaia requests from a connected profile, // Adds X-Chrome-Connected header to all Gaia requests from a connected profile,
...@@ -55,14 +73,6 @@ bool AppendMirrorRequestHeaderIfPossible( ...@@ -55,14 +73,6 @@ bool AppendMirrorRequestHeaderIfPossible(
int child_id, int child_id,
int route_id); int route_id);
// Returns the parameters contained in the X-Chrome-Manage-Accounts response
// header.
// If the request does not have a response header or if the header contains
// garbage, then |service_type| is set to |GAIA_SERVICE_TYPE_NONE|.
// Must be called on IO thread.
ManageAccountsParams GetManageAccountsParams(net::URLRequest* request,
ProfileIOData* io_data);
// Looks for the X-Chrome-Manage-Accounts response header, and if found, // Looks for the X-Chrome-Manage-Accounts response header, and if found,
// tries to show the avatar bubble in the browser identified by the // tries to show the avatar bubble in the browser identified by the
// child/route id. Must be called on IO thread. // child/route id. Must be called on IO thread.
......
...@@ -1047,7 +1047,7 @@ void ShowAppMenu(Browser* browser) { ...@@ -1047,7 +1047,7 @@ void ShowAppMenu(Browser* browser) {
void ShowAvatarMenu(Browser* browser) { void ShowAvatarMenu(Browser* browser) {
browser->window()->ShowAvatarBubbleFromAvatarButton( browser->window()->ShowAvatarBubbleFromAvatarButton(
BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT, BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT,
signin::GAIA_SERVICE_TYPE_NONE); signin::ManageAccountsParams());
} }
void OpenUpdateChromeDialog(Browser* browser) { void OpenUpdateChromeDialog(Browser* browser) {
......
...@@ -372,9 +372,8 @@ class BrowserWindow : public ui::BaseWindow { ...@@ -372,9 +372,8 @@ class BrowserWindow : public ui::BaseWindow {
AVATAR_BUBBLE_MODE_SIGNIN, AVATAR_BUBBLE_MODE_SIGNIN,
AVATAR_BUBBLE_MODE_REAUTH, AVATAR_BUBBLE_MODE_REAUTH,
}; };
virtual void ShowAvatarBubbleFromAvatarButton( virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode,
AvatarBubbleMode mode, const signin::ManageAccountsParams& manage_accounts_params) = 0;
signin::GAIAServiceType service_type) = 0;
// Show bubble for password generation positioned relative to |rect|. The // Show bubble for password generation positioned relative to |rect|. The
// subclasses implementing this interface do not own the |password_generator| // subclasses implementing this interface do not own the |password_generator|
......
...@@ -150,7 +150,7 @@ class BrowserWindowCocoa : ...@@ -150,7 +150,7 @@ class BrowserWindowCocoa :
virtual void ShowAvatarBubble(content::WebContents* web_contents, virtual void ShowAvatarBubble(content::WebContents* web_contents,
const gfx::Rect& rect) OVERRIDE; const gfx::Rect& rect) OVERRIDE;
virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode, virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode,
signin::GAIAServiceType service_type) OVERRIDE; const signin::ManageAccountsParams& manage_accounts_params) OVERRIDE;
virtual void ShowPasswordGenerationBubble( virtual void ShowPasswordGenerationBubble(
const gfx::Rect& rect, const gfx::Rect& rect,
const autofill::PasswordForm& form, const autofill::PasswordForm& form,
......
...@@ -706,14 +706,15 @@ void BrowserWindowCocoa::ShowAvatarBubble(WebContents* web_contents, ...@@ -706,14 +706,15 @@ void BrowserWindowCocoa::ShowAvatarBubble(WebContents* web_contents,
} }
void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton( void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton(
AvatarBubbleMode mode, signin::GAIAServiceType service_type) { AvatarBubbleMode mode,
const signin::ManageAccountsParams& manage_accounts_params) {
AvatarBaseController* controller = [controller_ avatarButtonController]; AvatarBaseController* controller = [controller_ avatarButtonController];
NSView* anchor = [controller buttonView]; NSView* anchor = [controller buttonView];
if ([anchor isHiddenOrHasHiddenAncestor]) if ([anchor isHiddenOrHasHiddenAncestor])
anchor = [[controller_ toolbarController] wrenchButton]; anchor = [[controller_ toolbarController] wrenchButton];
[controller showAvatarBubble:anchor [controller showAvatarBubble:anchor
withMode:mode withMode:mode
withServiceType:service_type]; withServiceType:manage_accounts_params.service_type];
} }
void BrowserWindowCocoa::ShowPasswordGenerationBubble( void BrowserWindowCocoa::ShowPasswordGenerationBubble(
......
...@@ -2378,10 +2378,10 @@ void BrowserView::ShowAvatarBubble(WebContents* web_contents, ...@@ -2378,10 +2378,10 @@ void BrowserView::ShowAvatarBubble(WebContents* web_contents,
void BrowserView::ShowAvatarBubbleFromAvatarButton( void BrowserView::ShowAvatarBubbleFromAvatarButton(
AvatarBubbleMode mode, AvatarBubbleMode mode,
signin::GAIAServiceType service_type) { const signin::ManageAccountsParams& manage_accounts_params) {
views::BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_RIGHT; views::BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_RIGHT;
views::BubbleBorder::BubbleAlignment alignment = views::BubbleBorder::BubbleAlignment alignment =
views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR; views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR;
views::View* anchor_view = frame_->GetAvatarMenuButton(); views::View* anchor_view = frame_->GetAvatarMenuButton();
if (!anchor_view) if (!anchor_view)
anchor_view = toolbar_->app_menu(); anchor_view = toolbar_->app_menu();
...@@ -2411,8 +2411,8 @@ void BrowserView::ShowAvatarBubbleFromAvatarButton( ...@@ -2411,8 +2411,8 @@ void BrowserView::ShowAvatarBubbleFromAvatarButton(
view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER;
break; break;
} }
ProfileChooserView::ShowBubble(view_mode, service_type, anchor_view, arrow, ProfileChooserView::ShowBubble(view_mode, manage_accounts_params,
alignment, browser()); anchor_view, arrow, alignment, browser());
} else { } else {
gfx::Point origin; gfx::Point origin;
views::View::ConvertPointToScreen(anchor_view, &origin); views::View::ConvertPointToScreen(anchor_view, &origin);
......
...@@ -363,7 +363,7 @@ class BrowserView : public BrowserWindow, ...@@ -363,7 +363,7 @@ class BrowserView : public BrowserWindow,
virtual void ShowAvatarBubble(content::WebContents* web_contents, virtual void ShowAvatarBubble(content::WebContents* web_contents,
const gfx::Rect& rect) OVERRIDE; const gfx::Rect& rect) OVERRIDE;
virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode, virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode,
signin::GAIAServiceType service_type) OVERRIDE; const signin::ManageAccountsParams& manage_accounts_params) OVERRIDE;
virtual void ShowPasswordGenerationBubble( virtual void ShowPasswordGenerationBubble(
const gfx::Rect& rect, const gfx::Rect& rect,
const autofill::PasswordForm& form, const autofill::PasswordForm& form,
......
...@@ -289,7 +289,7 @@ void GlassBrowserFrameView::ButtonPressed(views::Button* sender, ...@@ -289,7 +289,7 @@ void GlassBrowserFrameView::ButtonPressed(views::Button* sender,
if (sender == new_avatar_button()) { if (sender == new_avatar_button()) {
browser_view()->ShowAvatarBubbleFromAvatarButton( browser_view()->ShowAvatarBubbleFromAvatarButton(
BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT, BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT,
signin::GAIA_SERVICE_TYPE_NONE); signin::ManageAccountsParams());
} }
} }
......
...@@ -351,7 +351,7 @@ void OpaqueBrowserFrameView::ButtonPressed(views::Button* sender, ...@@ -351,7 +351,7 @@ void OpaqueBrowserFrameView::ButtonPressed(views::Button* sender,
} else if (sender == new_avatar_button()) { } else if (sender == new_avatar_button()) {
browser_view()->ShowAvatarBubbleFromAvatarButton( browser_view()->ShowAvatarBubbleFromAvatarButton(
BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT, BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT,
signin::GAIA_SERVICE_TYPE_NONE); signin::ManageAccountsParams());
} }
} }
......
...@@ -108,7 +108,7 @@ bool AvatarLabel::OnMousePressed(const ui::MouseEvent& event) { ...@@ -108,7 +108,7 @@ bool AvatarLabel::OnMousePressed(const ui::MouseEvent& event) {
browser_view_->ShowAvatarBubbleFromAvatarButton( browser_view_->ShowAvatarBubbleFromAvatarButton(
BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT, BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT,
signin::GAIA_SERVICE_TYPE_NONE); signin::ManageAccountsParams());
return true; return true;
} }
......
...@@ -445,7 +445,7 @@ bool ProfileChooserView::close_on_deactivate_for_testing_ = true; ...@@ -445,7 +445,7 @@ bool ProfileChooserView::close_on_deactivate_for_testing_ = true;
// static // static
void ProfileChooserView::ShowBubble( void ProfileChooserView::ShowBubble(
profiles::BubbleViewMode view_mode, profiles::BubbleViewMode view_mode,
signin::GAIAServiceType service_type, const signin::ManageAccountsParams& manage_accounts_params,
views::View* anchor_view, views::View* anchor_view,
views::BubbleBorder::Arrow arrow, views::BubbleBorder::Arrow arrow,
views::BubbleBorder::BubbleAlignment border_alignment, views::BubbleBorder::BubbleAlignment border_alignment,
...@@ -454,7 +454,7 @@ void ProfileChooserView::ShowBubble( ...@@ -454,7 +454,7 @@ void ProfileChooserView::ShowBubble(
return; return;
profile_bubble_ = new ProfileChooserView(anchor_view, arrow, browser, profile_bubble_ = new ProfileChooserView(anchor_view, arrow, browser,
view_mode, service_type); view_mode, manage_accounts_params.service_type);
views::BubbleDelegateView::CreateBubble(profile_bubble_); views::BubbleDelegateView::CreateBubble(profile_bubble_);
profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_); profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_);
profile_bubble_->SetAlignment(border_alignment); profile_bubble_->SetAlignment(border_alignment);
......
...@@ -51,12 +51,13 @@ class ProfileChooserView : public views::BubbleDelegateView, ...@@ -51,12 +51,13 @@ class ProfileChooserView : public views::BubbleDelegateView,
// call this function when the button is clicked and if the bubble isn't // call this function when the button is clicked and if the bubble isn't
// showing it will appear while if it is showing, nothing will happen here and // showing it will appear while if it is showing, nothing will happen here and
// the existing bubble will auto-close due to focus loss. // the existing bubble will auto-close due to focus loss.
static void ShowBubble(profiles::BubbleViewMode view_mode, static void ShowBubble(
signin::GAIAServiceType service_type, profiles::BubbleViewMode view_mode,
views::View* anchor_view, const signin::ManageAccountsParams& manage_accounts_params,
views::BubbleBorder::Arrow arrow, views::View* anchor_view,
views::BubbleBorder::BubbleAlignment border_alignment, views::BubbleBorder::Arrow arrow,
Browser* browser); views::BubbleBorder::BubbleAlignment border_alignment,
Browser* browser);
static bool IsShowing(); static bool IsShowing();
static void Hide(); static void Hide();
......
...@@ -385,7 +385,7 @@ void InlineLoginHandlerImpl::CloseTab(bool show_account_management) { ...@@ -385,7 +385,7 @@ void InlineLoginHandlerImpl::CloseTab(bool show_account_management) {
if (show_account_management) { if (show_account_management) {
browser->window()->ShowAvatarBubbleFromAvatarButton( browser->window()->ShowAvatarBubbleFromAvatarButton(
BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT,
signin::GAIA_SERVICE_TYPE_NONE); signin::ManageAccountsParams());
} }
} }
} }
...@@ -529,7 +529,7 @@ void SyncSetupHandler::DisplayGaiaLoginInNewTabOrWindow() { ...@@ -529,7 +529,7 @@ void SyncSetupHandler::DisplayGaiaLoginInNewTabOrWindow() {
if (switches::IsNewProfileManagement()) { if (switches::IsNewProfileManagement()) {
browser->window()->ShowAvatarBubbleFromAvatarButton( browser->window()->ShowAvatarBubbleFromAvatarButton(
BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH, BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH,
signin::GAIA_SERVICE_TYPE_NONE); signin::ManageAccountsParams());
} else { } else {
url = signin::GetReauthURL(browser->profile(), url = signin::GetReauthURL(browser->profile(),
error_controller->error_account_id()); error_controller->error_account_id());
...@@ -538,7 +538,7 @@ void SyncSetupHandler::DisplayGaiaLoginInNewTabOrWindow() { ...@@ -538,7 +538,7 @@ void SyncSetupHandler::DisplayGaiaLoginInNewTabOrWindow() {
if (switches::IsNewProfileManagement()) { if (switches::IsNewProfileManagement()) {
browser->window()->ShowAvatarBubbleFromAvatarButton( browser->window()->ShowAvatarBubbleFromAvatarButton(
BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN,
signin::GAIA_SERVICE_TYPE_NONE); signin::ManageAccountsParams());
} else { } else {
url = signin::GetPromoURL(signin::SOURCE_SETTINGS, true); url = signin::GetPromoURL(signin::SOURCE_SETTINGS, true);
} }
......
...@@ -146,7 +146,7 @@ class TestBrowserWindow : public BrowserWindow { ...@@ -146,7 +146,7 @@ class TestBrowserWindow : public BrowserWindow {
virtual void ShowAvatarBubble(content::WebContents* web_contents, virtual void ShowAvatarBubble(content::WebContents* web_contents,
const gfx::Rect& rect) OVERRIDE {} const gfx::Rect& rect) OVERRIDE {}
virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode, virtual void ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode,
signin::GAIAServiceType service_type) OVERRIDE {} const signin::ManageAccountsParams& manage_accounts_params) OVERRIDE {}
virtual void ShowPasswordGenerationBubble( virtual void ShowPasswordGenerationBubble(
const gfx::Rect& rect, const gfx::Rect& rect,
const autofill::PasswordForm& form, const autofill::PasswordForm& form,
......
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