<commit_before>// Copyright 2012 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/host_desktop.h"

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

namespace chrome {

namespace {

bool g_force_ = false;
HostDesktopType g_force_type_ = HOST_DESKTOP_TYPE_COUNT;

}  // namespace

ScopedForceDesktopType::ScopedForceDesktopType(HostDesktopType type)
    : previous_type_(g_force_type_),
      previous_force_(g_force_) {
  g_force_type_ = type;
  g_force_ = true;
}

ScopedForceDesktopType::~ScopedForceDesktopType() {
  g_force_type_ = previous_type_;
  g_force_ = previous_force_;
}

HostDesktopType GetHostDesktopTypeForNativeView(gfx::NativeView native_view) {
  if (g_force_)
    return g_force_type_;
#if defined(USE_ASH)
  return IsNativeViewInAsh(native_view) ?
      HOST_DESKTOP_TYPE_ASH :
      HOST_DESKTOP_TYPE_NATIVE;
#else
  return HOST_DESKTOP_TYPE_ASH;
#endif
}

HostDesktopType GetHostDesktopTypeForNativeWindow(
    gfx::NativeWindow native_window) {
  if (g_force_)
    return g_force_type_;
#if defined(USE_ASH)
  return IsNativeWindowInAsh(native_window) ?
      HOST_DESKTOP_TYPE_ASH :
      HOST_DESKTOP_TYPE_NATIVE;
#else
  return HOST_DESKTOP_TYPE_NATIVE;
#endif
}

HostDesktopType GetHostDesktopTypeForBrowser(const Browser* browser) {<commit_msg>Desktop aura: When USE_ASH is disabled, don't return ASH types.<commit_after>// Copyright 2012 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/host_desktop.h"

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

namespace chrome {

namespace {

bool g_force_ = false;
HostDesktopType g_force_type_ = HOST_DESKTOP_TYPE_COUNT;

}  // namespace

ScopedForceDesktopType::ScopedForceDesktopType(HostDesktopType type)
    : previous_type_(g_force_type_),
      previous_force_(g_force_) {
  g_force_type_ = type;
  g_force_ = true;
}

ScopedForceDesktopType::~ScopedForceDesktopType() {
  g_force_type_ = previous_type_;
  g_force_ = previous_force_;
}

HostDesktopType GetHostDesktopTypeForNativeView(gfx::NativeView native_view) {
  if (g_force_)
    return g_force_type_;
#if defined(USE_ASH)
  return IsNativeViewInAsh(native_view) ?
      HOST_DESKTOP_TYPE_ASH :
      HOST_DESKTOP_TYPE_NATIVE;
#else
  return HOST_DESKTOP_TYPE_NATIVE;
#endif
}

HostDesktopType GetHostDesktopTypeForNativeWindow(
    gfx::NativeWindow native_window) {
  if (g_force_)
    return g_force_type_;
#if defined(USE_ASH)
  return IsNativeWindowInAsh(native_window) ?
      HOST_DESKTOP_TYPE_ASH :
      HOST_DESKTOP_TYPE_NATIVE;
#else
  return HOST_DESKTOP_TYPE_NATIVE;
#endif
}

HostDesktopType GetHostDesktopTypeForBrowser(const Browser* browser) {
{'fraction_non_alphanumeric': 0.07945670628183361, 'fraction_numerical': 0.0027164685908319186, 'mean_word_length': 5.362850971922247, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3809723', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1012, 'n_words': 201}