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 |
| 11 #include "base/compiler_specific.h" |
11 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 12 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
12 #include "chrome/browser/chromeos/status/status_area_view_chromeos.h" | 13 #include "chrome/browser/chromeos/status/status_area_view_chromeos.h" |
13 #include "chrome/browser/prefs/pref_member.h" | 14 #include "chrome/browser/prefs/pref_member.h" |
14 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
16 #include "content/public/browser/notification_types.h" | 17 #include "content/public/browser/notification_types.h" |
17 #include "ui/base/models/menu_model.h" | 18 #include "ui/base/models/menu_model.h" |
18 #include "views/controls/menu/menu_item_view.h" | 19 #include "views/controls/menu/menu_item_view.h" |
19 #include "views/controls/menu/view_menu_delegate.h" | 20 #include "views/controls/menu/view_menu_delegate.h" |
20 | 21 |
(...skipping 22 matching lines...) Expand all Loading... |
43 public input_method::InputMethodManager::Observer, | 44 public input_method::InputMethodManager::Observer, |
44 public input_method::InputMethodManager::PreferenceObserver, | 45 public input_method::InputMethodManager::PreferenceObserver, |
45 public content::NotificationObserver { | 46 public content::NotificationObserver { |
46 public: | 47 public: |
47 InputMethodMenu(PrefService* pref_service, | 48 InputMethodMenu(PrefService* pref_service, |
48 StatusAreaViewChromeos::ScreenMode screen_mode, | 49 StatusAreaViewChromeos::ScreenMode screen_mode, |
49 bool for_out_of_box_experience_dialog); | 50 bool for_out_of_box_experience_dialog); |
50 virtual ~InputMethodMenu(); | 51 virtual ~InputMethodMenu(); |
51 | 52 |
52 // ui::MenuModel implementation. | 53 // ui::MenuModel implementation. |
53 virtual bool HasIcons() const; | 54 virtual bool HasIcons() const OVERRIDE; |
54 virtual int GetItemCount() const; | 55 virtual int GetItemCount() const OVERRIDE; |
55 virtual ui::MenuModel::ItemType GetTypeAt(int index) const; | 56 virtual ui::MenuModel::ItemType GetTypeAt(int index) const OVERRIDE; |
56 virtual int GetCommandIdAt(int index) const; | 57 virtual int GetCommandIdAt(int index) const OVERRIDE; |
57 virtual string16 GetLabelAt(int index) const; | 58 virtual string16 GetLabelAt(int index) const OVERRIDE; |
58 virtual bool IsItemDynamicAt(int index) const; | 59 virtual bool IsItemDynamicAt(int index) const OVERRIDE; |
59 virtual bool GetAcceleratorAt(int index, | 60 virtual bool GetAcceleratorAt(int index, |
60 ui::Accelerator* accelerator) const; | 61 ui::Accelerator* accelerator) const OVERRIDE; |
61 virtual bool IsItemCheckedAt(int index) const; | 62 virtual bool IsItemCheckedAt(int index) const OVERRIDE; |
62 virtual int GetGroupIdAt(int index) const; | 63 virtual int GetGroupIdAt(int index) const OVERRIDE; |
63 virtual bool GetIconAt(int index, SkBitmap* icon); | 64 virtual bool GetIconAt(int index, SkBitmap* icon) OVERRIDE; |
64 virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const; | 65 virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt( |
65 virtual bool IsEnabledAt(int index) const; | 66 int index) const OVERRIDE; |
66 virtual ui::MenuModel* GetSubmenuModelAt(int index) const; | 67 virtual bool IsEnabledAt(int index) const OVERRIDE; |
67 virtual void HighlightChangedTo(int index); | 68 virtual ui::MenuModel* GetSubmenuModelAt(int index) const OVERRIDE; |
68 virtual void ActivatedAt(int index); | 69 virtual void HighlightChangedTo(int index) OVERRIDE; |
69 virtual void MenuWillShow(); | 70 virtual void ActivatedAt(int index) OVERRIDE; |
70 virtual void SetMenuModelDelegate(ui::MenuModelDelegate* delegate); | 71 virtual void MenuWillShow() OVERRIDE; |
| 72 virtual void SetMenuModelDelegate(ui::MenuModelDelegate* delegate) OVERRIDE; |
71 | 73 |
72 // views::ViewMenuDelegate implementation. Sub classes can override the method | 74 // views::ViewMenuDelegate implementation. Sub classes can override the method |
73 // to adjust the position of the menu. | 75 // to adjust the position of the menu. |
74 virtual void RunMenu(views::View* source, const gfx::Point& pt); | 76 virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE; |
75 | 77 |
76 // InputMethodManager::Observer implementation. | 78 // InputMethodManager::Observer implementation. |
77 virtual void InputMethodChanged( | 79 virtual void InputMethodChanged( |
78 input_method::InputMethodManager* manager, | 80 input_method::InputMethodManager* manager, |
79 const input_method::InputMethodDescriptor& current_input_method, | 81 const input_method::InputMethodDescriptor& current_input_method, |
80 size_t num_active_input_methods); | 82 size_t num_active_input_methods) OVERRIDE; |
81 virtual void ActiveInputMethodsChanged( | 83 virtual void ActiveInputMethodsChanged( |
82 input_method::InputMethodManager* manager, | 84 input_method::InputMethodManager* manager, |
83 const input_method::InputMethodDescriptor& current_input_method, | 85 const input_method::InputMethodDescriptor& current_input_method, |
84 size_t num_active_input_methods); | 86 size_t num_active_input_methods) OVERRIDE; |
85 virtual void PropertyListChanged( | 87 virtual void PropertyListChanged( |
86 input_method::InputMethodManager* manager, | 88 input_method::InputMethodManager* manager, |
87 const input_method::ImePropertyList& current_ime_properties); | 89 const input_method::ImePropertyList& current_ime_properties) OVERRIDE; |
88 | 90 |
89 // InputMethodManager::PreferenceObserver implementation. | 91 // InputMethodManager::PreferenceObserver implementation. |
90 virtual void PreferenceUpdateNeeded( | 92 virtual void PreferenceUpdateNeeded( |
91 input_method::InputMethodManager* manager, | 93 input_method::InputMethodManager* manager, |
92 const input_method::InputMethodDescriptor& previous_input_method, | 94 const input_method::InputMethodDescriptor& previous_input_method, |
93 const input_method::InputMethodDescriptor& current_input_method); | 95 const input_method::InputMethodDescriptor& current_input_method) OVERRIDE; |
94 virtual void FirstObserverIsAdded(input_method::InputMethodManager* manager); | 96 virtual void FirstObserverIsAdded( |
| 97 input_method::InputMethodManager* manager) OVERRIDE; |
95 | 98 |
96 // content::NotificationObserver implementation. | 99 // content::NotificationObserver implementation. |
97 virtual void Observe(int type, | 100 virtual void Observe(int type, |
98 const content::NotificationSource& source, | 101 const content::NotificationSource& source, |
99 const content::NotificationDetails& details); | 102 const content::NotificationDetails& details) OVERRIDE; |
100 | 103 |
101 // Specify menu alignment (default TOPRIGHT). | 104 // Specify menu alignment (default TOPRIGHT). |
102 void set_menu_alignment(views::MenuItemView::AnchorPosition menu_alignment) { | 105 void set_menu_alignment(views::MenuItemView::AnchorPosition menu_alignment) { |
103 menu_alignment_ = menu_alignment; | 106 menu_alignment_ = menu_alignment; |
104 } | 107 } |
105 | 108 |
106 // Sets the minimum width of the dropdown menu. | 109 // Sets the minimum width of the dropdown menu. |
107 void SetMinimumWidth(int width); | 110 void SetMinimumWidth(int width); |
108 | 111 |
109 // Rebuilds menu model. | 112 // Rebuilds menu model. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // true if the menu is for a dialog in OOBE screen. In the dialog, we don't | 200 // true if the menu is for a dialog in OOBE screen. In the dialog, we don't |
198 // use radio buttons. | 201 // use radio buttons. |
199 const bool for_out_of_box_experience_dialog_; | 202 const bool for_out_of_box_experience_dialog_; |
200 | 203 |
201 DISALLOW_COPY_AND_ASSIGN(InputMethodMenu); | 204 DISALLOW_COPY_AND_ASSIGN(InputMethodMenu); |
202 }; | 205 }; |
203 | 206 |
204 } // namespace chromeos | 207 } // namespace chromeos |
205 | 208 |
206 #endif // CHROME_BROWSER_CHROMEOS_STATUS_INPUT_METHOD_MENU_H_ | 209 #endif // CHROME_BROWSER_CHROMEOS_STATUS_INPUT_METHOD_MENU_H_ |
OLD | NEW |