Chromium Code Reviews| Index: chrome/browser/download/download_browsertest.cc |
| diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc |
| index 00954d212feb5905851d866209819017b0ce9686..35a82cc10f7cfbef97c67c800f7b36762dd045a7 100644 |
| --- a/chrome/browser/download/download_browsertest.cc |
| +++ b/chrome/browser/download/download_browsertest.cc |
| @@ -1077,80 +1077,84 @@ class DownloadTest : public InProcessBrowserTest { |
| scoped_ptr<DownloadTestFileActivityObserver> file_activity_observer_; |
| }; |
| -class FakeDownloadProtectionService |
| - : public safe_browsing::DownloadProtectionService { |
| - public: |
| - FakeDownloadProtectionService() |
| - : safe_browsing::DownloadProtectionService(nullptr, nullptr) {} |
| +namespace { |
| - void CheckClientDownload(DownloadItem* download_item, |
| - const CheckDownloadCallback& callback) override { |
| - callback.Run( |
| - safe_browsing::DownloadProtectionService::UNCOMMON); |
| - } |
| -}; |
| + class FakeDownloadProtectionService |
|
Nico
2016/03/21 19:51:01
don't intend inside of namespaces.
(in general, r
|
| + : public safe_browsing::DownloadProtectionService { |
| + public: |
| + FakeDownloadProtectionService() |
| + : safe_browsing::DownloadProtectionService(nullptr, nullptr) {} |
| -class FakeSafeBrowsingService : public safe_browsing::SafeBrowsingService { |
| - public: |
| - FakeSafeBrowsingService() {} |
| + void CheckClientDownload(DownloadItem* download_item, |
| + const CheckDownloadCallback& callback) override { |
| + callback.Run( |
| + safe_browsing::DownloadProtectionService::UNCOMMON); |
| + } |
| + }; |
| - safe_browsing::DownloadProtectionService* CreateDownloadProtectionService( |
| - net::URLRequestContextGetter* not_used_request_context_getter) override { |
| - return new FakeDownloadProtectionService(); |
| - } |
| + class FakeSafeBrowsingService : public safe_browsing::SafeBrowsingService { |
| + public: |
| + FakeSafeBrowsingService() {} |
| - std::string GetDownloadReport() const { return report_; } |
| + safe_browsing::DownloadProtectionService* CreateDownloadProtectionService( |
| + net::URLRequestContextGetter* unused_request_context_getter) override { |
| + return new FakeDownloadProtectionService(); |
| + } |
| - protected: |
| - ~FakeSafeBrowsingService() override {} |
| + std::string GetDownloadReport() const { return report_; } |
| - void SendSerializedDownloadReport(const std::string& report) override { |
| - report_ = report; |
| - } |
| + protected: |
| + ~FakeSafeBrowsingService() override {} |
| - std::string report_; |
| -}; |
| + void SendSerializedDownloadReport(const std::string& report) override { |
| + report_ = report; |
| + } |
| -// Factory that creates FakeSafeBrowsingService instances. |
| -class TestSafeBrowsingServiceFactory |
| - : public safe_browsing::SafeBrowsingServiceFactory { |
| - public: |
| - TestSafeBrowsingServiceFactory() : fake_safe_browsing_service_(nullptr) {} |
| - ~TestSafeBrowsingServiceFactory() override {} |
| + std::string report_; |
| + }; |
| - safe_browsing::SafeBrowsingService* CreateSafeBrowsingService() override { |
| - DCHECK(!fake_safe_browsing_service_); |
| - fake_safe_browsing_service_ = new FakeSafeBrowsingService(); |
| - return fake_safe_browsing_service_.get(); |
| - } |
| + // Factory that creates FakeSafeBrowsingService instances. |
| + class TestSafeBrowsingServiceFactory |
| + : public safe_browsing::SafeBrowsingServiceFactory { |
| + public: |
| + TestSafeBrowsingServiceFactory() : fake_safe_browsing_service_(nullptr) {} |
| + ~TestSafeBrowsingServiceFactory() override {} |
| + |
| + safe_browsing::SafeBrowsingService* CreateSafeBrowsingService() override { |
| + DCHECK(!fake_safe_browsing_service_); |
| + fake_safe_browsing_service_ = new FakeSafeBrowsingService(); |
| + return fake_safe_browsing_service_.get(); |
| + } |
| - scoped_refptr<FakeSafeBrowsingService> fake_safe_browsing_service() { |
| - return fake_safe_browsing_service_; |
| - } |
| + scoped_refptr<FakeSafeBrowsingService> fake_safe_browsing_service() { |
| + return fake_safe_browsing_service_; |
| + } |
| - private: |
| - scoped_refptr<FakeSafeBrowsingService> fake_safe_browsing_service_; |
| -}; |
| + private: |
| + scoped_refptr<FakeSafeBrowsingService> fake_safe_browsing_service_; |
| + }; |
| -class DownloadTestWithFakeSafeBrowsing : public DownloadTest { |
| - public: |
| - DownloadTestWithFakeSafeBrowsing() |
| - : test_safe_browsing_factory_(new TestSafeBrowsingServiceFactory()) {} |
| + class DownloadTestWithFakeSafeBrowsing : public DownloadTest { |
| + public: |
| + DownloadTestWithFakeSafeBrowsing() |
| + : test_safe_browsing_factory_(new TestSafeBrowsingServiceFactory()) {} |
| - void SetUp() override { |
| - safe_browsing::SafeBrowsingService::RegisterFactory( |
| - test_safe_browsing_factory_.get()); |
| - DownloadTest::SetUp(); |
| - } |
| + void SetUp() override { |
| + safe_browsing::SafeBrowsingService::RegisterFactory( |
| + test_safe_browsing_factory_.get()); |
| + DownloadTest::SetUp(); |
| + } |
| - void TearDown() override { |
| - safe_browsing::SafeBrowsingService::RegisterFactory(nullptr); |
| - DownloadTest::TearDown(); |
| - } |
| + void TearDown() override { |
| + safe_browsing::SafeBrowsingService::RegisterFactory(nullptr); |
| + DownloadTest::TearDown(); |
| + } |
| - protected: |
| - scoped_ptr<TestSafeBrowsingServiceFactory> test_safe_browsing_factory_; |
| -}; |
| + protected: |
| + scoped_ptr<TestSafeBrowsingServiceFactory> test_safe_browsing_factory_; |
| + }; |
| + |
| +} // namespace |
| // NOTES: |
| // |