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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 if (!profile_manager) { | 186 if (!profile_manager) { |
187 // The profile manager can be NULL when testing. | 187 // The profile manager can be NULL when testing. |
188 return NULL; | 188 return NULL; |
189 } | 189 } |
190 | 190 |
191 std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles(); | 191 std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles(); |
192 if (profiles.empty()) | 192 if (profiles.empty()) |
193 return NULL; | 193 return NULL; |
194 | 194 |
195 return PluginPrefs::GetForProfile(profiles.front()); | 195 return PluginPrefs::GetForProfile(profiles.front()).get(); |
196 } | 196 } |
197 | 197 |
198 // Fills |plugin| with the info contained in |plugin_info| and |plugin_prefs|. | 198 // Fills |plugin| with the info contained in |plugin_info| and |plugin_prefs|. |
199 void SetPluginInfo(const webkit::WebPluginInfo& plugin_info, | 199 void SetPluginInfo(const webkit::WebPluginInfo& plugin_info, |
200 const PluginPrefs* plugin_prefs, | 200 const PluginPrefs* plugin_prefs, |
201 SystemProfileProto::Plugin* plugin) { | 201 SystemProfileProto::Plugin* plugin) { |
202 plugin->set_name(UTF16ToUTF8(plugin_info.name)); | 202 plugin->set_name(UTF16ToUTF8(plugin_info.name)); |
203 plugin->set_filename(plugin_info.path.BaseName().AsUTF8Unsafe()); | 203 plugin->set_filename(plugin_info.path.BaseName().AsUTF8Unsafe()); |
204 plugin->set_version(UTF16ToUTF8(plugin_info.version)); | 204 plugin->set_version(UTF16ToUTF8(plugin_info.version)); |
205 if (plugin_prefs) | 205 if (plugin_prefs) |
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 | 1179 |
1180 paired_device->set_vendor_prefix(vendor_prefix); | 1180 paired_device->set_vendor_prefix(vendor_prefix); |
1181 } | 1181 } |
1182 | 1182 |
1183 paired_device->set_vendor_id(device->GetVendorID()); | 1183 paired_device->set_vendor_id(device->GetVendorID()); |
1184 paired_device->set_product_id(device->GetProductID()); | 1184 paired_device->set_product_id(device->GetProductID()); |
1185 paired_device->set_device_id(device->GetDeviceID()); | 1185 paired_device->set_device_id(device->GetDeviceID()); |
1186 } | 1186 } |
1187 #endif // defined(OS_CHROMEOS) | 1187 #endif // defined(OS_CHROMEOS) |
1188 } | 1188 } |
OLD | NEW |