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" |
11 | 11 |
12 namespace ash { | 12 namespace ash { |
13 class MaterialKeyboardStatusRowView; | 13 class MaterialKeyboardStatusRowView; |
14 | 14 |
15 // The detailed view for showing IME list. | 15 // The detailed view for showing IME list. |
16 class ImeListView : public TrayDetailsView { | 16 class ImeListView : public TrayDetailsView { |
17 public: | 17 public: |
18 enum SingleImeBehavior { | 18 enum SingleImeBehavior { |
19 // Shows the IME menu if there's only one IME in system. | 19 // Shows the IME menu if there's only one IME in system. |
20 SHOW_SINGLE_IME, | 20 SHOW_SINGLE_IME, |
21 // Hides the IME menu if there's only one IME in system. | 21 // Hides the IME menu if there's only one IME in system. |
22 HIDE_SINGLE_IME | 22 HIDE_SINGLE_IME |
23 }; | 23 }; |
24 | 24 |
25 ImeListView(SystemTrayItem* owner, | 25 ImeListView(SystemTrayItem* owner, |
tdanderson
2016/12/08 00:42:11
Changes to ImeListView will also affect the IME de
Azure Wei
2016/12/08 13:14:55
Added a new bool member ImeListView::focus_current
tdanderson
2016/12/08 22:56:37
Thanks. Now that I try it out, I see that this is
| |
26 bool show_keyboard_toggle, | 26 bool show_keyboard_toggle, |
27 SingleImeBehavior single_ime_behavior); | 27 SingleImeBehavior single_ime_behavior); |
28 | 28 |
29 ~ImeListView() override; | 29 ~ImeListView() override; |
30 | 30 |
31 // Focuses to the current IME if the IME is selected with keyboard. | |
tdanderson
2016/12/08 00:42:11
I think you can make this private. Also it would b
Azure Wei
2016/12/08 13:14:55
Done.
| |
32 void FocusCurrentImeIfNeeded(); | |
33 | |
31 // Updates the view. | 34 // Updates the view. |
32 virtual void Update(const IMEInfoList& list, | 35 virtual void Update(const IMEInfoList& list, |
33 const IMEPropertyInfoList& property_list, | 36 const IMEPropertyInfoList& property_list, |
34 bool show_keyboard_toggle, | 37 bool show_keyboard_toggle, |
35 SingleImeBehavior single_ime_behavior); | 38 SingleImeBehavior single_ime_behavior); |
36 | 39 |
37 // Removes (and destroys) all child views. | 40 // Removes (and destroys) all child views. |
38 virtual void ResetImeListView(); | 41 virtual void ResetImeListView(); |
39 | 42 |
43 // Handles the event that a view has been pressed. | |
44 void HandleViewPressed(views::View* view); | |
tdanderson
2016/12/08 00:42:11
I think this can be made private. And to avoid con
Azure Wei
2016/12/08 13:14:55
This is declared public since it's called by ImeLi
tdanderson
2016/12/08 22:56:37
Acknowledged.
| |
45 | |
40 // TrayDetailsView: | 46 // TrayDetailsView: |
41 void HandleViewClicked(views::View* view) override; | 47 void HandleViewClicked(views::View* view) override; |
42 void HandleButtonPressed(views::Button* sender, | 48 void HandleButtonPressed(views::Button* sender, |
43 const ui::Event& event) override; | 49 const ui::Event& event) override; |
44 | 50 |
45 private: | 51 private: |
46 // To allow the test class to access |ime_map_|. | 52 // To allow the test class to access |ime_map_|. |
47 friend class ImeMenuTrayTest; | 53 friend class ImeMenuTrayTest; |
48 | 54 |
49 // Appends the IMEs to the scrollable area of the detailed view. | 55 // Appends the IMEs to the scrollable area of the detailed view. |
(...skipping 13 matching lines...) Expand all Loading... | |
63 | 69 |
64 // Inserts the material on-screen keyboard status in the detailed view. | 70 // Inserts the material on-screen keyboard status in the detailed view. |
65 void PrependMaterialKeyboardStatus(); | 71 void PrependMaterialKeyboardStatus(); |
66 | 72 |
67 std::map<views::View*, std::string> ime_map_; | 73 std::map<views::View*, std::string> ime_map_; |
68 std::map<views::View*, std::string> property_map_; | 74 std::map<views::View*, std::string> property_map_; |
69 // On-screen keyboard view which is not used in material design. | 75 // On-screen keyboard view which is not used in material design. |
70 views::View* keyboard_status_; | 76 views::View* keyboard_status_; |
71 // On-screen keyboard view which is only used in material design. | 77 // On-screen keyboard view which is only used in material design. |
72 MaterialKeyboardStatusRowView* material_keyboard_status_view_; | 78 MaterialKeyboardStatusRowView* material_keyboard_status_view_; |
79 std::string last_pressed_item_id_; | |
73 | 80 |
74 DISALLOW_COPY_AND_ASSIGN(ImeListView); | 81 DISALLOW_COPY_AND_ASSIGN(ImeListView); |
75 }; | 82 }; |
76 | 83 |
77 } // namespace ash | 84 } // namespace ash |
78 | 85 |
79 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ | 86 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ |
OLD | NEW |