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

Side by Side Diff: chrome/browser/chromeos/input_method/mode_indicator_controller.h

Issue 796693005: Update {virtual,override,final} to follow C++11 style in chrome/browser/chromeos/input_method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_INPUT_METHOD_MODE_INDICATOR_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MODE_INDICATOR_CONTROLLER_H_
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MODE_INDICATOR_CONTROLLER_H_ 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MODE_INDICATOR_CONTROLLER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "ui/base/ime/chromeos/input_method_manager.h" 9 #include "ui/base/ime/chromeos/input_method_manager.h"
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
11 #include "ui/views/widget/widget_observer.h" 11 #include "ui/views/widget/widget_observer.h"
12 12
13 namespace chromeos { 13 namespace chromeos {
14 namespace input_method { 14 namespace input_method {
15 15
16 class ModeIndicatorObserverInterface : public views::WidgetObserver { 16 class ModeIndicatorObserverInterface : public views::WidgetObserver {
17 public: 17 public:
18 ModeIndicatorObserverInterface() {} 18 ModeIndicatorObserverInterface() {}
19 virtual ~ModeIndicatorObserverInterface() {} 19 ~ModeIndicatorObserverInterface() override {}
20 20
21 virtual void AddModeIndicatorWidget(views::Widget* widget) = 0; 21 virtual void AddModeIndicatorWidget(views::Widget* widget) = 0;
22 }; 22 };
23 23
24 24
25 // ModeIndicatorController is the controller of ModeIndicatiorDelegateView 25 // ModeIndicatorController is the controller of ModeIndicatiorDelegateView
26 // on the MVC model. 26 // on the MVC model.
27 class ModeIndicatorController 27 class ModeIndicatorController
28 : public InputMethodManager::Observer { 28 : public InputMethodManager::Observer {
29 public: 29 public:
30 // This class takes the ownership of |mi_widget|. 30 // This class takes the ownership of |mi_widget|.
31 explicit ModeIndicatorController(InputMethodManager* imm); 31 explicit ModeIndicatorController(InputMethodManager* imm);
32 virtual ~ModeIndicatorController(); 32 ~ModeIndicatorController() override;
33 33
34 // Set cursor bounds, which is the base point to display this indicator. 34 // Set cursor bounds, which is the base point to display this indicator.
35 // Bacisally this indicator is displayed underneath the cursor. 35 // Bacisally this indicator is displayed underneath the cursor.
36 void SetCursorBounds(const gfx::Rect& cursor_location); 36 void SetCursorBounds(const gfx::Rect& cursor_location);
37 37
38 // Notify the focus state to the mode indicator. 38 // Notify the focus state to the mode indicator.
39 void FocusStateChanged(bool is_focused); 39 void FocusStateChanged(bool is_focused);
40 40
41 // Accessor of the widget observer for testing. The caller keeps the 41 // Accessor of the widget observer for testing. The caller keeps the
42 // ownership of the observer object. 42 // ownership of the observer object.
43 static void SetModeIndicatorObserverForTesting( 43 static void SetModeIndicatorObserverForTesting(
44 ModeIndicatorObserverInterface* observer); 44 ModeIndicatorObserverInterface* observer);
45 static ModeIndicatorObserverInterface* GetModeIndicatorObserverForTesting(); 45 static ModeIndicatorObserverInterface* GetModeIndicatorObserverForTesting();
46 46
47 private: 47 private:
48 // InputMethodManager::Observer implementation. 48 // InputMethodManager::Observer implementation.
49 virtual void InputMethodChanged(InputMethodManager* manager, 49 void InputMethodChanged(InputMethodManager* manager,
50 bool show_message) override; 50 bool show_message) override;
51 51
52 // Show the mode inidicator with the current ime's short name if all 52 // Show the mode inidicator with the current ime's short name if all
53 // the conditions are cleared. 53 // the conditions are cleared.
54 void ShowModeIndicator(); 54 void ShowModeIndicator();
55 55
56 InputMethodManager* imm_; 56 InputMethodManager* imm_;
57 57
58 // Cursor bounds representing the anchor rect of the mode indicator. 58 // Cursor bounds representing the anchor rect of the mode indicator.
59 gfx::Rect cursor_bounds_; 59 gfx::Rect cursor_bounds_;
60 60
61 // True on a text field is focused. 61 // True on a text field is focused.
62 bool is_focused_; 62 bool is_focused_;
63 63
64 // Observer of the widgets created by BubbleDelegateView. This is used to 64 // Observer of the widgets created by BubbleDelegateView. This is used to
65 // close the previous widget when a new widget is created. 65 // close the previous widget when a new widget is created.
66 scoped_ptr<ModeIndicatorObserverInterface> mi_observer_; 66 scoped_ptr<ModeIndicatorObserverInterface> mi_observer_;
67 67
68 DISALLOW_COPY_AND_ASSIGN(ModeIndicatorController); 68 DISALLOW_COPY_AND_ASSIGN(ModeIndicatorController);
69 }; 69 };
70 70
71 } // namespace input_method 71 } // namespace input_method
72 } // namespace chromeos 72 } // namespace chromeos
73 73
74 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MODE_INDICATOR_CONTROLLER_H_ 74 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MODE_INDICATOR_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698