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

Side by Side Diff: ui/views/examples/widget_example.cc

Issue 10827271: Replace views::Event with ui::Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/examples/widget_example.h ('k') | ui/views/touchui/touch_selection_controller_impl.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/examples/widget_example.h" 5 #include "ui/views/examples/widget_example.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "ui/views/controls/button/text_button.h" 8 #include "ui/views/controls/button/text_button.h"
9 #include "ui/views/layout/box_layout.h" 9 #include "ui/views/layout/box_layout.h"
10 #include "ui/views/layout/layout_manager.h" 10 #include "ui/views/layout/layout_manager.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 // Initialize the popup widget with the computed bounds. 136 // Initialize the popup widget with the computed bounds.
137 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); 137 Widget::InitParams params(Widget::InitParams::TYPE_POPUP);
138 params.transparent = transparent; 138 params.transparent = transparent;
139 params.parent_widget = parent->GetWidget(); 139 params.parent_widget = parent->GetWidget();
140 params.bounds = gfx::Rect(point.x(), point.y(), 200, 300); 140 params.bounds = gfx::Rect(point.x(), point.y(), 200, 300);
141 widget->Init(params); 141 widget->Init(params);
142 InitWidget(widget, transparent); 142 InitWidget(widget, transparent);
143 } 143 }
144 144
145 void WidgetExample::ButtonPressed(Button* sender, const Event& event) { 145 void WidgetExample::ButtonPressed(Button* sender, const ui::Event& event) {
146 switch (sender->tag()) { 146 switch (sender->tag()) {
147 case POPUP: 147 case POPUP:
148 CreatePopup(sender, false); 148 CreatePopup(sender, false);
149 break; 149 break;
150 case TRANSPARENT_POPUP: 150 case TRANSPARENT_POPUP:
151 CreatePopup(sender, true); 151 CreatePopup(sender, true);
152 break; 152 break;
153 #if defined(OS_LINUX) 153 #if defined(OS_LINUX)
154 case CHILD: 154 case CHILD:
155 CreateChild(sender, false); 155 CreateChild(sender, false);
156 break; 156 break;
157 case TRANSPARENT_CHILD: 157 case TRANSPARENT_CHILD:
158 CreateChild(sender, true); 158 CreateChild(sender, true);
159 break; 159 break;
160 #endif 160 #endif
161 case CLOSE_WIDGET: 161 case CLOSE_WIDGET:
162 sender->GetWidget()->Close(); 162 sender->GetWidget()->Close();
163 break; 163 break;
164 } 164 }
165 } 165 }
166 166
167 } // namespace examples 167 } // namespace examples
168 } // namespace views 168 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/widget_example.h ('k') | ui/views/touchui/touch_selection_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698