diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 00:40:31 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 00:40:31 +0000 |
commit | bd04f249bcc2416abcecd551ac4133ed92e75397 (patch) | |
tree | 1e607e7bf2760962a7ef4aa4acd80d8bdeffa3ca /win8 | |
parent | fd2951978e515252cb1e67866fddfdcd514430c3 (diff) | |
download | chromium_src-bd04f249bcc2416abcecd551ac4133ed92e75397.zip chromium_src-bd04f249bcc2416abcecd551ac4133ed92e75397.tar.gz chromium_src-bd04f249bcc2416abcecd551ac4133ed92e75397.tar.bz2 |
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
Diffstat (limited to 'win8')
-rw-r--r-- | win8/util/win8_util.cc | 19 | ||||
-rw-r--r-- | win8/util/win8_util.h | 18 | ||||
-rw-r--r-- | win8/win8.gyp | 11 |
3 files changed, 48 insertions, 0 deletions
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', + ], + }, ], } |