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

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

Issue 63343004: Remove DialogDelegate::UseNewStyle and unused code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Additional cleanup; sync and rebase. Created 7 years, 1 month 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
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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 Widget::InitParams params; 245 Widget::InitParams params;
246 params.delegate = delegate; 246 params.delegate = delegate;
247 params.context = context; 247 params.context = context;
248 params.bounds = bounds; 248 params.bounds = bounds;
249 widget->Init(params); 249 widget->Init(params);
250 return widget; 250 return widget;
251 } 251 }
252 252
253 // static 253 // static
254 Widget* Widget::CreateWindowAsFramelessChild(WidgetDelegate* widget_delegate, 254 Widget* Widget::CreateWindowAsFramelessChild(WidgetDelegate* widget_delegate,
255 gfx::NativeView parent, 255 gfx::NativeView parent) {
256 gfx::NativeView new_style_parent) {
257 views::Widget* widget = new views::Widget; 256 views::Widget* widget = new views::Widget;
258 257
259 views::Widget::InitParams params; 258 views::Widget::InitParams params;
260 params.delegate = widget_delegate; 259 params.delegate = widget_delegate;
261 params.child = true; 260 params.child = true;
262 if (views::DialogDelegate::UseNewStyle()) { 261 params.parent = parent;
263 params.parent = new_style_parent; 262 params.remove_standard_frame = true;
264 params.remove_standard_frame = true;
265 #if defined(USE_AURA) 263 #if defined(USE_AURA)
266 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 264 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
267 #endif 265 #endif
268 } else {
269 params.parent = parent;
270 }
271 266
272 widget->Init(params); 267 widget->Init(params);
273
274 return widget; 268 return widget;
275 } 269 }
276 270
277 // static 271 // static
278 Widget* Widget::GetWidgetForNativeView(gfx::NativeView native_view) { 272 Widget* Widget::GetWidgetForNativeView(gfx::NativeView native_view) {
279 internal::NativeWidgetPrivate* native_widget = 273 internal::NativeWidgetPrivate* native_widget =
280 internal::NativeWidgetPrivate::GetNativeWidgetForNativeView(native_view); 274 internal::NativeWidgetPrivate::GetNativeWidgetForNativeView(native_view);
281 return native_widget ? native_widget->GetWidget() : NULL; 275 return native_widget ? native_widget->GetWidget() : NULL;
282 } 276 }
283 277
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 1424
1431 //////////////////////////////////////////////////////////////////////////////// 1425 ////////////////////////////////////////////////////////////////////////////////
1432 // internal::NativeWidgetPrivate, NativeWidget implementation: 1426 // internal::NativeWidgetPrivate, NativeWidget implementation:
1433 1427
1434 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1428 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1435 return this; 1429 return this;
1436 } 1430 }
1437 1431
1438 } // namespace internal 1432 } // namespace internal
1439 } // namespace views 1433 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698