| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/safe_browsing/incident_reporting/extension_data_collect
ion.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/extension_data_collect
ion.h" |
| 6 | 6 |
| 7 #include "base/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/version.h" | 9 #include "base/version.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/extensions/extension_util.h" |
| 11 #include "chrome/browser/extensions/install_signer.h" | 12 #include "chrome/browser/extensions/install_signer.h" |
| 12 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
| 13 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" | 14 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" |
| 14 #include "chrome/common/safe_browsing/csd.pb.h" | 15 #include "chrome/common/safe_browsing/csd.pb.h" |
| 15 #include "extensions/browser/extension_prefs.h" | 16 #include "extensions/browser/extension_prefs.h" |
| 16 #include "extensions/browser/extension_prefs_factory.h" | 17 #include "extensions/browser/extension_prefs_factory.h" |
| 17 #include "extensions/browser/extension_registry.h" | 18 #include "extensions/browser/extension_registry.h" |
| 18 #include "extensions/browser/extension_registry_factory.h" | 19 #include "extensions/browser/extension_registry_factory.h" |
| 19 #include "extensions/common/extension_set.h" | 20 #include "extensions/common/extension_set.h" |
| 20 #include "extensions/common/manifest_constants.h" | 21 #include "extensions/common/manifest_constants.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 49 extension_info->set_state(Info::STATE_TERMINATED); | 50 extension_info->set_state(Info::STATE_TERMINATED); |
| 50 | 51 |
| 51 extension_info->set_type(extension.GetType()); | 52 extension_info->set_type(extension.GetType()); |
| 52 std::string update_url; | 53 std::string update_url; |
| 53 if (extension.manifest()->GetString(extensions::manifest_keys::kUpdateURL, | 54 if (extension.manifest()->GetString(extensions::manifest_keys::kUpdateURL, |
| 54 &update_url)) { | 55 &update_url)) { |
| 55 extension_info->set_update_url(update_url); | 56 extension_info->set_update_url(update_url); |
| 56 } | 57 } |
| 57 | 58 |
| 58 extension_info->set_installed_by_custodian( | 59 extension_info->set_installed_by_custodian( |
| 59 extension.was_installed_by_custodian()); | 60 extensions::util::WasInstalledByCustodian( |
| 61 extension.id(), extension_registry.browser_context())); |
| 60 extension_info->set_installed_by_default( | 62 extension_info->set_installed_by_default( |
| 61 extension.was_installed_by_default()); | 63 extension.was_installed_by_default()); |
| 62 extension_info->set_installed_by_oem(extension.was_installed_by_oem()); | 64 extension_info->set_installed_by_oem(extension.was_installed_by_oem()); |
| 63 extension_info->set_from_bookmark(extension.from_bookmark()); | 65 extension_info->set_from_bookmark(extension.from_bookmark()); |
| 64 extension_info->set_from_webstore(extension.from_webstore()); | 66 extension_info->set_from_webstore(extension.from_webstore()); |
| 65 extension_info->set_converted_from_user_script( | 67 extension_info->set_converted_from_user_script( |
| 66 extension.converted_from_user_script()); | 68 extension.converted_from_user_script()); |
| 67 extension_info->set_may_be_untrusted(extension.may_be_untrusted()); | 69 extension_info->set_may_be_untrusted(extension.may_be_untrusted()); |
| 68 extension_info->set_install_time_msec( | 70 extension_info->set_install_time_msec( |
| 69 extension_prefs.GetInstallTime(extension.id()).ToJavaTime()); | 71 extension_prefs.GetInstallTime(extension.id()).ToJavaTime()); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 *last_installed_extension, | 131 *last_installed_extension, |
| 130 *extensions::ExtensionPrefs::Get(profile_for_last_installed_extension), | 132 *extensions::ExtensionPrefs::Get(profile_for_last_installed_extension), |
| 131 *extensions::ExtensionRegistryFactory::GetForBrowserContext( | 133 *extensions::ExtensionRegistryFactory::GetForBrowserContext( |
| 132 profile_for_last_installed_extension), | 134 profile_for_last_installed_extension), |
| 133 data->mutable_last_installed_extension()); | 135 data->mutable_last_installed_extension()); |
| 134 } | 136 } |
| 135 #endif | 137 #endif |
| 136 } | 138 } |
| 137 | 139 |
| 138 } // namespace safe_browsing | 140 } // namespace safe_browsing |
| OLD | NEW |