Chromium Code Reviews| 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. |
|
tdanderson
2016/12/08 22:56:38
Please update the CL title to something more descr
Azure Wei
2016/12/09 00:23:54
Done.
| |
| 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" |
| 11 | 11 |
| 12 namespace ash { | 12 namespace ash { |
| 13 class MaterialKeyboardStatusRowView; | 13 class MaterialKeyboardStatusRowView; |
| (...skipping 16 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 SetLastItemSelectedWithKeyboard(bool last_item_selected_with_keyboard) { | |
|
tdanderson
2016/12/08 22:56:38
Please use this_naming_style() instead of CamelCas
Azure Wei
2016/12/09 00:23:54
Done. Renamed as set_last_item_selected_with_keybo
| |
| 44 last_item_selected_with_keyboard_ = last_item_selected_with_keyboard; | |
| 45 } | |
| 46 | |
| 47 void SetFocusCurrentIme(const bool focus_current_ime) { | |
| 48 focus_current_ime_ = focus_current_ime; | |
|
tdanderson
2016/12/08 22:56:38
I find the name |focus_current_ime_| a bit ambiguo
Azure Wei
2016/12/09 00:23:54
Done.
| |
| 49 } | |
| 50 | |
| 51 bool focus_current_ime() const { return focus_current_ime_; } | |
| 52 | |
| 40 // TrayDetailsView: | 53 // TrayDetailsView: |
| 41 void HandleViewClicked(views::View* view) override; | 54 void HandleViewClicked(views::View* view) override; |
| 42 void HandleButtonPressed(views::Button* sender, | 55 void HandleButtonPressed(views::Button* sender, |
| 43 const ui::Event& event) override; | 56 const ui::Event& event) override; |
| 44 | 57 |
| 45 private: | 58 private: |
| 46 // To allow the test class to access |ime_map_|. | 59 // To allow the test class to access |ime_map_|. |
| 47 friend class ImeMenuTrayTest; | 60 friend class ImeMenuTrayTest; |
| 48 | 61 |
| 49 // Appends the IMEs to the scrollable area of the detailed view. | 62 // Appends the IMEs to the scrollable area of the detailed view. |
| 50 void AppendIMEList(const IMEInfoList& list); | 63 void AppendIMEList(const IMEInfoList& list); |
| 51 | 64 |
| 52 // Appends the IME listed to the scrollable area of the detailed view. | 65 // Appends the IME listed to the scrollable area of the detailed view. |
| 53 void AppendIMEProperties(const IMEPropertyInfoList& property_list); | 66 void AppendIMEProperties(const IMEPropertyInfoList& property_list); |
| 54 | 67 |
| 55 // Appends the IMEs and properties to the scrollable area in the material | 68 // Appends the IMEs and properties to the scrollable area in the material |
| 56 // design IME menu. | 69 // design IME menu. |
| 57 void AppendImeListAndProperties(const IMEInfoList& list, | 70 void AppendImeListAndProperties(const IMEInfoList& list, |
| 58 const IMEPropertyInfoList& property_list); | 71 const IMEPropertyInfoList& property_list); |
| 59 | 72 |
| 60 // Appends the on-screen keyboard status to the last area of the detailed | 73 // Appends the on-screen keyboard status to the last area of the detailed |
| 61 // view. | 74 // view. |
| 62 void AppendKeyboardStatus(); | 75 void AppendKeyboardStatus(); |
| 63 | 76 |
| 64 // Inserts the material on-screen keyboard status in the detailed view. | 77 // Inserts the material on-screen keyboard status in the detailed view. |
| 65 void PrependMaterialKeyboardStatus(); | 78 void PrependMaterialKeyboardStatus(); |
| 66 | 79 |
| 80 // Requests focus on the current IME if it was selected with keyboard so that | |
| 81 // accessible text will alert the user of the IME change. | |
| 82 void FocusCurrentImeIfNeeded(); | |
| 83 | |
| 67 std::map<views::View*, std::string> ime_map_; | 84 std::map<views::View*, std::string> ime_map_; |
| 68 std::map<views::View*, std::string> property_map_; | 85 std::map<views::View*, std::string> property_map_; |
| 69 // On-screen keyboard view which is not used in material design. | 86 // On-screen keyboard view which is not used in material design. |
| 70 views::View* keyboard_status_; | 87 views::View* keyboard_status_; |
| 71 // On-screen keyboard view which is only used in material design. | 88 // On-screen keyboard view which is only used in material design. |
| 72 MaterialKeyboardStatusRowView* material_keyboard_status_view_; | 89 MaterialKeyboardStatusRowView* material_keyboard_status_view_; |
| 73 | 90 |
| 91 // The id of the last item selected with keyboard. It will be empty if the | |
| 92 // item is not selected with keyboard. | |
| 93 std::string last_selected_item_id_; | |
| 94 | |
| 95 // True if the last item is selected with keyboard. | |
| 96 bool last_item_selected_with_keyboard_; | |
| 97 | |
| 98 // True if supporting automatically focus to the selected IME when switching | |
| 99 // with keyboard. | |
|
tdanderson
2016/12/08 22:56:38
nit: suggested wording: "True if focus should be r
Azure Wei
2016/12/09 00:23:54
Done.
| |
| 100 bool focus_current_ime_; | |
| 101 | |
| 74 DISALLOW_COPY_AND_ASSIGN(ImeListView); | 102 DISALLOW_COPY_AND_ASSIGN(ImeListView); |
| 75 }; | 103 }; |
| 76 | 104 |
| 77 } // namespace ash | 105 } // namespace ash |
| 78 | 106 |
| 79 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ | 107 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ |
| OLD | NEW |