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/common/system/tray/ime_info.h" | 8 #include "ash/common/system/tray/ime_info.h" |
9 #include "ash/common/system/tray/tray_details_view.h" | 9 #include "ash/common/system/tray/tray_details_view.h" |
10 #include "ui/views/controls/button/button.h" | 10 #include "ui/views/controls/button/button.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 // Updates the view. | 31 // Updates the view. |
32 virtual void Update(const IMEInfoList& list, | 32 virtual void Update(const IMEInfoList& list, |
33 const IMEPropertyInfoList& property_list, | 33 const IMEPropertyInfoList& property_list, |
34 bool show_keyboard_toggle, | 34 bool show_keyboard_toggle, |
35 SingleImeBehavior single_ime_behavior); | 35 SingleImeBehavior single_ime_behavior); |
36 | 36 |
37 // Removes (and destroys) all child views. | 37 // Removes (and destroys) all child views. |
38 virtual void ResetImeListView(); | 38 virtual void ResetImeListView(); |
39 | 39 |
| 40 // Closes the view. |
| 41 void CloseImeListView(); |
| 42 |
| 43 void set_last_item_selected_with_keyboard( |
| 44 bool last_item_selected_with_keyboard) { |
| 45 last_item_selected_with_keyboard_ = last_item_selected_with_keyboard; |
| 46 } |
| 47 |
| 48 void set_should_focus_ime_after_selection_with_keyboard( |
| 49 const bool focus_current_ime) { |
| 50 should_focus_ime_after_selection_with_keyboard_ = focus_current_ime; |
| 51 } |
| 52 |
| 53 bool should_focus_ime_after_selection_with_keyboard() const { |
| 54 return should_focus_ime_after_selection_with_keyboard_; |
| 55 } |
| 56 |
40 // TrayDetailsView: | 57 // TrayDetailsView: |
41 void HandleViewClicked(views::View* view) override; | 58 void HandleViewClicked(views::View* view) override; |
42 void HandleButtonPressed(views::Button* sender, | 59 void HandleButtonPressed(views::Button* sender, |
43 const ui::Event& event) override; | 60 const ui::Event& event) override; |
44 | 61 |
45 private: | 62 private: |
46 // To allow the test class to access |ime_map_|. | 63 // To allow the test class to access |ime_map_|. |
47 friend class ImeMenuTrayTest; | 64 friend class ImeMenuTrayTest; |
48 | 65 |
49 // Appends the IMEs to the scrollable area of the detailed view. | 66 // Appends the IMEs to the scrollable area of the detailed view. |
50 void AppendIMEList(const IMEInfoList& list); | 67 void AppendIMEList(const IMEInfoList& list); |
51 | 68 |
52 // Appends the IME listed to the scrollable area of the detailed view. | 69 // Appends the IME listed to the scrollable area of the detailed view. |
53 void AppendIMEProperties(const IMEPropertyInfoList& property_list); | 70 void AppendIMEProperties(const IMEPropertyInfoList& property_list); |
54 | 71 |
55 // Appends the IMEs and properties to the scrollable area in the material | 72 // Appends the IMEs and properties to the scrollable area in the material |
56 // design IME menu. | 73 // design IME menu. |
57 void AppendImeListAndProperties(const IMEInfoList& list, | 74 void AppendImeListAndProperties(const IMEInfoList& list, |
58 const IMEPropertyInfoList& property_list); | 75 const IMEPropertyInfoList& property_list); |
59 | 76 |
60 // Appends the on-screen keyboard status to the last area of the detailed | 77 // Appends the on-screen keyboard status to the last area of the detailed |
61 // view. | 78 // view. |
62 void AppendKeyboardStatus(); | 79 void AppendKeyboardStatus(); |
63 | 80 |
64 // Inserts the material on-screen keyboard status in the detailed view. | 81 // Inserts the material on-screen keyboard status in the detailed view. |
65 void PrependMaterialKeyboardStatus(); | 82 void PrependMaterialKeyboardStatus(); |
66 | 83 |
| 84 // Requests focus on the current IME if it was selected with keyboard so that |
| 85 // accessible text will alert the user of the IME change. |
| 86 void FocusCurrentImeIfNeeded(); |
| 87 |
67 std::map<views::View*, std::string> ime_map_; | 88 std::map<views::View*, std::string> ime_map_; |
68 std::map<views::View*, std::string> property_map_; | 89 std::map<views::View*, std::string> property_map_; |
69 // On-screen keyboard view which is not used in material design. | 90 // On-screen keyboard view which is not used in material design. |
70 views::View* keyboard_status_; | 91 views::View* keyboard_status_; |
71 // On-screen keyboard view which is only used in material design. | 92 // On-screen keyboard view which is only used in material design. |
72 MaterialKeyboardStatusRowView* material_keyboard_status_view_; | 93 MaterialKeyboardStatusRowView* material_keyboard_status_view_; |
73 | 94 |
| 95 // The id of the last item selected with keyboard. It will be empty if the |
| 96 // item is not selected with keyboard. |
| 97 std::string last_selected_item_id_; |
| 98 |
| 99 // True if the last item is selected with keyboard. |
| 100 bool last_item_selected_with_keyboard_; |
| 101 |
| 102 // True if focus should be requested after switching IMEs with keyboard in |
| 103 // order to trigger spoken feedback with ChromeVox enabled. |
| 104 bool should_focus_ime_after_selection_with_keyboard_; |
| 105 |
74 DISALLOW_COPY_AND_ASSIGN(ImeListView); | 106 DISALLOW_COPY_AND_ASSIGN(ImeListView); |
75 }; | 107 }; |
76 | 108 |
77 } // namespace ash | 109 } // namespace ash |
78 | 110 |
79 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ | 111 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ |
OLD | NEW |