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

Side by Side Diff: ui/views/test/test_views.cc

Issue 2488393003: Changes views_aura_mus_unittests to create DesktopNativeWidgetAura (Closed)
Patch Set: remove this and fix mac Created 4 years, 1 month 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/test/test_platform_native_widget.h ('k') | ui/views/test/views_test_base.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/test/test_views.h" 5 #include "ui/views/test/test_views.h"
6 6
7 #include "ui/events/event.h" 7 #include "ui/events/event.h"
8 #include "ui/views/widget/native_widget_private.h" 8 #include "ui/views/widget/native_widget_private.h"
9 #include "ui/views/widget/widget.h" 9 #include "ui/views/widget/widget.h"
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 CloseWidgetView::CloseWidgetView(ui::EventType event_type) 48 CloseWidgetView::CloseWidgetView(ui::EventType event_type)
49 : event_type_(event_type) { 49 : event_type_(event_type) {
50 } 50 }
51 51
52 void CloseWidgetView::OnEvent(ui::Event* event) { 52 void CloseWidgetView::OnEvent(ui::Event* event) {
53 if (event->type() == event_type_) { 53 if (event->type() == event_type_) {
54 // Go through NativeWidgetPrivate to simulate what happens if the OS 54 // Go through NativeWidgetPrivate to simulate what happens if the OS
55 // deletes the NativeWindow out from under us. 55 // deletes the NativeWindow out from under us.
56 // TODO(tapted): Change this to WidgetTest::SimulateNativeDestroy for a more 56 // TODO(tapted): Change this to ViewsTestBase::SimulateNativeDestroy for a
57 // authentic test on Mac. 57 // more authentic test on Mac.
58 GetWidget()->native_widget_private()->CloseNow(); 58 GetWidget()->native_widget_private()->CloseNow();
59 } else { 59 } else {
60 View::OnEvent(event); 60 View::OnEvent(event);
61 if (!event->IsTouchEvent()) 61 if (!event->IsTouchEvent())
62 event->SetHandled(); 62 event->SetHandled();
63 } 63 }
64 } 64 }
65 65
66 EventCountView::EventCountView() 66 EventCountView::EventCountView()
67 : last_flags_(0), handle_mode_(PROPAGATE_EVENTS) {} 67 : last_flags_(0), handle_mode_(PROPAGATE_EVENTS) {}
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 100
101 void EventCountView::RecordEvent(ui::Event* event) { 101 void EventCountView::RecordEvent(ui::Event* event) {
102 ++event_count_[event->type()]; 102 ++event_count_[event->type()];
103 last_flags_ = event->flags(); 103 last_flags_ = event->flags();
104 if (handle_mode_ == CONSUME_EVENTS) 104 if (handle_mode_ == CONSUME_EVENTS)
105 event->SetHandled(); 105 event->SetHandled();
106 } 106 }
107 107
108 } // namespace views 108 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/test/test_platform_native_widget.h ('k') | ui/views/test/views_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698