[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / views / chrome_views_delegate_aura.cc
blobc9d70811ba6c6dfbb3b3ce07d22b7cd97f9a95f9
1 // Copyright 2013 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.
5 #include "chrome/browser/ui/views/chrome_views_delegate.h"
7 #include "chrome/browser/ui/ash/ash_util.h"
9 views::Widget::InitParams::WindowOpacity
10 ChromeViewsDelegate::GetOpacityForInitParams(
11 const views::Widget::InitParams& params) {
12 #if defined(USE_ASH)
13 gfx::NativeView native_view = params.parent ? params.parent : params.context;
14 if (native_view && chrome::IsNativeViewInAsh(native_view))
15 return views::Widget::InitParams::TRANSLUCENT_WINDOW;
16 #endif
17 // We want translucent windows when either we are in ASH or we are
18 // a top level window which is not of type TYPE_WINDOW.
19 if (params.top_level && params.type != views::Widget::InitParams::TYPE_WINDOW)
20 return views::Widget::InitParams::TRANSLUCENT_WINDOW;
22 return views::Widget::InitParams::OPAQUE_WINDOW;