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