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

Side by Side Diff: ui/views/widget/root_view_unittest.cc

Issue 623293004: replace OVERRIDE and FINAL with override and final in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master 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
« no previous file with comments | « ui/views/widget/root_view_targeter.h ('k') | ui/views/widget/tooltip_manager_aura.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/widget/root_view.h" 5 #include "ui/views/widget/root_view.h"
6 6
7 #include "ui/views/context_menu_controller.h" 7 #include "ui/views/context_menu_controller.h"
8 #include "ui/views/test/views_test_base.h" 8 #include "ui/views/test/views_test_base.h"
9 #include "ui/views/view_targeter.h" 9 #include "ui/views/view_targeter.h"
10 #include "ui/views/widget/root_view.h" 10 #include "ui/views/widget/root_view.h"
11 11
12 namespace views { 12 namespace views {
13 namespace test { 13 namespace test {
14 14
15 typedef ViewsTestBase RootViewTest; 15 typedef ViewsTestBase RootViewTest;
16 16
17 class DeleteOnKeyEventView : public View { 17 class DeleteOnKeyEventView : public View {
18 public: 18 public:
19 explicit DeleteOnKeyEventView(bool* set_on_key) : set_on_key_(set_on_key) {} 19 explicit DeleteOnKeyEventView(bool* set_on_key) : set_on_key_(set_on_key) {}
20 virtual ~DeleteOnKeyEventView() {} 20 virtual ~DeleteOnKeyEventView() {}
21 21
22 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE { 22 virtual bool OnKeyPressed(const ui::KeyEvent& event) override {
23 *set_on_key_ = true; 23 *set_on_key_ = true;
24 delete this; 24 delete this;
25 return true; 25 return true;
26 } 26 }
27 27
28 private: 28 private:
29 // Set to true in OnKeyPressed(). 29 // Set to true in OnKeyPressed().
30 bool* set_on_key_; 30 bool* set_on_key_;
31 31
32 DISALLOW_COPY_AND_ASSIGN(DeleteOnKeyEventView); 32 DISALLOW_COPY_AND_ASSIGN(DeleteOnKeyEventView);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 void Reset() { 82 void Reset() {
83 show_context_menu_calls_ = 0; 83 show_context_menu_calls_ = 0;
84 menu_source_view_ = NULL; 84 menu_source_view_ = NULL;
85 menu_source_type_ = ui::MENU_SOURCE_NONE; 85 menu_source_type_ = ui::MENU_SOURCE_NONE;
86 } 86 }
87 87
88 // ContextMenuController: 88 // ContextMenuController:
89 virtual void ShowContextMenuForView( 89 virtual void ShowContextMenuForView(
90 View* source, 90 View* source,
91 const gfx::Point& point, 91 const gfx::Point& point,
92 ui::MenuSourceType source_type) OVERRIDE { 92 ui::MenuSourceType source_type) override {
93 show_context_menu_calls_++; 93 show_context_menu_calls_++;
94 menu_source_view_ = source; 94 menu_source_view_ = source;
95 menu_source_type_ = source_type; 95 menu_source_type_ = source_type;
96 } 96 }
97 97
98 private: 98 private:
99 int show_context_menu_calls_; 99 int show_context_menu_calls_;
100 View* menu_source_view_; 100 View* menu_source_view_;
101 ui::MenuSourceType menu_source_type_; 101 ui::MenuSourceType menu_source_type_;
102 102
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 // View which handles all gesture events. 157 // View which handles all gesture events.
158 class GestureHandlingView : public View { 158 class GestureHandlingView : public View {
159 public: 159 public:
160 GestureHandlingView() { 160 GestureHandlingView() {
161 } 161 }
162 162
163 virtual ~GestureHandlingView() { 163 virtual ~GestureHandlingView() {
164 } 164 }
165 165
166 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE { 166 virtual void OnGestureEvent(ui::GestureEvent* event) override {
167 event->SetHandled(); 167 event->SetHandled();
168 } 168 }
169 169
170 private: 170 private:
171 DISALLOW_COPY_AND_ASSIGN(GestureHandlingView); 171 DISALLOW_COPY_AND_ASSIGN(GestureHandlingView);
172 }; 172 };
173 173
174 // Tests that context menus are shown for long press by the post-target handler 174 // Tests that context menus are shown for long press by the post-target handler
175 // installed on the RootView only if the event is targetted at a view which can 175 // installed on the RootView only if the event is targetted at a view which can
176 // show a context menu. 176 // show a context menu.
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 25, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END)); 336 25, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END));
337 details = root_view->OnEventFromSource(&end3); 337 details = root_view->OnEventFromSource(&end3);
338 338
339 EXPECT_FALSE(details.target_destroyed); 339 EXPECT_FALSE(details.target_destroyed);
340 EXPECT_FALSE(details.dispatcher_destroyed); 340 EXPECT_FALSE(details.dispatcher_destroyed);
341 EXPECT_EQ(0, controller.show_context_menu_calls()); 341 EXPECT_EQ(0, controller.show_context_menu_calls());
342 } 342 }
343 343
344 } // namespace test 344 } // namespace test
345 } // namespace views 345 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/root_view_targeter.h ('k') | ui/views/widget/tooltip_manager_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698