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

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

Issue 2596743002: Replace WM shadow types (on/off) and styles (small/inactive/active) (Closed)
Patch Set: . Created 3 years, 12 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
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/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 RegisterNativeWidgetForWindow(this, window_); 136 RegisterNativeWidgetForWindow(this, window_);
137 window_->SetType(GetAuraWindowTypeForWidgetType(params.type)); 137 window_->SetType(GetAuraWindowTypeForWidgetType(params.type));
138 window_->SetProperty(aura::client::kShowStateKey, params.show_state); 138 window_->SetProperty(aura::client::kShowStateKey, params.show_state);
139 if (params.type == Widget::InitParams::TYPE_BUBBLE) 139 if (params.type == Widget::InitParams::TYPE_BUBBLE)
140 aura::client::SetHideOnDeactivate(window_, true); 140 aura::client::SetHideOnDeactivate(window_, true);
141 window_->SetTransparent( 141 window_->SetTransparent(
142 params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW); 142 params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW);
143 window_->Init(params.layer_type); 143 window_->Init(params.layer_type);
144 // Set name after layer init so it propagates to layer. 144 // Set name after layer init so it propagates to layer.
145 window_->SetName(params.name); 145 window_->SetName(params.name);
146 if (params.shadow_type == Widget::InitParams::SHADOW_TYPE_NONE) 146 if (params.shadow_type == Widget::InitParams::SHADOW_TYPE_NONE) {
147 SetShadowType(window_, wm::SHADOW_TYPE_NONE); 147 SetShadowElevation(window_, wm::ShadowElevation::NONE);
sky 2017/01/03 22:35:38 Isn't this the default?
Evan Stade 2017/01/04 00:20:45 The default depends on the platform and the type o
148 else if (params.shadow_type == Widget::InitParams::SHADOW_TYPE_DROP) 148 } else if (params.shadow_type == Widget::InitParams::SHADOW_TYPE_DROP &&
149 SetShadowType(window_, wm::SHADOW_TYPE_RECTANGULAR); 149 params.shadow_elevation >= 0) {
150 SetShadowElevation(
151 window_, static_cast<wm::ShadowElevation>(params.shadow_elevation));
152 }
150 if (params.type == Widget::InitParams::TYPE_CONTROL) 153 if (params.type == Widget::InitParams::TYPE_CONTROL)
151 window_->Show(); 154 window_->Show();
152 155
153 delegate_->OnNativeWidgetCreated(false); 156 delegate_->OnNativeWidgetCreated(false);
154 157
155 gfx::Rect window_bounds = params.bounds; 158 gfx::Rect window_bounds = params.bounds;
156 gfx::NativeView parent = params.parent; 159 gfx::NativeView parent = params.parent;
157 gfx::NativeView context = params.context; 160 gfx::NativeView context = params.context;
158 if (!params.child) { 161 if (!params.child) {
159 // Set up the transient child before the window is added. This way the 162 // Set up the transient child before the window is added. This way the
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 gfx::NativeView native_view) { 1232 gfx::NativeView native_view) {
1230 aura::client::CaptureClient* capture_client = 1233 aura::client::CaptureClient* capture_client =
1231 aura::client::GetCaptureClient(native_view->GetRootWindow()); 1234 aura::client::GetCaptureClient(native_view->GetRootWindow());
1232 if (!capture_client) 1235 if (!capture_client)
1233 return nullptr; 1236 return nullptr;
1234 return capture_client->GetGlobalCaptureWindow(); 1237 return capture_client->GetGlobalCaptureWindow();
1235 } 1238 }
1236 1239
1237 } // namespace internal 1240 } // namespace internal
1238 } // namespace views 1241 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698