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

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

Issue 1226093005: Give ProfileChooserView signin button focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Override WidgetDelegate::GetInitiallyFocusedView(). Created 5 years, 5 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 e27975e4e2799de4a67934389db6ca079b1c9209..aa06f2d6a52ce3eaa0eb43bc9b5ab49d90f6a21a 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -508,6 +508,11 @@ void ProfileChooserView::ShowBubble(
views::BubbleDelegateView::CreateBubble(profile_bubble_);
profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_);
profile_bubble_->SetAlignment(border_alignment);
+ profile_bubble_->initially_focused_view_ =
msw 2015/07/13 21:37:30 Why is this controlled here? Let ProfileChooserVie
wjmaclean 2015/07/14 12:26:18 Done.
+ (view_mode == profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER)
msw 2015/07/13 21:37:30 I don't think there's a need for this conditional
wjmaclean 2015/07/14 12:26:18 Done.
+ ? profile_bubble_->signin_current_profile_link_
+ : nullptr;
+ profile_bubble_->GetWidget()->set_focus_on_creation(true);
msw 2015/07/13 21:37:30 Why is this needed? The button should be focused o
wjmaclean 2015/07/14 12:26:18 Done.
profile_bubble_->GetWidget()->Show();
profile_bubble_->SetArrowPaintType(views::BubbleBorder::PAINT_NONE);
}
@@ -543,6 +548,7 @@ ProfileChooserView::ProfileChooserView(views::View* anchor_view,
signin::GAIAServiceType service_type)
: BubbleDelegateView(anchor_view, arrow),
browser_(browser),
+ initially_focused_view_(nullptr),
view_mode_(view_mode),
tutorial_mode_(tutorial_mode),
gaia_service_type_(service_type) {
@@ -737,6 +743,10 @@ bool ProfileChooserView::AcceleratorPressed(
return true;
}
+views::View* ProfileChooserView::GetInitiallyFocusedView() {
+ return initially_focused_view_;
+}
+
bool ProfileChooserView::HandleContextMenu(
const content::ContextMenuParams& params) {
// Suppresses the context menu because some features, such as inspecting

Powered by Google App Engine
This is Rietveld 408576698