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

Side by Side Diff: ash/system/tray/tray_views.cc

Issue 10837067: Add accessible names to buttons in the Uber tray (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ash/system/tray/tray_views.h ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/system/tray/tray_views.h" 5 #include "ash/system/tray/tray_views.h"
6 6
7 #include "ash/system/tray/tray_constants.h" 7 #include "ash/system/tray/tray_constants.h"
8 #include "ash/system/tray/tray_item_view.h" 8 #include "ash/system/tray/tray_item_view.h"
9 #include "grit/ash_strings.h" 9 #include "grit/ash_strings.h"
10 #include "grit/ui_resources.h" 10 #include "grit/ui_resources.h"
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 AddChildView(button); 397 AddChildView(button);
398 } 398 }
399 399
400 //////////////////////////////////////////////////////////////////////////////// 400 ////////////////////////////////////////////////////////////////////////////////
401 // TrayPopupHeaderButton 401 // TrayPopupHeaderButton
402 402
403 TrayPopupHeaderButton::TrayPopupHeaderButton(views::ButtonListener* listener, 403 TrayPopupHeaderButton::TrayPopupHeaderButton(views::ButtonListener* listener,
404 int enabled_resource_id, 404 int enabled_resource_id,
405 int disabled_resource_id, 405 int disabled_resource_id,
406 int enabled_resource_id_hover, 406 int enabled_resource_id_hover,
407 int disabled_resource_id_hover) 407 int disabled_resource_id_hover,
408 int accessible_name_id)
408 : views::ToggleImageButton(listener) { 409 : views::ToggleImageButton(listener) {
409 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 410 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
410 SetImage(views::CustomButton::BS_NORMAL, 411 SetImage(views::CustomButton::BS_NORMAL,
411 bundle.GetImageNamed(enabled_resource_id).ToImageSkia()); 412 bundle.GetImageNamed(enabled_resource_id).ToImageSkia());
412 SetToggledImage(views::CustomButton::BS_NORMAL, 413 SetToggledImage(views::CustomButton::BS_NORMAL,
413 bundle.GetImageNamed(disabled_resource_id).ToImageSkia()); 414 bundle.GetImageNamed(disabled_resource_id).ToImageSkia());
414 SetImage(views::CustomButton::BS_HOT, 415 SetImage(views::CustomButton::BS_HOT,
415 bundle.GetImageNamed(enabled_resource_id_hover).ToImageSkia()); 416 bundle.GetImageNamed(enabled_resource_id_hover).ToImageSkia());
416 SetToggledImage(views::CustomButton::BS_HOT, 417 SetToggledImage(views::CustomButton::BS_HOT,
417 bundle.GetImageNamed(disabled_resource_id_hover).ToImageSkia()); 418 bundle.GetImageNamed(disabled_resource_id_hover).ToImageSkia());
418 SetImageAlignment(views::ImageButton::ALIGN_CENTER, 419 SetImageAlignment(views::ImageButton::ALIGN_CENTER,
419 views::ImageButton::ALIGN_MIDDLE); 420 views::ImageButton::ALIGN_MIDDLE);
421 SetAccessibleName(bundle.GetLocalizedString(accessible_name_id));
420 set_focusable(true); 422 set_focusable(true);
421 set_request_focus_on_press(false); 423 set_request_focus_on_press(false);
422 } 424 }
423 425
424 TrayPopupHeaderButton::~TrayPopupHeaderButton() {} 426 TrayPopupHeaderButton::~TrayPopupHeaderButton() {}
425 427
426 gfx::Size TrayPopupHeaderButton::GetPreferredSize() { 428 gfx::Size TrayPopupHeaderButton::GetPreferredSize() {
427 return gfx::Size(ash::kTrayPopupItemHeight, ash::kTrayPopupItemHeight); 429 return gfx::Size(ash::kTrayPopupItemHeight, ash::kTrayPopupItemHeight);
428 } 430 }
429 431
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 tray_view->set_border(views::Border::CreateEmptyBorder( 648 tray_view->set_border(views::Border::CreateEmptyBorder(
647 kTrayLabelItemVerticalPaddingVeriticalAlignment, 649 kTrayLabelItemVerticalPaddingVeriticalAlignment,
648 horizontal_padding, 650 horizontal_padding,
649 kTrayLabelItemVerticalPaddingVeriticalAlignment, 651 kTrayLabelItemVerticalPaddingVeriticalAlignment,
650 horizontal_padding)); 652 horizontal_padding));
651 } 653 }
652 } 654 }
653 655
654 } // namespace internal 656 } // namespace internal
655 } // namespace ash 657 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/tray_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698