| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_log.h" | 5 #include "chrome/browser/metrics_log.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
| 10 #include "base/md5.h" | 10 #include "base/md5.h" |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 451 |
| 452 OPEN_ELEMENT_FOR_SCOPE("plugins"); | 452 OPEN_ELEMENT_FOR_SCOPE("plugins"); |
| 453 | 453 |
| 454 for (std::vector<WebPluginInfo>::const_iterator iter = plugin_list.begin(); | 454 for (std::vector<WebPluginInfo>::const_iterator iter = plugin_list.begin(); |
| 455 iter != plugin_list.end(); ++iter) { | 455 iter != plugin_list.end(); ++iter) { |
| 456 OPEN_ELEMENT_FOR_SCOPE("plugin"); | 456 OPEN_ELEMENT_FOR_SCOPE("plugin"); |
| 457 | 457 |
| 458 // Plugin name and filename are hashed for the privacy of those | 458 // Plugin name and filename are hashed for the privacy of those |
| 459 // testing unreleased new extensions. | 459 // testing unreleased new extensions. |
| 460 WriteAttribute("name", CreateBase64Hash(WideToUTF8(iter->name))); | 460 WriteAttribute("name", CreateBase64Hash(WideToUTF8(iter->name))); |
| 461 WriteAttribute("filename", CreateBase64Hash(iter->filename)); | 461 WriteAttribute("filename", |
| 462 CreateBase64Hash(WideToUTF8(iter->path.BaseName().ToWStringHack()))); |
| 462 WriteAttribute("version", WideToUTF8(iter->version)); | 463 WriteAttribute("version", WideToUTF8(iter->version)); |
| 463 } | 464 } |
| 464 } | 465 } |
| 465 | 466 |
| 466 void MetricsLog::WriteInstallElement() { | 467 void MetricsLog::WriteInstallElement() { |
| 467 OPEN_ELEMENT_FOR_SCOPE("install"); | 468 OPEN_ELEMENT_FOR_SCOPE("install"); |
| 468 WriteAttribute("installdate", GetInstallDate()); | 469 WriteAttribute("installdate", GetInstallDate()); |
| 469 WriteIntAttribute("buildid", 0); // We're using appversion instead. | 470 WriteIntAttribute("buildid", 0); // We're using appversion instead. |
| 470 WriteAttribute("appversion", GetVersionString()); | 471 WriteAttribute("appversion", GetVersionString()); |
| 471 } | 472 } |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 | 686 |
| 686 for (size_t i = 0; i < histogram.bucket_count(); i++) { | 687 for (size_t i = 0; i < histogram.bucket_count(); i++) { |
| 687 if (snapshot.counts(i)) { | 688 if (snapshot.counts(i)) { |
| 688 OPEN_ELEMENT_FOR_SCOPE("histogrambucket"); | 689 OPEN_ELEMENT_FOR_SCOPE("histogrambucket"); |
| 689 WriteIntAttribute("min", histogram.ranges(i)); | 690 WriteIntAttribute("min", histogram.ranges(i)); |
| 690 WriteIntAttribute("max", histogram.ranges(i + 1)); | 691 WriteIntAttribute("max", histogram.ranges(i + 1)); |
| 691 WriteIntAttribute("count", snapshot.counts(i)); | 692 WriteIntAttribute("count", snapshot.counts(i)); |
| 692 } | 693 } |
| 693 } | 694 } |
| 694 } | 695 } |
| OLD | NEW |