| 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/renderer_host/chrome_resource_dispatcher_host_delegate.
h" | 5 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "chrome/browser/signin/chrome_signin_helper.h" | 38 #include "chrome/browser/signin/chrome_signin_helper.h" |
| 39 #include "chrome/browser/tab_contents/tab_util.h" | 39 #include "chrome/browser/tab_contents/tab_util.h" |
| 40 #include "chrome/browser/ui/login/login_handler.h" | 40 #include "chrome/browser/ui/login/login_handler.h" |
| 41 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
| 42 #include "chrome/common/features.h" | 42 #include "chrome/common/features.h" |
| 43 #include "chrome/common/url_constants.h" | 43 #include "chrome/common/url_constants.h" |
| 44 #include "components/content_settings/core/browser/host_content_settings_map.h" | 44 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 45 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" | 45 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
| 46 #include "components/google/core/browser/google_util.h" | 46 #include "components/google/core/browser/google_util.h" |
| 47 #include "components/policy/core/common/cloud/policy_header_io_helper.h" | 47 #include "components/policy/core/common/cloud/policy_header_io_helper.h" |
| 48 #include "components/search_engines/template_url_prepopulate_data.h" | |
| 49 #include "components/search_engines/template_url_service.h" | 48 #include "components/search_engines/template_url_service.h" |
| 50 #include "components/variations/net/variations_http_headers.h" | 49 #include "components/variations/net/variations_http_headers.h" |
| 51 #include "content/public/browser/browser_thread.h" | 50 #include "content/public/browser/browser_thread.h" |
| 52 #include "content/public/browser/notification_service.h" | 51 #include "content/public/browser/notification_service.h" |
| 53 #include "content/public/browser/plugin_service.h" | 52 #include "content/public/browser/plugin_service.h" |
| 54 #include "content/public/browser/plugin_service_filter.h" | 53 #include "content/public/browser/plugin_service_filter.h" |
| 55 #include "content/public/browser/render_process_host.h" | 54 #include "content/public/browser/render_process_host.h" |
| 56 #include "content/public/browser/render_view_host.h" | 55 #include "content/public/browser/render_view_host.h" |
| 57 #include "content/public/browser/resource_context.h" | 56 #include "content/public/browser/resource_context.h" |
| 58 #include "content/public/browser/resource_dispatcher_host.h" | 57 #include "content/public/browser/resource_dispatcher_host.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 // be shown. As of April 2016, only Bing and Google have remote NTPs. | 292 // be shown. As of April 2016, only Bing and Google have remote NTPs. |
| 294 if (url.SchemeIsHTTPOrHTTPS()) { | 293 if (url.SchemeIsHTTPOrHTTPS()) { |
| 295 TemplateURLService* template_url_service = | 294 TemplateURLService* template_url_service = |
| 296 TemplateURLServiceFactory::GetForProfile(profile); | 295 TemplateURLServiceFactory::GetForProfile(profile); |
| 297 if (!template_url_service) | 296 if (!template_url_service) |
| 298 return; | 297 return; |
| 299 TemplateURL* default_provider = | 298 TemplateURL* default_provider = |
| 300 template_url_service->GetDefaultSearchProvider(); | 299 template_url_service->GetDefaultSearchProvider(); |
| 301 if (!default_provider) | 300 if (!default_provider) |
| 302 return; | 301 return; |
| 303 if (TemplateURLPrepopulateData::GetEngineType( | 302 if (default_provider->GetEngineType( |
| 304 *default_provider, template_url_service->search_terms_data()) == | 303 template_url_service->search_terms_data()) == |
| 305 SearchEngineType::SEARCH_ENGINE_GOOGLE) { | 304 SearchEngineType::SEARCH_ENGINE_GOOGLE) { |
| 306 if (net_error == net::OK) { | 305 if (net_error == net::OK) { |
| 307 UMA_HISTOGRAM_LONG_TIMES("Net.NTP.Google.RequestTime2.Success", | 306 UMA_HISTOGRAM_LONG_TIMES("Net.NTP.Google.RequestTime2.Success", |
| 308 request_loading_time); | 307 request_loading_time); |
| 309 } else if (net_error == net::ERR_ABORTED) { | 308 } else if (net_error == net::ERR_ABORTED) { |
| 310 UMA_HISTOGRAM_LONG_TIMES("Net.NTP.Google.RequestTime2.ErrAborted", | 309 UMA_HISTOGRAM_LONG_TIMES("Net.NTP.Google.RequestTime2.ErrAborted", |
| 311 request_loading_time); | 310 request_loading_time); |
| 312 } | 311 } |
| 313 } else { | 312 } else { |
| 314 if (net_error == net::OK) { | 313 if (net_error == net::OK) { |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); | 791 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); |
| 793 return false; | 792 return false; |
| 794 } | 793 } |
| 795 | 794 |
| 796 // static | 795 // static |
| 797 void ChromeResourceDispatcherHostDelegate:: | 796 void ChromeResourceDispatcherHostDelegate:: |
| 798 SetExternalProtocolHandlerDelegateForTesting( | 797 SetExternalProtocolHandlerDelegateForTesting( |
| 799 ExternalProtocolHandler::Delegate* delegate) { | 798 ExternalProtocolHandler::Delegate* delegate) { |
| 800 g_external_protocol_handler_delegate = delegate; | 799 g_external_protocol_handler_delegate = delegate; |
| 801 } | 800 } |
| OLD | NEW |