| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ui/search/new_tab_page_interceptor_service.h" | 5 #include "chrome/browser/ui/search/new_tab_page_interceptor_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 void NewTabPageInterceptorService::OnTemplateURLServiceChanged() { | 110 void NewTabPageInterceptorService::OnTemplateURLServiceChanged() { |
| 111 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 111 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 112 GURL new_tab_page_url(search::GetNewTabPageURL(profile_)); | 112 GURL new_tab_page_url(search::GetNewTabPageURL(profile_)); |
| 113 content::BrowserThread::PostTask( | 113 content::BrowserThread::PostTask( |
| 114 content::BrowserThread::IO, FROM_HERE, | 114 content::BrowserThread::IO, FROM_HERE, |
| 115 base::Bind(&NewTabPageInterceptor::SetNewTabPageURL, interceptor_, | 115 base::Bind(&NewTabPageInterceptor::SetNewTabPageURL, interceptor_, |
| 116 new_tab_page_url)); | 116 new_tab_page_url)); |
| 117 } | 117 } |
| 118 | 118 |
| 119 scoped_ptr<net::URLRequestInterceptor> | 119 std::unique_ptr<net::URLRequestInterceptor> |
| 120 NewTabPageInterceptorService::CreateInterceptor() { | 120 NewTabPageInterceptorService::CreateInterceptor() { |
| 121 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 121 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 122 scoped_ptr<NewTabPageInterceptor> interceptor( | 122 std::unique_ptr<NewTabPageInterceptor> interceptor( |
| 123 new NewTabPageInterceptor(search::GetNewTabPageURL(profile_))); | 123 new NewTabPageInterceptor(search::GetNewTabPageURL(profile_))); |
| 124 interceptor_ = interceptor->GetWeakPtr(); | 124 interceptor_ = interceptor->GetWeakPtr(); |
| 125 return std::move(interceptor); | 125 return std::move(interceptor); |
| 126 } | 126 } |
| OLD | NEW |