| 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> |
| 8 #include <vector> |
| 9 |
| 7 #include "base/base64.h" | 10 #include "base/base64.h" |
| 8 #include "base/time.h" | |
| 9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 10 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 11 #include "base/file_version_info.h" | 13 #include "base/file_version_info.h" |
| 12 #include "base/md5.h" | 14 #include "base/md5.h" |
| 13 #include "base/perftimer.h" | 15 #include "base/perftimer.h" |
| 14 #include "base/scoped_ptr.h" | 16 #include "base/scoped_ptr.h" |
| 15 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| 16 #include "base/sys_info.h" | 18 #include "base/sys_info.h" |
| 19 #include "base/third_party/nspr/prtime.h" |
| 20 #include "base/time.h" |
| 17 #include "base/utf_string_conversions.h" | 21 #include "base/utf_string_conversions.h" |
| 18 #include "base/third_party/nspr/prtime.h" | |
| 19 #include "chrome/app/chrome_version_info.h" | |
| 20 #include "chrome/browser/autocomplete/autocomplete.h" | 22 #include "chrome/browser/autocomplete/autocomplete.h" |
| 21 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
| 22 #include "chrome/browser/gpu_process_host.h" | 24 #include "chrome/browser/gpu_process_host.h" |
| 23 #include "chrome/browser/pref_service.h" | 25 #include "chrome/browser/pref_service.h" |
| 26 #include "chrome/common/chrome_version_info.h" |
| 24 #include "chrome/common/logging_chrome.h" | 27 #include "chrome/common/logging_chrome.h" |
| 25 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
| 26 #include "googleurl/src/gurl.h" | 29 #include "googleurl/src/gurl.h" |
| 27 | 30 |
| 28 #define OPEN_ELEMENT_FOR_SCOPE(name) ScopedElement scoped_element(this, name) | 31 #define OPEN_ELEMENT_FOR_SCOPE(name) ScopedElement scoped_element(this, name) |
| 29 | 32 |
| 30 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx | 33 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx |
| 31 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
| 32 extern "C" IMAGE_DOS_HEADER __ImageBase; | 35 extern "C" IMAGE_DOS_HEADER __ImageBase; |
| 33 #endif | 36 #endif |
| (...skipping 29 matching lines...) Expand all Loading... |
| 63 return pref->GetString(prefs::kMetricsClientIDTimestamp); | 66 return pref->GetString(prefs::kMetricsClientIDTimestamp); |
| 64 } else { | 67 } else { |
| 65 NOTREACHED(); | 68 NOTREACHED(); |
| 66 return "0"; | 69 return "0"; |
| 67 } | 70 } |
| 68 } | 71 } |
| 69 | 72 |
| 70 // static | 73 // static |
| 71 std::string MetricsLog::GetVersionString() { | 74 std::string MetricsLog::GetVersionString() { |
| 72 scoped_ptr<FileVersionInfo> version_info( | 75 scoped_ptr<FileVersionInfo> version_info( |
| 73 chrome_app::GetChromeVersionInfo()); | 76 chrome::GetChromeVersionInfo()); |
| 74 if (version_info.get()) { | 77 if (version_info.get()) { |
| 75 std::string version = WideToUTF8(version_info->product_version()); | 78 std::string version = WideToUTF8(version_info->product_version()); |
| 76 if (!version_extension_.empty()) | 79 if (!version_extension_.empty()) |
| 77 version += version_extension_; | 80 version += version_extension_; |
| 78 if (!version_info->is_official_build()) | 81 if (!version_info->is_official_build()) |
| 79 version.append("-devel"); | 82 version.append("-devel"); |
| 80 return version; | 83 return version; |
| 81 } else { | 84 } else { |
| 82 NOTREACHED() << "Unable to retrieve version string."; | 85 NOTREACHED() << "Unable to retrieve version string."; |
| 83 } | 86 } |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 const std::string result_type(AutocompleteMatch::TypeToString(i->type)); | 445 const std::string result_type(AutocompleteMatch::TypeToString(i->type)); |
| 443 if (!result_type.empty()) | 446 if (!result_type.empty()) |
| 444 WriteAttribute("resulttype", result_type); | 447 WriteAttribute("resulttype", result_type); |
| 445 WriteIntAttribute("relevance", i->relevance); | 448 WriteIntAttribute("relevance", i->relevance); |
| 446 WriteIntAttribute("isstarred", i->starred ? 1 : 0); | 449 WriteIntAttribute("isstarred", i->starred ? 1 : 0); |
| 447 } | 450 } |
| 448 } | 451 } |
| 449 | 452 |
| 450 ++num_events_; | 453 ++num_events_; |
| 451 } | 454 } |
| OLD | NEW |