| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 150 } |
| 151 | 151 |
| 152 void MetricsLog::WritePluginStabilityElements(PrefService* pref) { | 152 void MetricsLog::WritePluginStabilityElements(PrefService* pref) { |
| 153 // Now log plugin stability info. | 153 // Now log plugin stability info. |
| 154 const ListValue* plugin_stats_list = pref->GetList( | 154 const ListValue* plugin_stats_list = pref->GetList( |
| 155 prefs::kStabilityPluginStats); | 155 prefs::kStabilityPluginStats); |
| 156 if (plugin_stats_list) { | 156 if (plugin_stats_list) { |
| 157 OPEN_ELEMENT_FOR_SCOPE("plugins"); | 157 OPEN_ELEMENT_FOR_SCOPE("plugins"); |
| 158 for (ListValue::const_iterator iter = plugin_stats_list->begin(); | 158 for (ListValue::const_iterator iter = plugin_stats_list->begin(); |
| 159 iter != plugin_stats_list->end(); ++iter) { | 159 iter != plugin_stats_list->end(); ++iter) { |
| 160 if (!(*iter)->IsType(Value::TYPE_DICTIONARY)) { | 160 if (!(*iter)->IsDictionary()) { |
| 161 NOTREACHED(); | 161 NOTREACHED(); |
| 162 continue; | 162 continue; |
| 163 } | 163 } |
| 164 DictionaryValue* plugin_dict = static_cast<DictionaryValue*>(*iter); | 164 DictionaryValue* plugin_dict = static_cast<DictionaryValue*>(*iter); |
| 165 | 165 |
| 166 std::string plugin_name; | 166 std::string plugin_name; |
| 167 plugin_dict->GetString(prefs::kStabilityPluginName, &plugin_name); | 167 plugin_dict->GetString(prefs::kStabilityPluginName, &plugin_name); |
| 168 | 168 |
| 169 OPEN_ELEMENT_FOR_SCOPE("pluginstability"); | 169 OPEN_ELEMENT_FOR_SCOPE("pluginstability"); |
| 170 // Use "filename" instead of "name", otherwise we need to update the | 170 // Use "filename" instead of "name", otherwise we need to update the |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 const std::string result_type(AutocompleteMatch::TypeToString(i->type)); | 492 const std::string result_type(AutocompleteMatch::TypeToString(i->type)); |
| 493 if (!result_type.empty()) | 493 if (!result_type.empty()) |
| 494 WriteAttribute("resulttype", result_type); | 494 WriteAttribute("resulttype", result_type); |
| 495 WriteIntAttribute("relevance", i->relevance); | 495 WriteIntAttribute("relevance", i->relevance); |
| 496 WriteIntAttribute("isstarred", i->starred ? 1 : 0); | 496 WriteIntAttribute("isstarred", i->starred ? 1 : 0); |
| 497 } | 497 } |
| 498 } | 498 } |
| 499 | 499 |
| 500 ++num_events_; | 500 ++num_events_; |
| 501 } | 501 } |
| OLD | NEW |