Commit 08bc2525 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

moves feature from ui_base_switches.h to ui_base_features

BUG=none
TEST=none

Change-Id: I038b815518a6b27dcdb4e303edec4c02fcde9072
Reviewed-on: https://chromium-review.googlesource.com/923095Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537159}
parent a3111f3e
......@@ -55,6 +55,7 @@
#include "services/ui/public/interfaces/constants.mojom.h"
#include "third_party/WebKit/public/web/WebKit.h"
#include "ui/base/ui_base_switches.h"
#include "ui/base/ui_features.h"
#if defined(OS_WIN)
#include "base/win/win_util.h"
......
......@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "ui/base/ui_base_switches.h"
#include "ui/base/ui_features.h"
namespace content {
......
......@@ -3,25 +3,18 @@
// found in the LICENSE file.
#include "ui/base/ui_base_features.h"
#include "ui/base/ui_base_switches_util.h"
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#endif
namespace features {
#if defined(OS_WIN)
// Enables stylus appearing as touch when in contact with digitizer.
const base::Feature kDirectManipulationStylus = {
"DirectManipulationStylus", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables using WM_POINTER instead of WM_TOUCH for touch events.
const base::Feature kPointerEventsForTouch = {"PointerEventsForTouch",
base::FEATURE_ENABLED_BY_DEFAULT};
bool IsUsingWMPointerForTouch() {
return base::win::GetVersion() >= base::win::VERSION_WIN8 &&
base::FeatureList::IsEnabled(kPointerEventsForTouch);
}
#endif // defined(OS_WIN)
// Enables the floating virtual keyboard behavior.
const base::Feature kEnableFloatingVirtualKeyboard = {
"enable-floating-virtual-keyboard", base::FEATURE_DISABLED_BY_DEFAULT};
// Applies the material design mode to elements throughout Chrome (not just top
// Chrome).
......@@ -44,4 +37,19 @@ bool IsTouchableAppContextMenuEnabled() {
switches::IsTouchableAppContextMenuEnabled();
}
#if defined(OS_WIN)
// Enables stylus appearing as touch when in contact with digitizer.
const base::Feature kDirectManipulationStylus = {
"DirectManipulationStylus", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables using WM_POINTER instead of WM_TOUCH for touch events.
const base::Feature kPointerEventsForTouch = {"PointerEventsForTouch",
base::FEATURE_ENABLED_BY_DEFAULT};
bool IsUsingWMPointerForTouch() {
return base::win::GetVersion() >= base::win::VERSION_WIN8 &&
base::FeatureList::IsEnabled(kPointerEventsForTouch);
}
#endif // defined(OS_WIN)
} // namespace features
......@@ -11,6 +11,13 @@
namespace features {
// Keep sorted!
UI_BASE_EXPORT extern const base::Feature kEnableFloatingVirtualKeyboard;
UI_BASE_EXPORT extern const base::Feature kSecondaryUiMd;
UI_BASE_EXPORT extern const base::Feature kTouchableAppContextMenu;
UI_BASE_EXPORT bool IsTouchableAppContextMenuEnabled();
#if defined(OS_WIN)
UI_BASE_EXPORT extern const base::Feature kDirectManipulationStylus;
UI_BASE_EXPORT extern const base::Feature kPointerEventsForTouch;
......@@ -20,12 +27,6 @@ UI_BASE_EXPORT bool IsUsingWMPointerForTouch();
#endif // defined(OS_WIN)
UI_BASE_EXPORT extern const base::Feature kSecondaryUiMd;
UI_BASE_EXPORT extern const base::Feature kTouchableAppContextMenu;
UI_BASE_EXPORT bool IsTouchableAppContextMenuEnabled();
} // namespace features
#endif // UI_BASE_UI_BASE_FEATURES_H_
......@@ -4,14 +4,6 @@
#include "ui/base/ui_base_switches.h"
namespace features {
// Enables the floating virtual keyboard behavior.
const base::Feature kEnableFloatingVirtualKeyboard = {
"enable-floating-virtual-keyboard", base::FEATURE_DISABLED_BY_DEFAULT};
} // namespace features
namespace switches {
#if defined(OS_MACOSX) && !defined(OS_IOS)
......
......@@ -7,16 +7,8 @@
#ifndef UI_BASE_UI_BASE_SWITCHES_H_
#define UI_BASE_UI_BASE_SWITCHES_H_
#include "base/feature_list.h"
#include "build/build_config.h"
#include "ui/base/ui_base_export.h"
#include "ui/base/ui_features.h"
namespace features {
UI_BASE_EXPORT extern const base::Feature kEnableFloatingVirtualKeyboard;
} // namespace features
namespace switches {
......
......@@ -18,6 +18,7 @@
#include "ui/base/ime/input_method_base.h"
#include "ui/base/ime/text_input_client.h"
#include "ui/base/ime/text_input_flags.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/ui_base_switches.h"
#include "ui/events/event_sink.h"
#include "ui/events/event_utils.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment