| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/metrics/metrics_log.h" | 5 #include "chrome/browser/metrics/metrics_log.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // testing unreleased new extensions. | 284 // testing unreleased new extensions. |
| 285 WriteAttribute("name", CreateBase64Hash(UTF16ToUTF8(iter->name))); | 285 WriteAttribute("name", CreateBase64Hash(UTF16ToUTF8(iter->name))); |
| 286 std::string filename_bytes = | 286 std::string filename_bytes = |
| 287 #if defined(OS_WIN) | 287 #if defined(OS_WIN) |
| 288 UTF16ToUTF8(iter->path.BaseName().value()); | 288 UTF16ToUTF8(iter->path.BaseName().value()); |
| 289 #else | 289 #else |
| 290 iter->path.BaseName().value(); | 290 iter->path.BaseName().value(); |
| 291 #endif | 291 #endif |
| 292 WriteAttribute("filename", CreateBase64Hash(filename_bytes)); | 292 WriteAttribute("filename", CreateBase64Hash(filename_bytes)); |
| 293 WriteAttribute("version", UTF16ToUTF8(iter->version)); | 293 WriteAttribute("version", UTF16ToUTF8(iter->version)); |
| 294 // TODO(bauerb): Plug-in state is per-profile. |
| 294 WriteIntAttribute("disabled", !webkit::npapi::IsPluginEnabled(*iter)); | 295 WriteIntAttribute("disabled", !webkit::npapi::IsPluginEnabled(*iter)); |
| 295 } | 296 } |
| 296 } | 297 } |
| 297 | 298 |
| 298 void MetricsLog::WriteInstallElement() { | 299 void MetricsLog::WriteInstallElement() { |
| 299 OPEN_ELEMENT_FOR_SCOPE("install"); | 300 OPEN_ELEMENT_FOR_SCOPE("install"); |
| 300 WriteAttribute("installdate", GetInstallDate()); | 301 WriteAttribute("installdate", GetInstallDate()); |
| 301 WriteIntAttribute("buildid", 0); // We're using appversion instead. | 302 WriteIntAttribute("buildid", 0); // We're using appversion instead. |
| 302 } | 303 } |
| 303 | 304 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 const std::string result_type(AutocompleteMatch::TypeToString(i->type)); | 487 const std::string result_type(AutocompleteMatch::TypeToString(i->type)); |
| 487 if (!result_type.empty()) | 488 if (!result_type.empty()) |
| 488 WriteAttribute("resulttype", result_type); | 489 WriteAttribute("resulttype", result_type); |
| 489 WriteIntAttribute("relevance", i->relevance); | 490 WriteIntAttribute("relevance", i->relevance); |
| 490 WriteIntAttribute("isstarred", i->starred ? 1 : 0); | 491 WriteIntAttribute("isstarred", i->starred ? 1 : 0); |
| 491 } | 492 } |
| 492 } | 493 } |
| 493 | 494 |
| 494 ++num_events_; | 495 ++num_events_; |
| 495 } | 496 } |
| OLD | NEW |