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

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 1212403004: Make sure content area is focused when signin-view bubble is opened. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compare strings by direct pointer comparison. Created 5 years, 6 months 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/views/profiles/profile_chooser_view.cc
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 1606b2ff9b4c8a34940dc2d160071501bf45ae65..3032ad4810cdf286cb35a7060dbdb57385880e14 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -673,12 +673,13 @@ void ProfileChooserView::ShowView(profiles::BubbleViewMode view_to_display,
views::GridLayout* layout;
views::View* sub_view;
+ views::View* view_to_focus = nullptr;
switch (view_mode_) {
case profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN:
case profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT:
case profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH:
layout = CreateSingleColumnLayout(this, kFixedGaiaViewWidth);
- sub_view = CreateGaiaSigninView();
+ sub_view = CreateGaiaSigninView(&view_to_focus);
break;
case profiles::BUBBLE_VIEW_MODE_ACCOUNT_REMOVAL:
layout = CreateSingleColumnLayout(this, kFixedAccountRemovalViewWidth);
@@ -712,6 +713,8 @@ void ProfileChooserView::ShowView(profiles::BubbleViewMode view_to_display,
Layout();
if (GetBubbleFrameView())
SizeToContents();
+ if (view_to_focus)
+ view_to_focus->RequestFocus();
}
void ProfileChooserView::WindowClosing() {
@@ -1500,7 +1503,8 @@ void ProfileChooserView::CreateAccountButton(views::GridLayout* layout,
}
}
-views::View* ProfileChooserView::CreateGaiaSigninView() {
+views::View* ProfileChooserView::CreateGaiaSigninView(
+ views::View** signin_content_view) {
GURL url;
int message_id;
@@ -1544,6 +1548,8 @@ views::View* ProfileChooserView::CreateGaiaSigninView() {
TitleCard* title_card = new TitleCard(l10n_util::GetStringUTF16(message_id),
this,
&gaia_signin_cancel_button_);
+ if (signin_content_view)
+ *signin_content_view = web_view;
return TitleCard::AddPaddedTitleCard(
web_view, title_card, kFixedGaiaViewWidth);
}

Powered by Google App Engine
This is Rietveld 408576698