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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 if (!profile_manager) { | 179 if (!profile_manager) { |
180 // The profile manager can be NULL when testing. | 180 // The profile manager can be NULL when testing. |
181 return NULL; | 181 return NULL; |
182 } | 182 } |
183 | 183 |
184 std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles(); | 184 std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles(); |
185 if (profiles.empty()) | 185 if (profiles.empty()) |
186 return NULL; | 186 return NULL; |
187 | 187 |
188 return PluginPrefs::GetForProfile(profiles.front()); | 188 return PluginPrefs::GetForProfile(profiles.front()).get(); |
189 } | 189 } |
190 | 190 |
191 // Fills |plugin| with the info contained in |plugin_info| and |plugin_prefs|. | 191 // Fills |plugin| with the info contained in |plugin_info| and |plugin_prefs|. |
192 void SetPluginInfo(const webkit::WebPluginInfo& plugin_info, | 192 void SetPluginInfo(const webkit::WebPluginInfo& plugin_info, |
193 const PluginPrefs* plugin_prefs, | 193 const PluginPrefs* plugin_prefs, |
194 SystemProfileProto::Plugin* plugin) { | 194 SystemProfileProto::Plugin* plugin) { |
195 plugin->set_name(UTF16ToUTF8(plugin_info.name)); | 195 plugin->set_name(UTF16ToUTF8(plugin_info.name)); |
196 plugin->set_filename(plugin_info.path.BaseName().AsUTF8Unsafe()); | 196 plugin->set_filename(plugin_info.path.BaseName().AsUTF8Unsafe()); |
197 plugin->set_version(UTF16ToUTF8(plugin_info.version)); | 197 plugin->set_version(UTF16ToUTF8(plugin_info.version)); |
198 if (plugin_prefs) | 198 if (plugin_prefs) |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1021 ProductDataToProto(google_update_metrics.google_update_data, | 1021 ProductDataToProto(google_update_metrics.google_update_data, |
1022 google_update->mutable_google_update_status()); | 1022 google_update->mutable_google_update_status()); |
1023 } | 1023 } |
1024 | 1024 |
1025 if (!google_update_metrics.product_data.version.empty()) { | 1025 if (!google_update_metrics.product_data.version.empty()) { |
1026 ProductDataToProto(google_update_metrics.product_data, | 1026 ProductDataToProto(google_update_metrics.product_data, |
1027 google_update->mutable_client_status()); | 1027 google_update->mutable_client_status()); |
1028 } | 1028 } |
1029 #endif // defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) | 1029 #endif // defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) |
1030 } | 1030 } |
OLD | NEW |