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

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

Issue 2414103003: Added common layout framework for system menu rows. (Closed)
Patch Set: Removed VIEWS_EXPORT from TestLayoutManager and replaced TestView with StaticSizedView. Created 4 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 "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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698