| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 request_context_ = ChromeURLRequestContextGetter::CreateOriginal( | 709 request_context_ = ChromeURLRequestContextGetter::CreateOriginal( |
| 710 this, cookie_path, cache_path, max_size); | 710 this, cookie_path, cache_path, max_size); |
| 711 | 711 |
| 712 // The first request context is always a normal (non-OTR) request context. | 712 // The first request context is always a normal (non-OTR) request context. |
| 713 // Even when Chromium is started in OTR mode, a normal profile is always | 713 // Even when Chromium is started in OTR mode, a normal profile is always |
| 714 // created first. | 714 // created first. |
| 715 if (!default_request_context_) { | 715 if (!default_request_context_) { |
| 716 default_request_context_ = request_context_; | 716 default_request_context_ = request_context_; |
| 717 request_context_->set_is_main(true); | 717 request_context_->set_is_main(true); |
| 718 // TODO(eroman): this isn't terribly useful anymore now that the | 718 // TODO(eroman): this isn't terribly useful anymore now that the |
| 719 // URLRequestContext is constructed by the IO thread... | 719 // net::URLRequestContext is constructed by the IO thread... |
| 720 NotificationService::current()->Notify( | 720 NotificationService::current()->Notify( |
| 721 NotificationType::DEFAULT_REQUEST_CONTEXT_AVAILABLE, | 721 NotificationType::DEFAULT_REQUEST_CONTEXT_AVAILABLE, |
| 722 NotificationService::AllSources(), NotificationService::NoDetails()); | 722 NotificationService::AllSources(), NotificationService::NoDetails()); |
| 723 } | 723 } |
| 724 } | 724 } |
| 725 | 725 |
| 726 return request_context_; | 726 return request_context_; |
| 727 } | 727 } |
| 728 | 728 |
| 729 URLRequestContextGetter* ProfileImpl::GetRequestContextForMedia() { | 729 URLRequestContextGetter* ProfileImpl::GetRequestContextForMedia() { |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1388 } | 1388 } |
| 1389 | 1389 |
| 1390 PrerenderManager* ProfileImpl::GetPrerenderManager() { | 1390 PrerenderManager* ProfileImpl::GetPrerenderManager() { |
| 1391 CommandLine* cl = CommandLine::ForCurrentProcess(); | 1391 CommandLine* cl = CommandLine::ForCurrentProcess(); |
| 1392 if (!cl->HasSwitch(switches::kEnablePagePrerender)) | 1392 if (!cl->HasSwitch(switches::kEnablePagePrerender)) |
| 1393 return NULL; | 1393 return NULL; |
| 1394 if (!prerender_manager_) | 1394 if (!prerender_manager_) |
| 1395 prerender_manager_ = new PrerenderManager(this); | 1395 prerender_manager_ = new PrerenderManager(this); |
| 1396 return prerender_manager_; | 1396 return prerender_manager_; |
| 1397 } | 1397 } |
| OLD | NEW |