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

Unified Diff: components/device_event_log/device_event_log_impl.cc

Issue 941063003: Log device/usb messages to chrome://device-log. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 10 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 | « components/device_event_log/device_event_log.h ('k') | device/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/device_event_log/device_event_log_impl.cc
diff --git a/components/device_event_log/device_event_log_impl.cc b/components/device_event_log/device_event_log_impl.cc
index b2609914e5687c683038a9f4d7e68cb9f3e401a0..766ed16c73397ab20c201816565996248d5b5f6f 100644
--- a/components/device_event_log/device_event_log_impl.cc
+++ b/components/device_event_log/device_event_log_impl.cc
@@ -29,16 +29,22 @@ const char* kLogLevelName[] = {"Error", "User", "Event", "Debug"};
const char* kLogTypeNetworkDesc = "Network";
const char* kLogTypePowerDesc = "Power";
const char* kLogTypeLoginDesc = "Login";
+const char* kLogTypeUsbDesc = "USB";
std::string GetLogTypeString(LogType type) {
- if (type == LOG_TYPE_NETWORK)
- return kLogTypeNetworkDesc;
- if (type == LOG_TYPE_POWER)
- return kLogTypePowerDesc;
- if (type == LOG_TYPE_LOGIN)
- return kLogTypeLoginDesc;
- NOTREACHED();
- return "Unknown";
+ switch (type) {
+ case LOG_TYPE_NETWORK:
+ return kLogTypeNetworkDesc;
+ case LOG_TYPE_POWER:
+ return kLogTypePowerDesc;
+ case LOG_TYPE_LOGIN:
+ return kLogTypeLoginDesc;
+ case LOG_TYPE_USB:
+ return kLogTypeUsbDesc;
+ default:
+ NOTREACHED();
+ return "Unknown";
+ }
}
std::string DateAndTimeWithMicroseconds(const base::Time& time) {
« no previous file with comments | « components/device_event_log/device_event_log.h ('k') | device/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698