| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include "chrome/browser/safe_browsing/chrome_password_protection_service.h" | 4 #include "chrome/browser/safe_browsing/chrome_password_protection_service.h" |
| 5 | 5 |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/test/scoped_feature_list.h" | 7 #include "base/test/scoped_feature_list.h" |
| 8 #include "chrome/browser/safe_browsing/ui_manager.h" | 8 #include "chrome/browser/safe_browsing/ui_manager.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 return {{"incognito", allowed_for_incognito ? "true" : "false"}, | 127 return {{"incognito", allowed_for_incognito ? "true" : "false"}, |
| 128 {"all_population", allowed_for_all ? "true" : "false"}, | 128 {"all_population", allowed_for_all ? "true" : "false"}, |
| 129 {"extended_reporting", | 129 {"extended_reporting", |
| 130 allowed_for_extended_reporting ? "true" : "false"}, | 130 allowed_for_extended_reporting ? "true" : "false"}, |
| 131 {"history_sync", allowed_for_history_sync ? "true" : "false"}}; | 131 {"history_sync", allowed_for_history_sync ? "true" : "false"}}; |
| 132 } | 132 } |
| 133 | 133 |
| 134 void InitializeRequest(LoginReputationClientRequest::TriggerType type) { | 134 void InitializeRequest(LoginReputationClientRequest::TriggerType type) { |
| 135 request_ = new PasswordProtectionRequest(web_contents(), GURL(kPhishingURL), | 135 request_ = new PasswordProtectionRequest(web_contents(), GURL(kPhishingURL), |
| 136 GURL(), GURL(), std::string(), | 136 GURL(), GURL(), std::string(), |
| 137 type, service_.get(), 0); | 137 type, true, service_.get(), 0); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void InitializeVerdict(LoginReputationClientResponse::VerdictType type) { | 140 void InitializeVerdict(LoginReputationClientResponse::VerdictType type) { |
| 141 verdict_ = base::MakeUnique<LoginReputationClientResponse>(); | 141 verdict_ = base::MakeUnique<LoginReputationClientResponse>(); |
| 142 verdict_->set_verdict_type(type); | 142 verdict_->set_verdict_type(type); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void RequestFinished( | 145 void RequestFinished( |
| 146 PasswordProtectionRequest* request, | 146 PasswordProtectionRequest* request, |
| 147 std::unique_ptr<LoginReputationClientResponse> response) { | 147 std::unique_ptr<LoginReputationClientResponse> response) { |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 InitializeVerdict(LoginReputationClientResponse::LOW_REPUTATION); | 434 InitializeVerdict(LoginReputationClientResponse::LOW_REPUTATION); |
| 435 RequestFinished(request_.get(), std::move(verdict_)); | 435 RequestFinished(request_.get(), std::move(verdict_)); |
| 436 | 436 |
| 437 // For protected password entry request, no interstitial shown if verdict is | 437 // For protected password entry request, no interstitial shown if verdict is |
| 438 // SAFE. | 438 // SAFE. |
| 439 InitializeVerdict(LoginReputationClientResponse::SAFE); | 439 InitializeVerdict(LoginReputationClientResponse::SAFE); |
| 440 RequestFinished(request_.get(), std::move(verdict_)); | 440 RequestFinished(request_.get(), std::move(verdict_)); |
| 441 } | 441 } |
| 442 | 442 |
| 443 } // namespace safe_browsing | 443 } // namespace safe_browsing |
| OLD | NEW |