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

Side by Side Diff: views/ime/input_method_manager.h

Issue 7217008: Use input method to control visibility of virtual keyboard (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef VIEWS_IME_INPUT_METHOD_MANAGER_H_
6 #define VIEWS_IME_INPUT_METHOD_MANAGER_H_
7 #pragma once
8
9 #include "base/memory/singleton.h"
10 #include "base/observer_list.h"
11 #include "ui/base/ime/text_input_type.h"
12
13 namespace views {
14
15 class View;
James Su 2011/07/07 02:03:03 nit: remove this line.
Peng 2011/07/07 17:56:54 Done.
16 class Widget;
17
18 class TextInputTypeChangedListener {
James Su 2011/07/07 02:03:03 nit: How about call it TextInputTypeObserver? And
Peng 2011/07/07 17:56:54 Done.
19 public:
20 virtual void TextInputTypeChanged(ui::TextInputType type, Widget* widget) = 0;
James Su 2011/07/07 02:03:03 nit: Add some comment? e.g. clarify in what situat
Peng 2011/07/07 17:56:54 Done.
21
22 protected:
23 virtual ~TextInputTypeChangedListener() {}
24 };
25
26 class InputMethodManager {
James Su 2011/07/07 02:03:03 How about to rename this class to something more s
27 public:
28 // Returns the singleton instance.
29 static InputMethodManager* GetInstance();
30
31 // Adds/removes a TextInputTypeChangedListener |listener| to the set of
32 // active listeners.
33 void AddTextInputTypeChangedListener(TextInputTypeChangedListener* listener);
James Su 2011/07/07 02:03:03 nit: AddTextInputTypeObserver(...);
Peng 2011/07/07 17:56:54 Done.
34 void RemoveTextInputTypeChangedListener(
James Su 2011/07/07 02:03:03 ditto
Peng 2011/07/07 17:56:54 Done.
35 TextInputTypeChangedListener* listener);
36
37 void OnTextInputTypeChanged(ui::TextInputType type, Widget* widget);
James Su 2011/07/07 02:03:03 nit: add comment to clarify whom will call this me
Peng 2011/07/07 17:56:54 Done.
38
39 private:
40 InputMethodManager();
41 ~InputMethodManager();
42
43 ObserverList<TextInputTypeChangedListener> text_input_type_changed_listeners_;
44
45 friend struct DefaultSingletonTraits<InputMethodManager>;
46 DISALLOW_COPY_AND_ASSIGN(InputMethodManager);
47 };
48
49 } // namespace views
50
51 #endif // VIEWS_IME_INPUT_METHOD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698