Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: trunk/src/device/hid/hid_usage_and_page.cc

Issue 364213005: Revert 281282 "Revert 281133 "chrome.hid: enrich model with repo..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/src/device/hid/hid_usage_and_page.h ('k') | trunk/src/device/hid/hid_utils_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/hid/hid_usage_and_page.h" 5 #include "device/hid/hid_usage_and_page.h"
6 6
7 namespace device { 7 namespace device {
8 8
9 bool HidUsageAndPage::operator==(const HidUsageAndPage& other) const { 9 bool HidUsageAndPage::IsProtected() const {
10 return usage == other.usage && usage_page == other.usage_page; 10 if (usage_page == HidUsageAndPage::kPageKeyboard)
11 return true;
12
13 if (usage_page != HidUsageAndPage::kPageGenericDesktop)
14 return false;
15
16 if (usage == HidUsageAndPage::kGenericDesktopPointer ||
17 usage == HidUsageAndPage::kGenericDesktopMouse ||
18 usage == HidUsageAndPage::kGenericDesktopKeyboard ||
19 usage == HidUsageAndPage::kGenericDesktopKeypad) {
20 return true;
21 }
22
23 if (usage >= HidUsageAndPage::kGenericDesktopSystemControl &&
24 usage <= HidUsageAndPage::kGenericDesktopSystemWarmRestart) {
25 return true;
26 }
27
28 if (usage >= HidUsageAndPage::kGenericDesktopSystemDock &&
29 usage <= HidUsageAndPage::kGenericDesktopSystemDisplaySwap) {
30 return true;
31 }
32
33 return false;
11 } 34 }
12 35
13 } // namespace device 36 } // namespace device
OLDNEW
« no previous file with comments | « trunk/src/device/hid/hid_usage_and_page.h ('k') | trunk/src/device/hid/hid_utils_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698