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

Side by Side Diff: chrome/browser/ui/views/toolbar/browser_action_view.cc

Issue 650503002: Make the accessible name of a browser action it's title (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/toolbar/browser_action_view.h" 5 #include "chrome/browser/ui/views/toolbar/browser_action_view.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 void BrowserActionView::PaintChildren(gfx::Canvas* canvas, 108 void BrowserActionView::PaintChildren(gfx::Canvas* canvas,
109 const views::CullSet& cull_set) { 109 const views::CullSet& cull_set) {
110 View::PaintChildren(canvas, cull_set); 110 View::PaintChildren(canvas, cull_set);
111 int tab_id = view_controller_->GetCurrentTabId(); 111 int tab_id = view_controller_->GetCurrentTabId();
112 if (tab_id >= 0) 112 if (tab_id >= 0)
113 extension_action()->PaintBadge(canvas, GetLocalBounds(), tab_id); 113 extension_action()->PaintBadge(canvas, GetLocalBounds(), tab_id);
114 } 114 }
115 115
116 void BrowserActionView::GetAccessibleState(ui::AXViewState* state) { 116 void BrowserActionView::GetAccessibleState(ui::AXViewState* state) {
117 views::MenuButton::GetAccessibleState(state); 117 views::MenuButton::GetAccessibleState(state);
118 state->name = l10n_util::GetStringUTF16(
Devlin 2014/10/10 22:16:26 This was done as part of the conversion from havin
119 IDS_ACCNAME_EXTENSIONS_BROWSER_ACTION);
120 state->role = ui::AX_ROLE_BUTTON; 118 state->role = ui::AX_ROLE_BUTTON;
121 } 119 }
122 120
123 void BrowserActionView::ButtonPressed(views::Button* sender, 121 void BrowserActionView::ButtonPressed(views::Button* sender,
124 const ui::Event& event) { 122 const ui::Event& event) {
125 view_controller_->ExecuteActionByUser(); 123 view_controller_->ExecuteActionByUser();
126 } 124 }
127 125
128 void BrowserActionView::UpdateState() { 126 void BrowserActionView::UpdateState() {
129 int tab_id = view_controller_->GetCurrentTabId(); 127 int tab_id = view_controller_->GetCurrentTabId();
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 } 335 }
338 336
339 void BrowserActionView::CleanupPopup() { 337 void BrowserActionView::CleanupPopup() {
340 // We need to do these actions synchronously (instead of closing and then 338 // We need to do these actions synchronously (instead of closing and then
341 // performing the rest of the cleanup in OnWidgetDestroyed()) because 339 // performing the rest of the cleanup in OnWidgetDestroyed()) because
342 // OnWidgetDestroyed() can be called asynchronously from Close(), and we need 340 // OnWidgetDestroyed() can be called asynchronously from Close(), and we need
343 // to keep the delegate's popup owner up-to-date. 341 // to keep the delegate's popup owner up-to-date.
344 delegate_->SetPopupOwner(NULL); 342 delegate_->SetPopupOwner(NULL);
345 pressed_lock_.reset(); // Unpress the menu button if it was pressed. 343 pressed_lock_.reset(); // Unpress the menu button if it was pressed.
346 } 344 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698