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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/device/hid/hid_usage_and_page.cc
===================================================================
--- trunk/src/device/hid/hid_usage_and_page.cc (revision 281299)
+++ trunk/src/device/hid/hid_usage_and_page.cc (working copy)
@@ -6,8 +6,31 @@
namespace device {
-bool HidUsageAndPage::operator==(const HidUsageAndPage& other) const {
- return usage == other.usage && usage_page == other.usage_page;
+bool HidUsageAndPage::IsProtected() const {
+ if (usage_page == HidUsageAndPage::kPageKeyboard)
+ return true;
+
+ if (usage_page != HidUsageAndPage::kPageGenericDesktop)
+ return false;
+
+ if (usage == HidUsageAndPage::kGenericDesktopPointer ||
+ usage == HidUsageAndPage::kGenericDesktopMouse ||
+ usage == HidUsageAndPage::kGenericDesktopKeyboard ||
+ usage == HidUsageAndPage::kGenericDesktopKeypad) {
+ return true;
+ }
+
+ if (usage >= HidUsageAndPage::kGenericDesktopSystemControl &&
+ usage <= HidUsageAndPage::kGenericDesktopSystemWarmRestart) {
+ return true;
+ }
+
+ if (usage >= HidUsageAndPage::kGenericDesktopSystemDock &&
+ usage <= HidUsageAndPage::kGenericDesktopSystemDisplaySwap) {
+ return true;
+ }
+
+ return false;
}
} // namespace device
Property changes on: trunk/src/device/hid/hid_usage_and_page.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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