OLD | NEW |
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/common/system/tray_accessibility.h" | 5 #include "ash/common/system/tray_accessibility.h" |
6 | 6 |
7 #include "ash/common/accessibility_delegate.h" | 7 #include "ash/common/accessibility_delegate.h" |
8 #include "ash/common/accessibility_types.h" | 8 #include "ash/common/accessibility_types.h" |
9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
10 #include "ash/common/system/tray/hover_highlight_view.h" | 10 #include "ash/common/system/tray/hover_highlight_view.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "ash/common/wm_shell.h" | 21 #include "ash/common/wm_shell.h" |
22 #include "ash/resources/grit/ash_resources.h" | 22 #include "ash/resources/grit/ash_resources.h" |
23 #include "ash/resources/vector_icons/vector_icons.h" | 23 #include "ash/resources/vector_icons/vector_icons.h" |
24 #include "ash/strings/grit/ash_strings.h" | 24 #include "ash/strings/grit/ash_strings.h" |
25 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
27 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
28 #include "ui/gfx/color_palette.h" | 28 #include "ui/gfx/color_palette.h" |
29 #include "ui/gfx/image/image.h" | 29 #include "ui/gfx/image/image.h" |
30 #include "ui/gfx/paint_vector_icon.h" | 30 #include "ui/gfx/paint_vector_icon.h" |
31 #include "ui/gfx/vector_icons_public.h" | |
32 #include "ui/views/controls/button/custom_button.h" | 31 #include "ui/views/controls/button/custom_button.h" |
33 #include "ui/views/controls/image_view.h" | 32 #include "ui/views/controls/image_view.h" |
34 #include "ui/views/controls/label.h" | 33 #include "ui/views/controls/label.h" |
35 #include "ui/views/layout/box_layout.h" | 34 #include "ui/views/layout/box_layout.h" |
36 #include "ui/views/widget/widget.h" | 35 #include "ui/views/widget/widget.h" |
37 | 36 |
38 namespace ash { | 37 namespace ash { |
39 namespace { | 38 namespace { |
40 | 39 |
41 enum AccessibilityState { | 40 enum AccessibilityState { |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 const gfx::VectorIcon& icon) { | 217 const gfx::VectorIcon& icon) { |
219 HoverHighlightView* container = new HoverHighlightView(this); | 218 HoverHighlightView* container = new HoverHighlightView(this); |
220 gfx::ImageSkia image = CreateVectorIcon(icon, kMenuIconColor); | 219 gfx::ImageSkia image = CreateVectorIcon(icon, kMenuIconColor); |
221 const int padding = (kMenuButtonSize - image.width()) / 2; | 220 const int padding = (kMenuButtonSize - image.width()) / 2; |
222 container->AddIconAndLabelCustomSize( | 221 container->AddIconAndLabelCustomSize( |
223 image, text, highlight, image.width() + kMenuSeparatorVerticalPadding * 2, | 222 image, text, highlight, image.width() + kMenuSeparatorVerticalPadding * 2, |
224 padding, padding); | 223 padding, padding); |
225 | 224 |
226 if (checked) { | 225 if (checked) { |
227 gfx::ImageSkia check_mark = | 226 gfx::ImageSkia check_mark = |
228 CreateVectorIcon(gfx::VectorIconId::CHECK_CIRCLE, gfx::kGoogleGreen700); | 227 CreateVectorIcon(kCheckCircleIcon, gfx::kGoogleGreen700); |
229 container->AddRightIcon(check_mark, check_mark.width()); | 228 container->AddRightIcon(check_mark, check_mark.width()); |
230 container->SetRightViewVisible(true); | 229 container->SetRightViewVisible(true); |
231 container->SetAccessiblityState( | 230 container->SetAccessiblityState( |
232 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX); | 231 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX); |
233 } else { | 232 } else { |
234 container->SetAccessiblityState( | 233 container->SetAccessiblityState( |
235 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); | 234 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); |
236 } | 235 } |
237 | 236 |
238 scroll_content()->AddChildView(container); | 237 scroll_content()->AddChildView(container); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 if (detailed_popup_) | 434 if (detailed_popup_) |
436 detailed_popup_->GetWidget()->Close(); | 435 detailed_popup_->GetWidget()->Close(); |
437 if (detailed_menu_) | 436 if (detailed_menu_) |
438 detailed_menu_->GetWidget()->Close(); | 437 detailed_menu_->GetWidget()->Close(); |
439 } | 438 } |
440 | 439 |
441 previous_accessibility_state_ = accessibility_state; | 440 previous_accessibility_state_ = accessibility_state; |
442 } | 441 } |
443 | 442 |
444 } // namespace ash | 443 } // namespace ash |
OLD | NEW |