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

Side by Side Diff: ui/views/widget/widget.cc

Issue 319013002: Reland Fix Views web-modal dialog widget creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert MediaGalleriesScanResultDialogViews::AcceptDialogForTesting. Created 6 years, 6 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/widget/widget.h ('k') | ui/views/window/dialog_delegate.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) 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/widget/widget.h" 5 #include "ui/views/widget/widget.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 Widget* widget = new Widget; 236 Widget* widget = new Widget;
237 Widget::InitParams params; 237 Widget::InitParams params;
238 params.delegate = delegate; 238 params.delegate = delegate;
239 params.context = context; 239 params.context = context;
240 params.bounds = bounds; 240 params.bounds = bounds;
241 widget->Init(params); 241 widget->Init(params);
242 return widget; 242 return widget;
243 } 243 }
244 244
245 // static 245 // static
246 Widget* Widget::CreateWindowAsFramelessChild(WidgetDelegate* widget_delegate,
247 gfx::NativeView parent) {
248 views::Widget* widget = new views::Widget;
249
250 views::Widget::InitParams params;
251 params.delegate = widget_delegate;
252 params.child = true;
253 params.parent = parent;
254 params.remove_standard_frame = true;
255 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
256
257 widget->Init(params);
258 return widget;
259 }
260
261 // static
262 Widget* Widget::GetWidgetForNativeView(gfx::NativeView native_view) { 246 Widget* Widget::GetWidgetForNativeView(gfx::NativeView native_view) {
263 internal::NativeWidgetPrivate* native_widget = 247 internal::NativeWidgetPrivate* native_widget =
264 internal::NativeWidgetPrivate::GetNativeWidgetForNativeView(native_view); 248 internal::NativeWidgetPrivate::GetNativeWidgetForNativeView(native_view);
265 return native_widget ? native_widget->GetWidget() : NULL; 249 return native_widget ? native_widget->GetWidget() : NULL;
266 } 250 }
267 251
268 // static 252 // static
269 Widget* Widget::GetWidgetForNativeWindow(gfx::NativeWindow native_window) { 253 Widget* Widget::GetWidgetForNativeWindow(gfx::NativeWindow native_window) {
270 internal::NativeWidgetPrivate* native_widget = 254 internal::NativeWidgetPrivate* native_widget =
271 internal::NativeWidgetPrivate::GetNativeWidgetForNativeWindow( 255 internal::NativeWidgetPrivate::GetNativeWidgetForNativeWindow(
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 1489
1506 //////////////////////////////////////////////////////////////////////////////// 1490 ////////////////////////////////////////////////////////////////////////////////
1507 // internal::NativeWidgetPrivate, NativeWidget implementation: 1491 // internal::NativeWidgetPrivate, NativeWidget implementation:
1508 1492
1509 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1493 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1510 return this; 1494 return this;
1511 } 1495 }
1512 1496
1513 } // namespace internal 1497 } // namespace internal
1514 } // namespace views 1498 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/widget.h ('k') | ui/views/window/dialog_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698