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

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 2694213003: mash: wires up shadows for mash (Closed)
Patch Set: defaults test Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/native_widget_aura.h ('k') | ui/wm/core/shadow.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index 63fd0727c62a35d411a892336211983146bcdccf..9c2c1b0f8a93f313059fefc14ad323b641308f51 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -130,6 +130,18 @@ void NativeWidgetAura::AssignIconToAuraWindow(aura::Window* window,
}
}
+// static
+void NativeWidgetAura::SetShadowElevationFromInitParams(
+ aura::Window* window,
+ const Widget::InitParams& params) {
+ if (params.shadow_type == Widget::InitParams::SHADOW_TYPE_NONE) {
+ SetShadowElevation(window, wm::ShadowElevation::NONE);
+ } else if (params.shadow_type == Widget::InitParams::SHADOW_TYPE_DROP &&
+ params.shadow_elevation) {
+ SetShadowElevation(window, *params.shadow_elevation);
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
// NativeWidgetAura, internal::NativeWidgetPrivate implementation:
@@ -152,12 +164,7 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) {
window_->Init(params.layer_type);
// Set name after layer init so it propagates to layer.
window_->SetName(params.name);
- if (params.shadow_type == Widget::InitParams::SHADOW_TYPE_NONE) {
- SetShadowElevation(window_, wm::ShadowElevation::NONE);
- } else if (params.shadow_type == Widget::InitParams::SHADOW_TYPE_DROP &&
- params.shadow_elevation) {
- SetShadowElevation(window_, *params.shadow_elevation);
- }
+ SetShadowElevationFromInitParams(window_, params);
if (params.type == Widget::InitParams::TYPE_CONTROL)
window_->Show();
« no previous file with comments | « ui/views/widget/native_widget_aura.h ('k') | ui/wm/core/shadow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698