| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 59 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 60 std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles(); | 60 std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles(); |
| 61 if (profiles.empty()) | 61 if (profiles.empty()) |
| 62 return NULL; | 62 return NULL; |
| 63 | 63 |
| 64 return PluginPrefs::GetForProfile(profiles.front()); | 64 return PluginPrefs::GetForProfile(profiles.front()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace | 67 } // namespace |
| 68 | 68 |
| 69 static base::LazyInstance<std::string, | 69 static base::LazyInstance<std::string>::Leaky |
| 70 base::LeakyLazyInstanceTraits<std::string > > | |
| 71 g_version_extension = LAZY_INSTANCE_INITIALIZER; | 70 g_version_extension = LAZY_INSTANCE_INITIALIZER; |
| 72 | 71 |
| 73 MetricsLog::MetricsLog(const std::string& client_id, int session_id) | 72 MetricsLog::MetricsLog(const std::string& client_id, int session_id) |
| 74 : MetricsLogBase(client_id, session_id, MetricsLog::GetVersionString()) {} | 73 : MetricsLogBase(client_id, session_id, MetricsLog::GetVersionString()) {} |
| 75 | 74 |
| 76 MetricsLog::~MetricsLog() {} | 75 MetricsLog::~MetricsLog() {} |
| 77 | 76 |
| 78 // static | 77 // static |
| 79 void MetricsLog::RegisterPrefs(PrefService* local_state) { | 78 void MetricsLog::RegisterPrefs(PrefService* local_state) { |
| 80 local_state->RegisterListPref(prefs::kStabilityPluginStats); | 79 local_state->RegisterListPref(prefs::kStabilityPluginStats); |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 const std::string result_type(AutocompleteMatch::TypeToString(i->type)); | 526 const std::string result_type(AutocompleteMatch::TypeToString(i->type)); |
| 528 if (!result_type.empty()) | 527 if (!result_type.empty()) |
| 529 WriteAttribute("resulttype", result_type); | 528 WriteAttribute("resulttype", result_type); |
| 530 WriteIntAttribute("relevance", i->relevance); | 529 WriteIntAttribute("relevance", i->relevance); |
| 531 WriteIntAttribute("isstarred", i->starred ? 1 : 0); | 530 WriteIntAttribute("isstarred", i->starred ? 1 : 0); |
| 532 } | 531 } |
| 533 } | 532 } |
| 534 | 533 |
| 535 ++num_events_; | 534 ++num_events_; |
| 536 } | 535 } |
| OLD | NEW |