| 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/system/tray_accessibility.h" | 5 #include "ash/system/tray_accessibility.h" |
| 6 | 6 |
| 7 #include "ash/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
| 8 #include "ash/accessibility_types.h" | 8 #include "ash/accessibility_types.h" |
| 9 #include "ash/resources/vector_icons/vector_icons.h" | 9 #include "ash/resources/vector_icons/vector_icons.h" |
| 10 #include "ash/session/session_state_delegate.h" | 10 #include "ash/session/session_state_delegate.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/shell_port.h" | 12 #include "ash/shell_port.h" |
| 13 #include "ash/strings/grit/ash_strings.h" | 13 #include "ash/strings/grit/ash_strings.h" |
| 14 #include "ash/system/tray/hover_highlight_view.h" | 14 #include "ash/system/tray/hover_highlight_view.h" |
| 15 #include "ash/system/tray/system_tray.h" | 15 #include "ash/system/tray/system_tray.h" |
| 16 #include "ash/system/tray/system_tray_controller.h" | 16 #include "ash/system/tray/system_tray_controller.h" |
| 17 #include "ash/system/tray/system_tray_delegate.h" | 17 #include "ash/system/tray/system_tray_delegate.h" |
| 18 #include "ash/system/tray/system_tray_notifier.h" | 18 #include "ash/system/tray/system_tray_notifier.h" |
| 19 #include "ash/system/tray/tray_constants.h" | 19 #include "ash/system/tray/tray_constants.h" |
| 20 #include "ash/system/tray/tray_details_view.h" | 20 #include "ash/system/tray/tray_details_view.h" |
| 21 #include "ash/system/tray/tray_item_more.h" | 21 #include "ash/system/tray/tray_item_more.h" |
| 22 #include "ash/system/tray/tray_popup_item_style.h" | 22 #include "ash/system/tray/tray_popup_item_style.h" |
| 23 #include "ash/system/tray/tray_popup_utils.h" | 23 #include "ash/system/tray/tray_popup_utils.h" |
| 24 #include "ash/system/tray/tri_view.h" | 24 #include "ash/system/tray/tri_view.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/image/image.h" | 28 #include "ui/gfx/image/image.h" |
| 29 #include "ui/gfx/paint_vector_icon.h" | 29 #include "ui/gfx/paint_vector_icon.h" |
| 30 #include "ui/native_theme/native_theme.h" | |
| 31 #include "ui/resources/grit/ui_resources.h" | 30 #include "ui/resources/grit/ui_resources.h" |
| 32 #include "ui/views/background.h" | 31 #include "ui/views/background.h" |
| 33 #include "ui/views/controls/button/custom_button.h" | 32 #include "ui/views/controls/button/custom_button.h" |
| 34 #include "ui/views/controls/image_view.h" | 33 #include "ui/views/controls/image_view.h" |
| 35 #include "ui/views/controls/label.h" | 34 #include "ui/views/controls/label.h" |
| 36 #include "ui/views/controls/separator.h" | 35 #include "ui/views/controls/separator.h" |
| 37 #include "ui/views/layout/box_layout.h" | 36 #include "ui/views/layout/box_layout.h" |
| 38 #include "ui/views/layout/grid_layout.h" | 37 #include "ui/views/layout/grid_layout.h" |
| 39 #include "ui/views/widget/widget.h" | 38 #include "ui/views/widget/widget.h" |
| 40 | 39 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 DISALLOW_COPY_AND_ASSIGN(DefaultAccessibilityView); | 123 DISALLOW_COPY_AND_ASSIGN(DefaultAccessibilityView); |
| 125 }; | 124 }; |
| 126 | 125 |
| 127 //////////////////////////////////////////////////////////////////////////////// | 126 //////////////////////////////////////////////////////////////////////////////// |
| 128 // ash::tray::AccessibilityPopupView | 127 // ash::tray::AccessibilityPopupView |
| 129 | 128 |
| 130 AccessibilityPopupView::AccessibilityPopupView(uint32_t enabled_state_bits) | 129 AccessibilityPopupView::AccessibilityPopupView(uint32_t enabled_state_bits) |
| 131 : label_(CreateLabel(enabled_state_bits)) {} | 130 : label_(CreateLabel(enabled_state_bits)) {} |
| 132 | 131 |
| 133 void AccessibilityPopupView::Init() { | 132 void AccessibilityPopupView::Init() { |
| 134 set_background(views::Background::CreateThemedSolidBackground( | 133 set_background(views::Background::CreateSolidBackground(kBackgroundColor)); |
| 135 this, ui::NativeTheme::kColorId_BubbleBackground)); | |
| 136 | 134 |
| 137 views::GridLayout* layout = new views::GridLayout(this); | 135 views::GridLayout* layout = new views::GridLayout(this); |
| 138 SetLayoutManager(layout); | 136 SetLayoutManager(layout); |
| 139 | 137 |
| 140 views::ImageView* close_button = new views::ImageView(); | 138 views::ImageView* close_button = new views::ImageView(); |
| 141 close_button->SetImage( | 139 close_button->SetImage( |
| 142 ResourceBundle::GetSharedInstance().GetImageSkiaNamed(IDR_MESSAGE_CLOSE)); | 140 ResourceBundle::GetSharedInstance().GetImageSkiaNamed(IDR_MESSAGE_CLOSE)); |
| 143 close_button->SetHorizontalAlignment(views::ImageView::CENTER); | 141 close_button->SetHorizontalAlignment(views::ImageView::CENTER); |
| 144 close_button->SetVerticalAlignment(views::ImageView::CENTER); | 142 close_button->SetVerticalAlignment(views::ImageView::CENTER); |
| 145 | 143 |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 if (detailed_popup_) | 557 if (detailed_popup_) |
| 560 detailed_popup_->GetWidget()->Close(); | 558 detailed_popup_->GetWidget()->Close(); |
| 561 if (detailed_menu_) | 559 if (detailed_menu_) |
| 562 detailed_menu_->GetWidget()->Close(); | 560 detailed_menu_->GetWidget()->Close(); |
| 563 } | 561 } |
| 564 | 562 |
| 565 previous_accessibility_state_ = accessibility_state; | 563 previous_accessibility_state_ = accessibility_state; |
| 566 } | 564 } |
| 567 | 565 |
| 568 } // namespace ash | 566 } // namespace ash |
| OLD | NEW |