RenderText: Allow setting display offset explicitly
[chromium-blink-merge.git] / device / hid / hid_usage_and_page.cc
blob079ec6623d6f8fc21a2d963cc4602011a8be977d
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "device/hid/hid_usage_and_page.h"
7 namespace device {
9 bool HidUsageAndPage::IsProtected() const {
10 if (usage_page == HidUsageAndPage::kPageKeyboard)
11 return true;
13 if (usage_page != HidUsageAndPage::kPageGenericDesktop)
14 return false;
16 if (usage == HidUsageAndPage::kGenericDesktopPointer ||
17 usage == HidUsageAndPage::kGenericDesktopMouse ||
18 usage == HidUsageAndPage::kGenericDesktopKeyboard ||
19 usage == HidUsageAndPage::kGenericDesktopKeypad) {
20 return true;
23 if (usage >= HidUsageAndPage::kGenericDesktopSystemControl &&
24 usage <= HidUsageAndPage::kGenericDesktopSystemWarmRestart) {
25 return true;
28 if (usage >= HidUsageAndPage::kGenericDesktopSystemDock &&
29 usage <= HidUsageAndPage::kGenericDesktopSystemDisplaySwap) {
30 return true;
33 return false;
36 } // namespace device