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" |
varkha
2016/08/31 20:28:14
Thanks for removing unused headers.
| |
10 #include "ash/common/system/tray/view_click_listener.h" | |
11 | 10 |
12 namespace ash { | 11 namespace ash { |
13 // The detailed view for showing IME list. | 12 // The detailed view for showing IME list. |
14 class ImeListView : public TrayDetailsView, public ViewClickListener { | 13 class ImeListView : public TrayDetailsView { |
15 public: | 14 public: |
16 enum SingleImeBehavior { | 15 enum SingleImeBehavior { |
17 // Shows the IME menu if there's only one IME in system. | 16 // Shows the IME menu if there's only one IME in system. |
18 SHOW_SINGLE_IME, | 17 SHOW_SINGLE_IME, |
19 // Hides the IME menu if there's only one IME in system. | 18 // Hides the IME menu if there's only one IME in system. |
20 HIDE_SINGLE_IME | 19 HIDE_SINGLE_IME |
21 }; | 20 }; |
22 | 21 |
23 ImeListView(SystemTrayItem* owner, | 22 ImeListView(SystemTrayItem* owner, |
24 bool show_keyboard_toggle, | 23 bool show_keyboard_toggle, |
25 SingleImeBehavior single_ime_behavior); | 24 SingleImeBehavior single_ime_behavior); |
26 | 25 |
27 ~ImeListView() override; | 26 ~ImeListView() override; |
28 | 27 |
29 // Updates the view. | 28 // Updates the view. |
30 virtual void Update(const IMEInfoList& list, | 29 virtual void Update(const IMEInfoList& list, |
31 const IMEPropertyInfoList& property_list, | 30 const IMEPropertyInfoList& property_list, |
32 bool show_keyboard_toggle, | 31 bool show_keyboard_toggle, |
33 SingleImeBehavior single_ime_behavior); | 32 SingleImeBehavior single_ime_behavior); |
34 | 33 |
35 protected: | 34 protected: |
36 // ViewClickListener: | 35 // TrayDetailsView: |
37 void OnViewClicked(views::View* sender) override; | 36 void HandleViewClicked(views::View* view) override; |
38 | 37 |
39 private: | 38 private: |
40 // To allow the test class to access |ime_map_|. | 39 // To allow the test class to access |ime_map_|. |
41 friend class ImeMenuTrayTest; | 40 friend class ImeMenuTrayTest; |
42 | 41 |
43 // Appends the IMEs to the scrollable area of the detailed view. | 42 // Appends the IMEs to the scrollable area of the detailed view. |
44 void AppendIMEList(const IMEInfoList& list); | 43 void AppendIMEList(const IMEInfoList& list); |
45 | 44 |
46 // Appends the IME listed to the scrollable area of the detailed view. | 45 // Appends the IME listed to the scrollable area of the detailed view. |
47 void AppendIMEProperties(const IMEPropertyInfoList& property_list); | 46 void AppendIMEProperties(const IMEPropertyInfoList& property_list); |
48 | 47 |
49 // Appends the on-screen keyboard status to the last area of the detailed | 48 // Appends the on-screen keyboard status to the last area of the detailed |
50 // view. | 49 // view. |
51 void AppendKeyboardStatus(); | 50 void AppendKeyboardStatus(); |
52 | 51 |
53 std::map<views::View*, std::string> ime_map_; | 52 std::map<views::View*, std::string> ime_map_; |
54 std::map<views::View*, std::string> property_map_; | 53 std::map<views::View*, std::string> property_map_; |
55 views::View* keyboard_status_; | 54 views::View* keyboard_status_; |
56 | 55 |
57 DISALLOW_COPY_AND_ASSIGN(ImeListView); | 56 DISALLOW_COPY_AND_ASSIGN(ImeListView); |
58 }; | 57 }; |
59 | 58 |
60 } // namespace ash | 59 } // namespace ash |
61 | 60 |
62 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ | 61 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ |
OLD | NEW |