[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / views / frame / native_browser_frame_factory_aurawin.cc
blob762ee72a62958315b038ed66919eedcc6be71b4a
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/frame/native_browser_frame_factory.h"
7 #include "chrome/browser/ui/views/frame/desktop_browser_frame_aura.h"
9 #if defined(USE_ASH)
10 #include "ash/shell.h"
11 #include "chrome/browser/ui/views/frame/browser_frame_ashwin.h"
12 #endif
14 NativeBrowserFrame* NativeBrowserFrameFactory::Create(
15 BrowserFrame* browser_frame,
16 BrowserView* browser_view) {
17 #if defined(USE_ASH)
18 if (ShouldCreateForAshDesktop(browser_view))
19 return new BrowserFrameAshWin(browser_frame, browser_view);
20 #endif
21 return new DesktopBrowserFrameAura(browser_frame, browser_view);
24 // static
25 chrome::HostDesktopType NativeBrowserFrameFactory::AdjustHostDesktopType(
26 chrome::HostDesktopType desktop_type) {
27 #if defined(USE_ASH)
28 if (ash::Shell::HasInstance())
29 return chrome::HOST_DESKTOP_TYPE_ASH;
30 #endif
32 return desktop_type;