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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 net::URLRequestContextGetter* system_url_request_context_getter) { | 302 net::URLRequestContextGetter* system_url_request_context_getter) { |
302 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 303 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
303 DCHECK(!url_request_context_.get()); | 304 DCHECK(!url_request_context_.get()); |
304 | 305 |
305 scoped_refptr<net::CookieStore> cookie_store( | 306 scoped_refptr<net::CookieStore> cookie_store( |
306 content::CreatePersistentCookieStore( | 307 content::CreatePersistentCookieStore( |
307 CookieFilePath(), | 308 CookieFilePath(), |
308 false, | 309 false, |
309 NULL, | 310 NULL, |
310 NULL, | 311 NULL, |
311 scoped_refptr<base::SequencedTaskRunner>())); | 312 scoped_refptr<base::SequencedTaskRunner>(), |
| 313 scoped_ptr<content::CookieCryptoDelegate>())); |
312 | 314 |
313 url_request_context_.reset(new net::URLRequestContext); | 315 url_request_context_.reset(new net::URLRequestContext); |
314 // |system_url_request_context_getter| may be NULL during tests. | 316 // |system_url_request_context_getter| may be NULL during tests. |
315 if (system_url_request_context_getter) { | 317 if (system_url_request_context_getter) { |
316 url_request_context_->CopyFrom( | 318 url_request_context_->CopyFrom( |
317 system_url_request_context_getter->GetURLRequestContext()); | 319 system_url_request_context_getter->GetURLRequestContext()); |
318 } | 320 } |
319 url_request_context_->set_cookie_store(cookie_store.get()); | 321 url_request_context_->set_cookie_store(cookie_store.get()); |
320 } | 322 } |
321 | 323 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 #if defined(FULL_SAFE_BROWSING) | 483 #if defined(FULL_SAFE_BROWSING) |
482 if (csd_service_.get()) | 484 if (csd_service_.get()) |
483 csd_service_->SetEnabledAndRefreshState(enable); | 485 csd_service_->SetEnabledAndRefreshState(enable); |
484 if (download_service_.get()) { | 486 if (download_service_.get()) { |
485 download_service_->SetEnabled( | 487 download_service_->SetEnabled( |
486 enable && !CommandLine::ForCurrentProcess()->HasSwitch( | 488 enable && !CommandLine::ForCurrentProcess()->HasSwitch( |
487 switches::kDisableImprovedDownloadProtection)); | 489 switches::kDisableImprovedDownloadProtection)); |
488 } | 490 } |
489 #endif | 491 #endif |
490 } | 492 } |
OLD | NEW |