summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/chrome_views_delegate_aura.cc
blob: f2691c5e1f01dbfdf9ef2a6e4aa4c85e1063e764 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2013 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 "chrome/browser/ui/views/chrome_views_delegate.h"

#include "chrome/browser/ui/ash/ash_util.h"

views::Widget::InitParams::WindowOpacity
ChromeViewsDelegate::GetOpacityForInitParams(
    const views::Widget::InitParams& params) {
  gfx::NativeView native_view = params.parent ? params.parent : params.context;
  if (native_view && chrome::IsNativeViewInAsh(native_view))
    return views::Widget::InitParams::TRANSLUCENT_WINDOW;

  // We want translucent windows when either we are in ASH or we are
  // a top level window which is not of type TYPE_WINDOW.
  if (!params.child && params.type != views::Widget::InitParams::TYPE_WINDOW)
    return views::Widget::InitParams::TRANSLUCENT_WINDOW;

  return views::Widget::InitParams::OPAQUE_WINDOW;
}