158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// found in the LICENSE file.
458537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)
558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#include "chrome/browser/ui/views/frame/native_browser_frame_factory.h"
658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)
758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#include "chrome/browser/ui/views/frame/native_browser_frame.h"
858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)
958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)namespace {
1058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)
1158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)NativeBrowserFrameFactory* factory = NULL;
1258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)
1358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)}
1458537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)
1558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// static
1658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)NativeBrowserFrame* NativeBrowserFrameFactory::CreateNativeBrowserFrame(
1758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)    BrowserFrame* browser_frame,
1858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)    BrowserView* browser_view) {
1958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)  if (!factory)
2058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)    factory = new NativeBrowserFrameFactory;
2158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)  return factory->Create(browser_frame, browser_view);
2258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)}
2358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)
2458537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// static
2558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)void NativeBrowserFrameFactory::Set(NativeBrowserFrameFactory* new_factory) {
2658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)  delete factory;
2758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)  factory = new_factory;
2858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)}
29f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
30f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#if !defined(OS_WIN)
31f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// static
32f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)chrome::HostDesktopType NativeBrowserFrameFactory::AdjustHostDesktopType(
33f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)    chrome::HostDesktopType desktop_type) {
34f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  return desktop_type;
35f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)}
36f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#endif  // !defined(OS_WIN)
37f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
38f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#if !defined(USE_ASH) || defined(OS_CHROMEOS)
39f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// static
40f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)bool NativeBrowserFrameFactory::ShouldCreateForAshDesktop(
41f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)    BrowserView* browser_view) {
42f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  NOTREACHED();
43f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  return false;
44f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)}
45f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#endif  // !defined(OS_WIN) || !defined(USE_ASH)
46