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

Side by Side Diff: chrome/browser/chromeos/input_method/mode_indicator_browsertest.cc

Issue 623293003: replace OVERRIDE and FINAL with override and final in chrome/browser/chromeos/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: run git cl format on echo_dialog_view.h Created 6 years, 2 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 #include <algorithm> 5 #include <algorithm>
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "chrome/browser/chromeos/input_method/input_method_util.h" 8 #include "chrome/browser/chromeos/input_method/input_method_util.h"
9 #include "chrome/browser/chromeos/input_method/mode_indicator_controller.h" 9 #include "chrome/browser/chromeos/input_method/mode_indicator_controller.h"
10 #include "chrome/test/base/in_process_browser_test.h" 10 #include "chrome/test/base/in_process_browser_test.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 size_t widget_list_size() const { 53 size_t widget_list_size() const {
54 return widget_list_.size(); 54 return widget_list_.size();
55 } 55 }
56 56
57 size_t max_widget_list_size() const { 57 size_t max_widget_list_size() const {
58 return max_widget_list_size_; 58 return max_widget_list_size_;
59 } 59 }
60 60
61 // ModeIndicatorObserverInterface override: 61 // ModeIndicatorObserverInterface override:
62 virtual void AddModeIndicatorWidget(views::Widget* widget) OVERRIDE { 62 virtual void AddModeIndicatorWidget(views::Widget* widget) override {
63 widget_list_.push_back(widget); 63 widget_list_.push_back(widget);
64 max_widget_list_size_ = 64 max_widget_list_size_ =
65 std::max(max_widget_list_size_, widget_list_.size()); 65 std::max(max_widget_list_size_, widget_list_.size());
66 widget->AddObserver(this); 66 widget->AddObserver(this);
67 } 67 }
68 68
69 // views::WidgetObserver override: 69 // views::WidgetObserver override:
70 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE { 70 virtual void OnWidgetDestroying(views::Widget* widget) override {
71 std::vector<views::Widget*>::iterator it = 71 std::vector<views::Widget*>::iterator it =
72 std::find(widget_list_.begin(), widget_list_.end(), widget); 72 std::find(widget_list_.begin(), widget_list_.end(), widget);
73 if (it != widget_list_.end()) 73 if (it != widget_list_.end())
74 widget_list_.erase(it); 74 widget_list_.erase(it);
75 } 75 }
76 76
77 // views::WidgetObserver override: 77 // views::WidgetObserver override:
78 virtual void OnWidgetVisibilityChanged(views::Widget* widget, 78 virtual void OnWidgetVisibilityChanged(views::Widget* widget,
79 bool visible) OVERRIDE { 79 bool visible) override {
80 last_bounds_ = widget->GetWindowBoundsInScreen(); 80 last_bounds_ = widget->GetWindowBoundsInScreen();
81 is_displayed_ |= visible; 81 is_displayed_ |= visible;
82 } 82 }
83 83
84 private: 84 private:
85 bool is_displayed_; 85 bool is_displayed_;
86 gfx::Rect last_bounds_; 86 gfx::Rect last_bounds_;
87 size_t max_widget_list_size_; 87 size_t max_widget_list_size_;
88 std::vector<views::Widget*> widget_list_; 88 std::vector<views::Widget*> widget_list_;
89 }; 89 };
90 90
91 class ModeIndicatorBrowserTest : public InProcessBrowserTest { 91 class ModeIndicatorBrowserTest : public InProcessBrowserTest {
92 public: 92 public:
93 ModeIndicatorBrowserTest() 93 ModeIndicatorBrowserTest()
94 : InProcessBrowserTest() {} 94 : InProcessBrowserTest() {}
95 virtual ~ModeIndicatorBrowserTest() {} 95 virtual ~ModeIndicatorBrowserTest() {}
96 96
97 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 97 virtual void SetUpInProcessBrowserTestFixture() override {
98 ui::SetUpInputMethodFactoryForTesting(); 98 ui::SetUpInputMethodFactoryForTesting();
99 } 99 }
100 100
101 void InitializeIMF() { 101 void InitializeIMF() {
102 InputMethodManager::Get() 102 InputMethodManager::Get()
103 ->GetInputMethodUtil() 103 ->GetInputMethodUtil()
104 ->InitXkbInputMethodsForTesting(); 104 ->InitXkbInputMethodsForTesting();
105 } 105 }
106 106
107 private: 107 private:
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // When a new mode indicator is displayed, the previous one should be 214 // When a new mode indicator is displayed, the previous one should be
215 // closed. 215 // closed.
216 content::RunAllPendingInMessageLoop(); 216 content::RunAllPendingInMessageLoop();
217 EXPECT_EQ(1UL, observer.widget_list_size()); 217 EXPECT_EQ(1UL, observer.widget_list_size());
218 const views::Widget* widget2 = observer.widget_list()[0]; 218 const views::Widget* widget2 = observer.widget_list()[0];
219 EXPECT_NE(widget1, widget2); 219 EXPECT_NE(widget1, widget2);
220 } 220 }
221 } 221 }
222 } // namespace input_method 222 } // namespace input_method
223 } // namespace chromeos 223 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698