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

Side by Side Diff: ui/views/test/test_views_delegate_mac.mm

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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
« no previous file with comments | « ui/views/test/test_views_delegate_aura.cc ('k') | ui/views/test/test_widget_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/views/test/test_views_delegate.h"
6
7 #include "ui/views/widget/native_widget_mac.h"
8
9 namespace views {
10
11 TestViewsDelegate::TestViewsDelegate()
12 : use_desktop_native_widgets_(false),
13 use_transparent_windows_(false) {
14 DCHECK(!ViewsDelegate::views_delegate);
15 ViewsDelegate::views_delegate = this;
16 }
17
18 TestViewsDelegate::~TestViewsDelegate() {
19 if (ViewsDelegate::views_delegate == this)
20 ViewsDelegate::views_delegate = NULL;
21 }
22
23 void TestViewsDelegate::OnBeforeWidgetInit(
24 Widget::InitParams* params,
25 internal::NativeWidgetDelegate* delegate) {
26 if (params->opacity == Widget::InitParams::INFER_OPACITY) {
27 params->opacity = use_transparent_windows_ ?
28 Widget::InitParams::TRANSLUCENT_WINDOW :
29 Widget::InitParams::OPAQUE_WINDOW;
30 }
31 // TODO(tapted): This should return a *Desktop*NativeWidgetMac.
32 if (!params->native_widget && use_desktop_native_widgets_)
33 params->native_widget = new NativeWidgetMac(delegate);
34 }
35
36 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/test/test_views_delegate_aura.cc ('k') | ui/views/test/test_widget_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698