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

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

Issue 6334152: Clean up RTL methods.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 | « views/controls/menu/menu_item_view_win.cc ('k') | views/view.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/examples/widget_example.h" 5 #include "views/examples/widget_example.h"
6 6
7 #include "views/controls/button/native_button.h" 7 #include "views/controls/button/native_button.h"
8 #include "views/layout/box_layout.h" 8 #include "views/layout/box_layout.h"
9 #include "views/layout/layout_manager.h" 9 #include "views/layout/layout_manager.h"
10 #include "views/view.h" 10 #include "views/view.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 views::View* parent, 137 views::View* parent,
138 const views::Widget::TransparencyParam transparency) { 138 const views::Widget::TransparencyParam transparency) {
139 views::Widget* widget = views::Widget::CreatePopupWidget( 139 views::Widget* widget = views::Widget::CreatePopupWidget(
140 transparency, 140 transparency,
141 views::Widget::AcceptEvents, 141 views::Widget::AcceptEvents,
142 views::Widget::DeleteOnDestroy, 142 views::Widget::DeleteOnDestroy,
143 views::Widget::MirrorOriginInRTL); 143 views::Widget::MirrorOriginInRTL);
144 144
145 // Compute where to place the popup widget. 145 // Compute where to place the popup widget.
146 // We'll place it right below the create button. 146 // We'll place it right below the create button.
147 gfx::Point point = parent->GetPosition(); 147 gfx::Point point = parent->GetMirroredPosition();
148 // The position in point is relative to the parent. Make it absolute. 148 // The position in point is relative to the parent. Make it absolute.
149 views::View::ConvertPointToScreen(parent, &point); 149 views::View::ConvertPointToScreen(parent, &point);
150 // Add the height of create_button_. 150 // Add the height of create_button_.
151 point.Offset(0, parent->size().height()); 151 point.Offset(0, parent->size().height());
152 gfx::Rect bounds(point.x(), point.y(), 200, 300); 152 gfx::Rect bounds(point.x(), point.y(), 200, 300);
153 // Initialize the popup widget with the computed bounds. 153 // Initialize the popup widget with the computed bounds.
154 widget->InitWithWidget(parent->GetWidget(), bounds); 154 widget->InitWithWidget(parent->GetWidget(), bounds);
155 InitWidget(widget, transparency); 155 InitWidget(widget, transparency);
156 } 156 }
157 157
(...skipping 14 matching lines...) Expand all
172 CreateChild(sender, views::Widget::Transparent); 172 CreateChild(sender, views::Widget::Transparent);
173 break; 173 break;
174 #endif 174 #endif
175 case CLOSE_WIDGET: 175 case CLOSE_WIDGET:
176 sender->GetWidget()->Close(); 176 sender->GetWidget()->Close();
177 break; 177 break;
178 } 178 }
179 } 179 }
180 180
181 } // namespace examples 181 } // namespace examples
OLDNEW
« no previous file with comments | « views/controls/menu/menu_item_view_win.cc ('k') | views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698