[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.cc
blobf379ca079a6da306bc1ba902a361cb0912f9d470
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/native_browser_frame.h"
9 namespace {
11 NativeBrowserFrameFactory* factory = NULL;
15 // static
16 NativeBrowserFrame* NativeBrowserFrameFactory::CreateNativeBrowserFrame(
17 BrowserFrame* browser_frame,
18 BrowserView* browser_view) {
19 if (!factory)
20 factory = new NativeBrowserFrameFactory;
21 return factory->Create(browser_frame, browser_view);
24 // static
25 void NativeBrowserFrameFactory::Set(NativeBrowserFrameFactory* new_factory) {
26 delete factory;
27 factory = new_factory;
30 #if !defined(OS_WIN)
31 // static
32 chrome::HostDesktopType NativeBrowserFrameFactory::AdjustHostDesktopType(
33 chrome::HostDesktopType desktop_type) {
34 return desktop_type;
36 #endif // !defined(OS_WIN)
38 #if !defined(USE_ASH) || defined(OS_CHROMEOS)
39 // static
40 bool NativeBrowserFrameFactory::ShouldCreateForAshDesktop(
41 BrowserView* browser_view) {
42 NOTREACHED();
43 return false;
45 #endif // !defined(OS_WIN) || !defined(USE_ASH)