OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 return pref->GetString(prefs::kMetricsClientIDTimestamp); | 64 return pref->GetString(prefs::kMetricsClientIDTimestamp); |
65 } else { | 65 } else { |
66 NOTREACHED(); | 66 NOTREACHED(); |
67 return "0"; | 67 return "0"; |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 // static | 71 // static |
72 std::string MetricsLog::GetVersionString() { | 72 std::string MetricsLog::GetVersionString() { |
73 chrome::VersionInfo version_info; | 73 chrome::VersionInfo version_info; |
74 if (!version_info.is_valid()) { | |
75 NOTREACHED() << "Unable to retrieve version info."; | |
76 return std::string(); | |
77 } | |
78 | |
79 std::string version = version_info.Version(); | 74 std::string version = version_info.Version(); |
80 if (!version_extension_.empty()) | 75 if (!version_extension_.empty()) |
81 version += version_extension_; | 76 version += version_extension_; |
82 if (!version_info.IsOfficialBuild()) | 77 if (!version_info.IsOfficialBuild()) |
83 version.append("-devel"); | 78 version.append("-devel"); |
84 return version; | 79 return version; |
85 } | 80 } |
86 | 81 |
87 MetricsLog* MetricsLog::AsMetricsLog() { | 82 MetricsLog* MetricsLog::AsMetricsLog() { |
88 return this; | 83 return this; |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 const std::string result_type(AutocompleteMatch::TypeToString(i->type)); | 442 const std::string result_type(AutocompleteMatch::TypeToString(i->type)); |
448 if (!result_type.empty()) | 443 if (!result_type.empty()) |
449 WriteAttribute("resulttype", result_type); | 444 WriteAttribute("resulttype", result_type); |
450 WriteIntAttribute("relevance", i->relevance); | 445 WriteIntAttribute("relevance", i->relevance); |
451 WriteIntAttribute("isstarred", i->starred ? 1 : 0); | 446 WriteIntAttribute("isstarred", i->starred ? 1 : 0); |
452 } | 447 } |
453 } | 448 } |
454 | 449 |
455 ++num_events_; | 450 ++num_events_; |
456 } | 451 } |
OLD | NEW |