| 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/ime/tray_ime_chromeos.h" | 5 #include "ash/common/system/ime/tray_ime_chromeos.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "ash/common/system/tray/tray_popup_item_style.h" | 21 #include "ash/common/system/tray/tray_popup_item_style.h" |
| 22 #include "ash/common/system/tray/tray_utils.h" | 22 #include "ash/common/system/tray/tray_utils.h" |
| 23 #include "ash/common/system/tray_accessibility.h" | 23 #include "ash/common/system/tray_accessibility.h" |
| 24 #include "ash/common/wm_shell.h" | 24 #include "ash/common/wm_shell.h" |
| 25 #include "ash/resources/vector_icons/vector_icons.h" | 25 #include "ash/resources/vector_icons/vector_icons.h" |
| 26 #include "base/logging.h" | 26 #include "base/logging.h" |
| 27 #include "base/strings/utf_string_conversions.h" | 27 #include "base/strings/utf_string_conversions.h" |
| 28 #include "grit/ash_resources.h" | 28 #include "grit/ash_resources.h" |
| 29 #include "grit/ash_strings.h" | 29 #include "grit/ash_strings.h" |
| 30 #include "ui/accessibility/ax_enums.h" | 30 #include "ui/accessibility/ax_enums.h" |
| 31 #include "ui/accessibility/ax_view_state.h" | 31 #include "ui/accessibility/ax_node_data.h" |
| 32 #include "ui/base/resource/resource_bundle.h" | 32 #include "ui/base/resource/resource_bundle.h" |
| 33 #include "ui/gfx/font.h" | 33 #include "ui/gfx/font.h" |
| 34 #include "ui/gfx/image/image.h" | 34 #include "ui/gfx/image/image.h" |
| 35 #include "ui/gfx/paint_vector_icon.h" | 35 #include "ui/gfx/paint_vector_icon.h" |
| 36 #include "ui/keyboard/keyboard_util.h" | 36 #include "ui/keyboard/keyboard_util.h" |
| 37 #include "ui/views/controls/label.h" | 37 #include "ui/views/controls/label.h" |
| 38 #include "ui/views/layout/box_layout.h" | 38 #include "ui/views/layout/box_layout.h" |
| 39 #include "ui/views/widget/widget.h" | 39 #include "ui/views/widget/widget.h" |
| 40 | 40 |
| 41 namespace ash { | 41 namespace ash { |
| 42 namespace tray { | 42 namespace tray { |
| 43 | 43 |
| 44 // A |HoverHighlightView| that uses bold or normal font depending on whether | 44 // A |HoverHighlightView| that uses bold or normal font depending on whether |
| 45 // it is selected. This view exposes itself as a checkbox to the accessibility | 45 // it is selected. This view exposes itself as a checkbox to the accessibility |
| 46 // framework. | 46 // framework. |
| 47 class SelectableHoverHighlightView : public HoverHighlightView { | 47 class SelectableHoverHighlightView : public HoverHighlightView { |
| 48 public: | 48 public: |
| 49 SelectableHoverHighlightView(ViewClickListener* listener, | 49 SelectableHoverHighlightView(ViewClickListener* listener, |
| 50 const base::string16& label, | 50 const base::string16& label, |
| 51 bool selected) | 51 bool selected) |
| 52 : HoverHighlightView(listener), selected_(selected) { | 52 : HoverHighlightView(listener), selected_(selected) { |
| 53 AddLabel(label, gfx::ALIGN_LEFT, selected); | 53 AddLabel(label, gfx::ALIGN_LEFT, selected); |
| 54 } | 54 } |
| 55 | 55 |
| 56 ~SelectableHoverHighlightView() override {} | 56 ~SelectableHoverHighlightView() override {} |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 // Overridden from views::View. | 59 // Overridden from views::View. |
| 60 void GetAccessibleState(ui::AXViewState* state) override { | 60 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { |
| 61 HoverHighlightView::GetAccessibleState(state); | 61 HoverHighlightView::GetAccessibleNodeData(node_data); |
| 62 state->role = ui::AX_ROLE_CHECK_BOX; | 62 node_data->role = ui::AX_ROLE_CHECK_BOX; |
| 63 if (selected_) | 63 if (selected_) |
| 64 state->AddStateFlag(ui::AX_STATE_CHECKED); | 64 node_data->AddStateFlag(ui::AX_STATE_CHECKED); |
| 65 } | 65 } |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 bool selected_; | 68 bool selected_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(SelectableHoverHighlightView); | 70 DISALLOW_COPY_AND_ASSIGN(SelectableHoverHighlightView); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 class IMEDefaultView : public TrayItemMore { | 73 class IMEDefaultView : public TrayItemMore { |
| 74 public: | 74 public: |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 else | 332 else |
| 333 Update(); | 333 Update(); |
| 334 } | 334 } |
| 335 | 335 |
| 336 bool TrayIME::ShouldDefaultViewBeVisible() { | 336 bool TrayIME::ShouldDefaultViewBeVisible() { |
| 337 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 || | 337 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 || |
| 338 ShouldShowKeyboardToggle()); | 338 ShouldShowKeyboardToggle()); |
| 339 } | 339 } |
| 340 | 340 |
| 341 } // namespace ash | 341 } // namespace ash |
| OLD | NEW |