| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ | 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ |
| 6 #define ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ | 6 #define ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/common/system/tray/ime_info.h" | 9 #include "ash/common/system/tray/ime_info.h" |
| 10 #include "ash/common/system/tray/tray_details_view.h" | 10 #include "ash/common/system/tray/tray_details_view.h" |
| 11 #include "ui/views/controls/button/button.h" | 11 #include "ui/views/controls/button/button.h" |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 class MaterialKeyboardStatusRowView; | 14 class KeyboardStatusRow; |
| 15 | 15 |
| 16 // The detailed view for showing IME list. | 16 // Base class used to represent a selecatable list of available IMEs. |
| 17 // Optionally shows a toggle which is used to enable or disable the invocation |
| 18 // of the virtual keyboard. |
| 17 class ImeListView : public TrayDetailsView { | 19 class ImeListView : public TrayDetailsView { |
| 18 public: | 20 public: |
| 19 enum SingleImeBehavior { | 21 enum SingleImeBehavior { |
| 20 // Shows the IME menu if there's only one IME in system. | 22 // Shows the IME menu if there's only one IME in system. |
| 21 SHOW_SINGLE_IME, | 23 SHOW_SINGLE_IME, |
| 22 // Hides the IME menu if there's only one IME in system. | 24 // Hides the IME menu if there's only one IME in system. |
| 23 HIDE_SINGLE_IME | 25 HIDE_SINGLE_IME |
| 24 }; | 26 }; |
| 25 | 27 |
| 26 ImeListView(SystemTrayItem* owner); | 28 ImeListView(SystemTrayItem* owner); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 void HandleViewClicked(views::View* view) override; | 62 void HandleViewClicked(views::View* view) override; |
| 61 void HandleButtonPressed(views::Button* sender, | 63 void HandleButtonPressed(views::Button* sender, |
| 62 const ui::Event& event) override; | 64 const ui::Event& event) override; |
| 63 | 65 |
| 64 // views::View: | 66 // views::View: |
| 65 void VisibilityChanged(View* starting_from, bool is_visible) override; | 67 void VisibilityChanged(View* starting_from, bool is_visible) override; |
| 66 | 68 |
| 67 private: | 69 private: |
| 68 friend class ImeListViewTestApi; | 70 friend class ImeListViewTestApi; |
| 69 | 71 |
| 70 // Appends the IMEs to the scrollable area of the detailed view. | 72 // Appends the IMEs and properties to the IME menu's scrollable area. |
| 71 void AppendIMEList(const IMEInfoList& list); | |
| 72 | |
| 73 // Appends the IME listed to the scrollable area of the detailed view. | |
| 74 void AppendIMEProperties(const IMEPropertyInfoList& property_list); | |
| 75 | |
| 76 // Appends the IMEs and properties to the scrollable area in the material | |
| 77 // design IME menu. | |
| 78 void AppendImeListAndProperties(const IMEInfoList& list, | 73 void AppendImeListAndProperties(const IMEInfoList& list, |
| 79 const IMEPropertyInfoList& property_list); | 74 const IMEPropertyInfoList& property_list); |
| 80 | 75 |
| 81 // Appends the on-screen keyboard status to the last area of the detailed | 76 // Initializes |keyboard_status_row_| and adds it above the scrollable list. |
| 82 // view. | 77 void PrependKeyboardStatusRow(); |
| 83 void AppendKeyboardStatus(); | |
| 84 | |
| 85 // Inserts the material on-screen keyboard status in the detailed view. | |
| 86 void PrependMaterialKeyboardStatus(); | |
| 87 | 78 |
| 88 // Requests focus on the current IME if it was selected with keyboard so that | 79 // Requests focus on the current IME if it was selected with keyboard so that |
| 89 // accessible text will alert the user of the IME change. | 80 // accessible text will alert the user of the IME change. |
| 90 void FocusCurrentImeIfNeeded(); | 81 void FocusCurrentImeIfNeeded(); |
| 91 | 82 |
| 92 std::map<views::View*, std::string> ime_map_; | 83 std::map<views::View*, std::string> ime_map_; |
| 93 std::map<views::View*, std::string> property_map_; | 84 std::map<views::View*, std::string> property_map_; |
| 94 // On-screen keyboard view which is not used in material design. | 85 KeyboardStatusRow* keyboard_status_row_; |
| 95 views::View* keyboard_status_; | |
| 96 // On-screen keyboard view which is only used in material design. | |
| 97 MaterialKeyboardStatusRowView* material_keyboard_status_view_; | |
| 98 | 86 |
| 99 // The id of the last item selected with keyboard. It will be empty if the | 87 // The id of the last item selected with keyboard. It will be empty if the |
| 100 // item is not selected with keyboard. | 88 // item is not selected with keyboard. |
| 101 std::string last_selected_item_id_; | 89 std::string last_selected_item_id_; |
| 102 | 90 |
| 103 // True if the last item is selected with keyboard. | 91 // True if the last item is selected with keyboard. |
| 104 bool last_item_selected_with_keyboard_; | 92 bool last_item_selected_with_keyboard_; |
| 105 | 93 |
| 106 // True if focus should be requested after switching IMEs with keyboard in | 94 // True if focus should be requested after switching IMEs with keyboard in |
| 107 // order to trigger spoken feedback with ChromeVox enabled. | 95 // order to trigger spoken feedback with ChromeVox enabled. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 126 | 114 |
| 127 private: | 115 private: |
| 128 ImeListView* ime_list_view_; | 116 ImeListView* ime_list_view_; |
| 129 | 117 |
| 130 DISALLOW_COPY_AND_ASSIGN(ImeListViewTestApi); | 118 DISALLOW_COPY_AND_ASSIGN(ImeListViewTestApi); |
| 131 }; | 119 }; |
| 132 | 120 |
| 133 } // namespace ash | 121 } // namespace ash |
| 134 | 122 |
| 135 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ | 123 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ |
| OLD | NEW |