| 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/safe_browsing/safe_browsing_service.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 return network_task_runner_; | 123 return network_task_runner_; |
| 124 } | 124 } |
| 125 | 125 |
| 126 // static | 126 // static |
| 127 SafeBrowsingServiceFactory* SafeBrowsingService::factory_ = NULL; | 127 SafeBrowsingServiceFactory* SafeBrowsingService::factory_ = NULL; |
| 128 | 128 |
| 129 // The default SafeBrowsingServiceFactory. Global, made a singleton so we | 129 // The default SafeBrowsingServiceFactory. Global, made a singleton so we |
| 130 // don't leak it. | 130 // don't leak it. |
| 131 class SafeBrowsingServiceFactoryImpl : public SafeBrowsingServiceFactory { | 131 class SafeBrowsingServiceFactoryImpl : public SafeBrowsingServiceFactory { |
| 132 public: | 132 public: |
| 133 virtual SafeBrowsingService* CreateSafeBrowsingService() { | 133 virtual SafeBrowsingService* CreateSafeBrowsingService() OVERRIDE { |
| 134 return new SafeBrowsingService(); | 134 return new SafeBrowsingService(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 private: | 137 private: |
| 138 friend struct base::DefaultLazyInstanceTraits<SafeBrowsingServiceFactoryImpl>; | 138 friend struct base::DefaultLazyInstanceTraits<SafeBrowsingServiceFactoryImpl>; |
| 139 | 139 |
| 140 SafeBrowsingServiceFactoryImpl() { } | 140 SafeBrowsingServiceFactoryImpl() { } |
| 141 | 141 |
| 142 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactoryImpl); | 142 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactoryImpl); |
| 143 }; | 143 }; |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 #if defined(FULL_SAFE_BROWSING) | 481 #if defined(FULL_SAFE_BROWSING) |
| 482 if (csd_service_.get()) | 482 if (csd_service_.get()) |
| 483 csd_service_->SetEnabledAndRefreshState(enable); | 483 csd_service_->SetEnabledAndRefreshState(enable); |
| 484 if (download_service_.get()) { | 484 if (download_service_.get()) { |
| 485 download_service_->SetEnabled( | 485 download_service_->SetEnabled( |
| 486 enable && !CommandLine::ForCurrentProcess()->HasSwitch( | 486 enable && !CommandLine::ForCurrentProcess()->HasSwitch( |
| 487 switches::kDisableImprovedDownloadProtection)); | 487 switches::kDisableImprovedDownloadProtection)); |
| 488 } | 488 } |
| 489 #endif | 489 #endif |
| 490 } | 490 } |
| OLD | NEW |