Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: ash/common/system/chromeos/ime_menu/ime_list_view.h

Issue 2793153004: [Ash] Remove non-MD code from ImeListView and ImeListItemView (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // The detailed view for showing IME list.
17 class ImeListView : public TrayDetailsView { 17 class ImeListView : public TrayDetailsView {
18 public: 18 public:
19 enum SingleImeBehavior { 19 enum SingleImeBehavior {
20 // Shows the IME menu if there's only one IME in system. 20 // Shows the IME menu if there's only one IME in system.
21 SHOW_SINGLE_IME, 21 SHOW_SINGLE_IME,
22 // Hides the IME menu if there's only one IME in system. 22 // Hides the IME menu if there's only one IME in system.
23 HIDE_SINGLE_IME 23 HIDE_SINGLE_IME
24 }; 24 };
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 void HandleViewClicked(views::View* view) override; 60 void HandleViewClicked(views::View* view) override;
61 void HandleButtonPressed(views::Button* sender, 61 void HandleButtonPressed(views::Button* sender,
62 const ui::Event& event) override; 62 const ui::Event& event) override;
63 63
64 // views::View: 64 // views::View:
65 void VisibilityChanged(View* starting_from, bool is_visible) override; 65 void VisibilityChanged(View* starting_from, bool is_visible) override;
66 66
67 private: 67 private:
68 friend class ImeListViewTestApi; 68 friend class ImeListViewTestApi;
69 69
70 // Appends the IMEs to the scrollable area of the detailed view. 70 // 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, 71 void AppendImeListAndProperties(const IMEInfoList& list,
79 const IMEPropertyInfoList& property_list); 72 const IMEPropertyInfoList& property_list);
80 73
81 // Appends the on-screen keyboard status to the last area of the detailed 74 // Initializes |keyboard_status_row_| and adds it above the scrollable list.
82 // view. 75 void PrependKeyboardStatusRow();
83 void AppendKeyboardStatus();
84
85 // Inserts the material on-screen keyboard status in the detailed view.
86 void PrependMaterialKeyboardStatus();
87 76
88 // Requests focus on the current IME if it was selected with keyboard so that 77 // 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. 78 // accessible text will alert the user of the IME change.
90 void FocusCurrentImeIfNeeded(); 79 void FocusCurrentImeIfNeeded();
91 80
92 std::map<views::View*, std::string> ime_map_; 81 std::map<views::View*, std::string> ime_map_;
93 std::map<views::View*, std::string> property_map_; 82 std::map<views::View*, std::string> property_map_;
94 // On-screen keyboard view which is not used in material design. 83 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 84
99 // The id of the last item selected with keyboard. It will be empty if the 85 // The id of the last item selected with keyboard. It will be empty if the
100 // item is not selected with keyboard. 86 // item is not selected with keyboard.
101 std::string last_selected_item_id_; 87 std::string last_selected_item_id_;
102 88
103 // True if the last item is selected with keyboard. 89 // True if the last item is selected with keyboard.
104 bool last_item_selected_with_keyboard_; 90 bool last_item_selected_with_keyboard_;
105 91
106 // True if focus should be requested after switching IMEs with keyboard in 92 // True if focus should be requested after switching IMEs with keyboard in
107 // order to trigger spoken feedback with ChromeVox enabled. 93 // order to trigger spoken feedback with ChromeVox enabled.
(...skipping 18 matching lines...) Expand all
126 112
127 private: 113 private:
128 ImeListView* ime_list_view_; 114 ImeListView* ime_list_view_;
129 115
130 DISALLOW_COPY_AND_ASSIGN(ImeListViewTestApi); 116 DISALLOW_COPY_AND_ASSIGN(ImeListViewTestApi);
131 }; 117 };
132 118
133 } // namespace ash 119 } // namespace ash
134 120
135 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_ 121 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_LIST_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698