forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell_views_delegate.cc
35 lines (25 loc) · 1.01 KB
/
shell_views_delegate.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/shell/shell_views_delegate.h"
#include "ash/shell.h"
namespace ash {
namespace shell {
ShellViewsDelegate::ShellViewsDelegate() = default;
ShellViewsDelegate::~ShellViewsDelegate() = default;
views::NonClientFrameView* ShellViewsDelegate::CreateDefaultNonClientFrameView(
views::Widget* widget) {
return ash::Shell::Get()->CreateDefaultNonClientFrameView(widget);
}
void ShellViewsDelegate::OnBeforeWidgetInit(
views::Widget::InitParams* params,
views::internal::NativeWidgetDelegate* delegate) {
if (params->opacity == views::Widget::InitParams::INFER_OPACITY)
params->opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
if (params->native_widget)
return;
if (!params->parent && !params->context && !params->child)
params->context = Shell::GetPrimaryRootWindow();
}
} // namespace shell
} // namespace ash