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 19 matching lines...) Expand all Loading... |
30 #include "chrome/browser/safe_browsing/protocol_manager.h" | 30 #include "chrome/browser/safe_browsing/protocol_manager.h" |
31 #include "chrome/browser/safe_browsing/safe_browsing_database.h" | 31 #include "chrome/browser/safe_browsing/safe_browsing_database.h" |
32 #include "chrome/browser/safe_browsing/ui_manager.h" | 32 #include "chrome/browser/safe_browsing/ui_manager.h" |
33 #include "chrome/common/chrome_constants.h" | 33 #include "chrome/common/chrome_constants.h" |
34 #include "chrome/common/chrome_paths.h" | 34 #include "chrome/common/chrome_paths.h" |
35 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
36 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
37 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
38 #include "components/startup_metric_utils/startup_metric_utils.h" | 38 #include "components/startup_metric_utils/startup_metric_utils.h" |
39 #include "content/public/browser/browser_thread.h" | 39 #include "content/public/browser/browser_thread.h" |
| 40 #include "content/public/browser/cookie_crypto_delegate.h" |
40 #include "content/public/browser/cookie_store_factory.h" | 41 #include "content/public/browser/cookie_store_factory.h" |
41 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
42 #include "net/cookies/cookie_monster.h" | 43 #include "net/cookies/cookie_monster.h" |
43 #include "net/url_request/url_request_context.h" | 44 #include "net/url_request/url_request_context.h" |
44 #include "net/url_request/url_request_context_getter.h" | 45 #include "net/url_request/url_request_context_getter.h" |
45 | 46 |
46 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
47 #include "chrome/installer/util/browser_distribution.h" | 48 #include "chrome/installer/util/browser_distribution.h" |
48 #endif | 49 #endif |
49 | 50 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 void SafeBrowsingService::InitURLRequestContextOnIOThread( | 303 void SafeBrowsingService::InitURLRequestContextOnIOThread( |
303 net::URLRequestContextGetter* system_url_request_context_getter) { | 304 net::URLRequestContextGetter* system_url_request_context_getter) { |
304 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 305 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
305 DCHECK(!url_request_context_.get()); | 306 DCHECK(!url_request_context_.get()); |
306 | 307 |
307 scoped_refptr<net::CookieStore> cookie_store( | 308 scoped_refptr<net::CookieStore> cookie_store( |
308 content::CreatePersistentCookieStore( | 309 content::CreatePersistentCookieStore( |
309 CookieFilePath(), | 310 CookieFilePath(), |
310 false, | 311 false, |
311 NULL, | 312 NULL, |
312 NULL)); | 313 NULL, |
| 314 scoped_ptr<content::CookieCryptoDelegate>())); |
313 | 315 |
314 url_request_context_.reset(new net::URLRequestContext); | 316 url_request_context_.reset(new net::URLRequestContext); |
315 // |system_url_request_context_getter| may be NULL during tests. | 317 // |system_url_request_context_getter| may be NULL during tests. |
316 if (system_url_request_context_getter) { | 318 if (system_url_request_context_getter) { |
317 url_request_context_->CopyFrom( | 319 url_request_context_->CopyFrom( |
318 system_url_request_context_getter->GetURLRequestContext()); | 320 system_url_request_context_getter->GetURLRequestContext()); |
319 } | 321 } |
320 url_request_context_->set_cookie_store(cookie_store.get()); | 322 url_request_context_->set_cookie_store(cookie_store.get()); |
321 } | 323 } |
322 | 324 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 #if defined(FULL_SAFE_BROWSING) | 486 #if defined(FULL_SAFE_BROWSING) |
485 if (csd_service_.get()) | 487 if (csd_service_.get()) |
486 csd_service_->SetEnabledAndRefreshState(enable); | 488 csd_service_->SetEnabledAndRefreshState(enable); |
487 if (download_service_.get()) { | 489 if (download_service_.get()) { |
488 download_service_->SetEnabled( | 490 download_service_->SetEnabled( |
489 enable && !CommandLine::ForCurrentProcess()->HasSwitch( | 491 enable && !CommandLine::ForCurrentProcess()->HasSwitch( |
490 switches::kDisableImprovedDownloadProtection)); | 492 switches::kDisableImprovedDownloadProtection)); |
491 } | 493 } |
492 #endif | 494 #endif |
493 } | 495 } |
OLD | NEW |