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

Side by Side Diff: ui/base/ime/chromeos/input_method_manager.h

Issue 1552743003: Add chrome.inputMethodPrivate.onImeMenuActivationChanged API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ 5 #ifndef UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_
6 #define UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ 6 #define UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // keyboard is used, since it controls its own candidate window. 62 // keyboard is used, since it controls its own candidate window.
63 class CandidateWindowObserver { 63 class CandidateWindowObserver {
64 public: 64 public:
65 virtual ~CandidateWindowObserver() {} 65 virtual ~CandidateWindowObserver() {}
66 // Called when the candidate window is opened. 66 // Called when the candidate window is opened.
67 virtual void CandidateWindowOpened(InputMethodManager* manager) = 0; 67 virtual void CandidateWindowOpened(InputMethodManager* manager) = 0;
68 // Called when the candidate window is closed. 68 // Called when the candidate window is closed.
69 virtual void CandidateWindowClosed(InputMethodManager* manager) = 0; 69 virtual void CandidateWindowClosed(InputMethodManager* manager) = 0;
70 }; 70 };
71 71
72 // ImeMenuObserver is notified of events related to the IME menu on the shelf
73 // bar.
74 class ImeMenuObserver {
75 public:
76 virtual ~ImeMenuObserver() {}
77
78 // Called when the IME menu is activated or deactivated.
79 virtual void ImeMenuActivationChanged(bool is_active) = 0;
80
81 DISALLOW_ASSIGN(ImeMenuObserver);
82 };
83
72 class State : public base::RefCounted<InputMethodManager::State> { 84 class State : public base::RefCounted<InputMethodManager::State> {
73 public: 85 public:
74 // Returns a copy of state. 86 // Returns a copy of state.
75 virtual scoped_refptr<State> Clone() const = 0; 87 virtual scoped_refptr<State> Clone() const = 0;
76 88
77 // Adds an input method extension. This function does not takes ownership of 89 // Adds an input method extension. This function does not takes ownership of
78 // |instance|. 90 // |instance|.
79 virtual void AddInputMethodExtension( 91 virtual void AddInputMethodExtension(
80 const std::string& extension_id, 92 const std::string& extension_id,
81 const InputMethodDescriptors& descriptors, 93 const InputMethodDescriptors& descriptors,
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 static UI_BASE_IME_EXPORT void Shutdown(); 208 static UI_BASE_IME_EXPORT void Shutdown();
197 209
198 // Get the current UI session state (e.g. login screen, lock screen, etc.). 210 // Get the current UI session state (e.g. login screen, lock screen, etc.).
199 virtual UISessionState GetUISessionState() = 0; 211 virtual UISessionState GetUISessionState() = 0;
200 212
201 // Adds an observer to receive notifications of input method related 213 // Adds an observer to receive notifications of input method related
202 // changes as desribed in the Observer class above. 214 // changes as desribed in the Observer class above.
203 virtual void AddObserver(Observer* observer) = 0; 215 virtual void AddObserver(Observer* observer) = 0;
204 virtual void AddCandidateWindowObserver( 216 virtual void AddCandidateWindowObserver(
205 CandidateWindowObserver* observer) = 0; 217 CandidateWindowObserver* observer) = 0;
218 virtual void AddImeMenuObserver(ImeMenuObserver* observer) = 0;
206 virtual void RemoveObserver(Observer* observer) = 0; 219 virtual void RemoveObserver(Observer* observer) = 0;
207 virtual void RemoveCandidateWindowObserver( 220 virtual void RemoveCandidateWindowObserver(
208 CandidateWindowObserver* observer) = 0; 221 CandidateWindowObserver* observer) = 0;
222 virtual void RemoveImeMenuObserver(ImeMenuObserver* observer) = 0;
209 223
210 // Returns all input methods that are supported, including ones not active. 224 // Returns all input methods that are supported, including ones not active.
211 // This function never returns NULL. Note that input method extensions are NOT 225 // This function never returns NULL. Note that input method extensions are NOT
212 // included in the result. 226 // included in the result.
213 virtual scoped_ptr<InputMethodDescriptors> 227 virtual scoped_ptr<InputMethodDescriptors>
214 GetSupportedInputMethods() const = 0; 228 GetSupportedInputMethods() const = 0;
215 229
216 // Activates the input method property specified by the |key|. 230 // Activates the input method property specified by the |key|.
217 virtual void ActivateInputMethodMenuItem(const std::string& key) = 0; 231 virtual void ActivateInputMethodMenuItem(const std::string& key) = 0;
218 232
(...skipping 19 matching lines...) Expand all
238 std::vector<std::string>* input_method_ids) = 0; 252 std::vector<std::string>* input_method_ids) = 0;
239 253
240 // Returns new empty state for the |profile|. 254 // Returns new empty state for the |profile|.
241 virtual scoped_refptr<State> CreateNewState(Profile* profile) = 0; 255 virtual scoped_refptr<State> CreateNewState(Profile* profile) = 0;
242 256
243 // Returns active state. 257 // Returns active state.
244 virtual scoped_refptr<InputMethodManager::State> GetActiveIMEState() = 0; 258 virtual scoped_refptr<InputMethodManager::State> GetActiveIMEState() = 0;
245 259
246 // Replaces active state. 260 // Replaces active state.
247 virtual void SetState(scoped_refptr<State> state) = 0; 261 virtual void SetState(scoped_refptr<State> state) = 0;
262
263 // Activates or deactivates the IME Menu.
264 virtual void ImeMenuActivationChanged(bool is_active) = 0;
248 }; 265 };
249 266
250 } // namespace input_method 267 } // namespace input_method
251 } // namespace chromeos 268 } // namespace chromeos
252 269
253 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ 270 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_
OLDNEW
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698