| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 SafeBrowsingDisposition safe_browsing_opt_in) { | 144 SafeBrowsingDisposition safe_browsing_opt_in) { |
| 145 std::string profile_name("profile"); | 145 std::string profile_name("profile"); |
| 146 profile_name.append(base::IntToString(++profile_number_)); | 146 profile_name.append(base::IntToString(++profile_number_)); |
| 147 | 147 |
| 148 // Create prefs for the profile with safe browsing enabled or not. | 148 // Create prefs for the profile with safe browsing enabled or not. |
| 149 std::unique_ptr<syncable_prefs::TestingPrefServiceSyncable> prefs( | 149 std::unique_ptr<syncable_prefs::TestingPrefServiceSyncable> prefs( |
| 150 new syncable_prefs::TestingPrefServiceSyncable); | 150 new syncable_prefs::TestingPrefServiceSyncable); |
| 151 chrome::RegisterUserProfilePrefs(prefs->registry()); | 151 chrome::RegisterUserProfilePrefs(prefs->registry()); |
| 152 prefs->SetBoolean(prefs::kSafeBrowsingEnabled, | 152 prefs->SetBoolean(prefs::kSafeBrowsingEnabled, |
| 153 safe_browsing_opt_in == SAFE_BROWSING_OPT_IN); | 153 safe_browsing_opt_in == SAFE_BROWSING_OPT_IN); |
| 154 prefs->SetBoolean(GetExtendedReportingPrefName(), | 154 safe_browsing::SetExtendedReportingPref( |
| 155 safe_browsing_opt_in == SAFE_BROWSING_OPT_IN); | 155 prefs.get(), safe_browsing_opt_in == SAFE_BROWSING_OPT_IN); |
| 156 TestingProfile* profile = profile_manager_->CreateTestingProfile( | 156 TestingProfile* profile = profile_manager_->CreateTestingProfile( |
| 157 profile_name, std::move(prefs), | 157 profile_name, std::move(prefs), |
| 158 base::UTF8ToUTF16(profile_name), // user_name | 158 base::UTF8ToUTF16(profile_name), // user_name |
| 159 0, // avatar_id | 159 0, // avatar_id |
| 160 std::string(), // supervised_user_id | 160 std::string(), // supervised_user_id |
| 161 TestingProfile::TestingFactories()); | 161 TestingProfile::TestingFactories()); |
| 162 | 162 |
| 163 return base::MakeUnique<ExtensionTestingProfile>(profile); | 163 return base::MakeUnique<ExtensionTestingProfile>(profile); |
| 164 } | 164 } |
| 165 | 165 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 288 |
| 289 ASSERT_TRUE(data.has_last_installed_extension()); | 289 ASSERT_TRUE(data.has_last_installed_extension()); |
| 290 ClientIncidentReport_ExtensionData_ExtensionInfo extension_info = | 290 ClientIncidentReport_ExtensionData_ExtensionInfo extension_info = |
| 291 data.last_installed_extension(); | 291 data.last_installed_extension(); |
| 292 | 292 |
| 293 ASSERT_EQ(extension_info.id(), extension_id); | 293 ASSERT_EQ(extension_info.id(), extension_id); |
| 294 ASSERT_EQ(extension_info.name(), extension_name); | 294 ASSERT_EQ(extension_info.name(), extension_name); |
| 295 } | 295 } |
| 296 | 296 |
| 297 } // namespace safe_browsing | 297 } // namespace safe_browsing |
| OLD | NEW |