OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_CHROMEOS_STATUS_INPUT_METHOD_MENU_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_INPUT_METHOD_MENU_H_ |
6 #define CHROME_BROWSER_CHROMEOS_STATUS_INPUT_METHOD_MENU_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_INPUT_METHOD_MENU_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 class PrefService; | 21 class PrefService; |
22 class SkBitmap; | 22 class SkBitmap; |
23 | 23 |
24 namespace ui { | 24 namespace ui { |
25 class SimpleMenuModel; | 25 class SimpleMenuModel; |
26 } // namespace ui | 26 } // namespace ui |
27 | 27 |
28 namespace views { | 28 namespace views { |
29 class MenuItemView; | 29 class MenuItemView; |
30 class MenuModelAdapter; | 30 class MenuModelAdapter; |
| 31 class MenuRunner; |
31 } // namespace views | 32 } // namespace views |
32 | 33 |
33 namespace chromeos { | 34 namespace chromeos { |
34 | 35 |
35 // A class for the dropdown menu for switching input method and keyboard layout. | 36 // A class for the dropdown menu for switching input method and keyboard layout. |
36 // Since the class provides the views::ViewMenuDelegate interface, it's easy to | 37 // Since the class provides the views::ViewMenuDelegate interface, it's easy to |
37 // create a button widget (e.g. views::MenuButton, chromeos::StatusAreaButton) | 38 // create a button widget (e.g. views::MenuButton, chromeos::StatusAreaButton) |
38 // which shows the dropdown menu on click. | 39 // which shows the dropdown menu on click. |
39 class InputMethodMenu : public views::ViewMenuDelegate, | 40 class InputMethodMenu : public views::ViewMenuDelegate, |
40 public ui::MenuModel, | 41 public ui::MenuModel, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // Objects for reading/writing the Chrome prefs. | 167 // Objects for reading/writing the Chrome prefs. |
167 StringPrefMember previous_input_method_pref_; | 168 StringPrefMember previous_input_method_pref_; |
168 StringPrefMember current_input_method_pref_; | 169 StringPrefMember current_input_method_pref_; |
169 | 170 |
170 // We borrow ui::SimpleMenuModel implementation to maintain the current | 171 // We borrow ui::SimpleMenuModel implementation to maintain the current |
171 // content of the pop-up menu. The ui::MenuModel is implemented using this | 172 // content of the pop-up menu. The ui::MenuModel is implemented using this |
172 // |model_|. The MenuModelAdapter wraps the model with the | 173 // |model_|. The MenuModelAdapter wraps the model with the |
173 // views::MenuDelegate interface required for MenuItemView. | 174 // views::MenuDelegate interface required for MenuItemView. |
174 scoped_ptr<ui::SimpleMenuModel> model_; | 175 scoped_ptr<ui::SimpleMenuModel> model_; |
175 scoped_ptr<views::MenuModelAdapter> input_method_menu_delegate_; | 176 scoped_ptr<views::MenuModelAdapter> input_method_menu_delegate_; |
176 scoped_ptr<views::MenuItemView> input_method_menu_; | 177 views::MenuItemView* input_method_menu_; |
| 178 scoped_ptr<views::MenuRunner> input_method_menu_runner_; |
177 | 179 |
178 int minimum_input_method_menu_width_; | 180 int minimum_input_method_menu_width_; |
179 | 181 |
180 // Menu alignment (default TOPRIGHT). | 182 // Menu alignment (default TOPRIGHT). |
181 views::MenuItemView::AnchorPosition menu_alignment_; | 183 views::MenuItemView::AnchorPosition menu_alignment_; |
182 | 184 |
183 PrefService* pref_service_; | 185 PrefService* pref_service_; |
184 NotificationRegistrar registrar_; | 186 NotificationRegistrar registrar_; |
185 | 187 |
186 // The mode of the host screen (e.g. browser, screen locker, login screen.) | 188 // The mode of the host screen (e.g. browser, screen locker, login screen.) |
187 const StatusAreaHost::ScreenMode screen_mode_; | 189 const StatusAreaHost::ScreenMode screen_mode_; |
188 // true if the menu is for a dialog in OOBE screen. In the dialog, we don't | 190 // true if the menu is for a dialog in OOBE screen. In the dialog, we don't |
189 // use radio buttons. | 191 // use radio buttons. |
190 const bool for_out_of_box_experience_dialog_; | 192 const bool for_out_of_box_experience_dialog_; |
191 | 193 |
192 DISALLOW_COPY_AND_ASSIGN(InputMethodMenu); | 194 DISALLOW_COPY_AND_ASSIGN(InputMethodMenu); |
193 }; | 195 }; |
194 | 196 |
195 } // namespace chromeos | 197 } // namespace chromeos |
196 | 198 |
197 #endif // CHROME_BROWSER_CHROMEOS_STATUS_INPUT_METHOD_MENU_H_ | 199 #endif // CHROME_BROWSER_CHROMEOS_STATUS_INPUT_METHOD_MENU_H_ |
OLD | NEW |