From bd04f249bcc2416abcecd551ac4133ed92e75397 Mon Sep 17 00:00:00 2001 From: "gab@chromium.org" Date: Thu, 6 Dec 2012 00:40:31 +0000 Subject: Decouple IsMetroProcess() calls, introducing IsSingleWindowMetroMode(). Many things were calling IsMetroProcess() when the intent was really to turn things ON/OFF for Metro Chrome, this does not apply to Metro Ash however. Details of how this has been decoupled can be found at https://docs.google.com/spreadsheet/ccc?key=0AtwXJ4IPPZBAdEdaWUpLYk9IM3I1bTJleFJobXN3Z2c (more decoupling will be needed later and has been listed in separate columns on this spreadsheet; however for now this CL only applies the first column). Also introduces win8_util where some other win8-specific things currently in base should eventually also be refactored into. BUG=151718 TEST=This makes a bunch of things just work now in Metro Ash :). Review URL: https://chromiumcodereview.appspot.com/11411286 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171366 0039d316-1c4b-4281-b951-d872f2087c98 --- win8/util/win8_util.cc | 19 +++++++++++++++++++ win8/util/win8_util.h | 18 ++++++++++++++++++ win8/win8.gyp | 11 +++++++++++ 3 files changed, 48 insertions(+) create mode 100644 win8/util/win8_util.cc create mode 100644 win8/util/win8_util.h (limited to 'win8') diff --git a/win8/util/win8_util.cc b/win8/util/win8_util.cc new file mode 100644 index 0000000..b630b8f --- /dev/null +++ b/win8/util/win8_util.cc @@ -0,0 +1,19 @@ +// Copyright (c) 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 "win8/util/win8_util.h" + +#include "base/win/metro.h" + +namespace win8 { + +bool IsSingleWindowMetroMode() { +#if defined(USE_ASH) + return false; +#else + return base::win::IsMetroProcess(); +#endif +} + +} // namespace win8 diff --git a/win8/util/win8_util.h b/win8/util/win8_util.h new file mode 100644 index 0000000..25d6ec0 --- /dev/null +++ b/win8/util/win8_util.h @@ -0,0 +1,18 @@ +// Copyright (c) 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. + +#ifndef WIN8_UTIL_WIN8_UTIL_H_ +#define WIN8_UTIL_WIN8_UTIL_H_ + +namespace win8 { + +// Returns true if this process is running in fullscreen Metro mode on Win8+. +// Callers should always prefer this method to base::win::IsMetroProcess() for +// UI properties dependent on the single window mode as this method is also +// aware of the Ash environment in which multiple Chrome windows can live. +bool IsSingleWindowMetroMode(); + +} // namespace win8 + +#endif // WIN8_UTIL_WIN8_UTIL_H_ diff --git a/win8/win8.gyp b/win8/win8.gyp index 2cacb42..a159588 100644 --- a/win8/win8.gyp +++ b/win8/win8.gyp @@ -35,5 +35,16 @@ }, ], }, + { + 'target_name': 'win8_util', + 'type': 'static_library', + 'dependencies': [ + '../base/base.gyp:base', + ], + 'sources': [ + 'util/win8_util.cc', + 'util/win8_util.h', + ], + }, ], } -- cgit v1.1