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

Unified Diff: chrome/browser/views/toolbar_view.cc

Issue 2817022: Small tweaks to improve toolbar keyboard accessibility: Put focus rects... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 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/views/toolbar_view.cc
===================================================================
--- chrome/browser/views/toolbar_view.cc (revision 50343)
+++ chrome/browser/views/toolbar_view.cc (working copy)
@@ -149,7 +149,6 @@
location_bar_ = new LocationBarView(profile, browser_->command_updater(),
model_, this, (display_mode_ == DISPLAYMODE_LOCATION) ?
LocationBarView::POPUP : LocationBarView::NORMAL);
- location_bar_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_LOCATION));
reload_ = new ReloadButton(location_bar_, browser_);
reload_->set_triggerable_event_flags(views::Event::EF_LEFT_BUTTON_DOWN |
@@ -276,6 +275,18 @@
}
////////////////////////////////////////////////////////////////////////////////
+// ToolbarView, AccessibleToolbarView overrides:
+
+bool ToolbarView::SetToolbarFocus(
+ int view_storage_id, views::View* initial_focus) {
+ if (!AccessibleToolbarView::SetToolbarFocus(view_storage_id, initial_focus))
+ return false;
+
+ location_bar_->set_show_focus_rect(true);
+ return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
// ToolbarView, Menu::BaseControllerDelegate overrides:
bool ToolbarView::GetAcceleratorInfo(int id, menus::Accelerator* accel) {
@@ -566,10 +577,17 @@
////////////////////////////////////////////////////////////////////////////////
// ToolbarView, protected:
+// Override this so that when the user presses F6 to rotate toolbar panes,
+// the location bar gets focus, not the first control in the toolbar.
views::View* ToolbarView::GetDefaultFocusableChild() {
return location_bar_;
}
+void ToolbarView::RemoveToolbarFocus() {
+ AccessibleToolbarView::RemoveToolbarFocus();
+ location_bar_->set_show_focus_rect(false);
+}
+
////////////////////////////////////////////////////////////////////////////////
// ToolbarView, private:

Powered by Google App Engine
This is Rietveld 408576698