OLD | NEW |
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 |
11 namespace views { | 11 namespace views { |
12 | 12 |
| 13 StaticSizedView::StaticSizedView() : StaticSizedView(gfx::Size()) {} |
| 14 |
13 StaticSizedView::StaticSizedView(const gfx::Size& size) | 15 StaticSizedView::StaticSizedView(const gfx::Size& size) |
14 // Default GetMinimumSize() is GetPreferredSize(). Default GetMaximumSize() | 16 // Default GetMinimumSize() is GetPreferredSize(). Default GetMaximumSize() |
15 // is 0x0. | 17 // is 0x0. |
16 : size_(size), | 18 : size_(size), |
17 minimum_size_(size) { | 19 minimum_size_(size) { |
18 } | 20 } |
19 | 21 |
20 StaticSizedView::~StaticSizedView() {} | 22 StaticSizedView::~StaticSizedView() {} |
21 | 23 |
22 gfx::Size StaticSizedView::GetPreferredSize() const { | 24 gfx::Size StaticSizedView::GetPreferredSize() const { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 102 } |
101 | 103 |
102 void EventCountView::RecordEvent(ui::Event* event) { | 104 void EventCountView::RecordEvent(ui::Event* event) { |
103 ++event_count_[event->type()]; | 105 ++event_count_[event->type()]; |
104 last_flags_ = event->flags(); | 106 last_flags_ = event->flags(); |
105 if (handle_mode_ == CONSUME_EVENTS) | 107 if (handle_mode_ == CONSUME_EVENTS) |
106 event->SetHandled(); | 108 event->SetHandled(); |
107 } | 109 } |
108 | 110 |
109 } // namespace views | 111 } // namespace views |
OLD | NEW |