Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 1423713015: [WIP] WebRestrictions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 #include "components/nacl/renderer/ppb_nacl_private_impl.h" 64 #include "components/nacl/renderer/ppb_nacl_private_impl.h"
65 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" 65 #include "components/network_hints/renderer/prescient_networking_dispatcher.h"
66 #include "components/page_load_metrics/renderer/metrics_render_frame_observer.h" 66 #include "components/page_load_metrics/renderer/metrics_render_frame_observer.h"
67 #include "components/password_manager/content/renderer/credential_manager_client .h" 67 #include "components/password_manager/content/renderer/credential_manager_client .h"
68 #include "components/pdf/renderer/pepper_pdf_host.h" 68 #include "components/pdf/renderer/pepper_pdf_host.h"
69 #include "components/plugins/renderer/mobile_youtube_plugin.h" 69 #include "components/plugins/renderer/mobile_youtube_plugin.h"
70 #include "components/signin/core/common/profile_management_switches.h" 70 #include "components/signin/core/common/profile_management_switches.h"
71 #include "components/version_info/version_info.h" 71 #include "components/version_info/version_info.h"
72 #include "components/visitedlink/renderer/visitedlink_slave.h" 72 #include "components/visitedlink/renderer/visitedlink_slave.h"
73 #include "components/web_cache/renderer/web_cache_render_process_observer.h" 73 #include "components/web_cache/renderer/web_cache_render_process_observer.h"
74 #include "components/web_restriction/web_restriction_gin_wrapper.h"
74 #include "content/public/common/content_constants.h" 75 #include "content/public/common/content_constants.h"
75 #include "content/public/common/content_switches.h" 76 #include "content/public/common/content_switches.h"
76 #include "content/public/renderer/plugin_instance_throttler.h" 77 #include "content/public/renderer/plugin_instance_throttler.h"
77 #include "content/public/renderer/render_frame.h" 78 #include "content/public/renderer/render_frame.h"
78 #include "content/public/renderer/render_thread.h" 79 #include "content/public/renderer/render_thread.h"
79 #include "content/public/renderer/render_view.h" 80 #include "content/public/renderer/render_view.h"
80 #include "content/public/renderer/render_view_visitor.h" 81 #include "content/public/renderer/render_view_visitor.h"
81 #include "extensions/common/constants.h" 82 #include "extensions/common/constants.h"
82 #include "ipc/ipc_sync_channel.h" 83 #include "ipc/ipc_sync_channel.h"
83 #include "net/base/net_errors.h" 84 #include "net/base/net_errors.h"
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 content::RenderFrame* render_frame, 1096 content::RenderFrame* render_frame,
1096 const blink::WebURLRequest& failed_request, 1097 const blink::WebURLRequest& failed_request,
1097 const blink::WebURLError& error, 1098 const blink::WebURLError& error,
1098 std::string* error_html, 1099 std::string* error_html,
1099 base::string16* error_description) { 1100 base::string16* error_description) {
1100 const GURL failed_url = error.unreachableURL; 1101 const GURL failed_url = error.unreachableURL;
1101 1102
1102 bool is_post = base::EqualsASCII( 1103 bool is_post = base::EqualsASCII(
1103 base::StringPiece16(failed_request.httpMethod()), "POST"); 1104 base::StringPiece16(failed_request.httpMethod()), "POST");
1104 1105
1105 if (error_html) 1106 if (error_html) {
1106 NetErrorHelper::Get(render_frame)->GetErrorHTML(error, is_post, error_html); 1107 NetErrorHelper::Get(render_frame)->GetErrorHTML(error, is_post, error_html);
1108 web_restriction::WebRestrictionGinWrapper::Install(render_frame);
1109 }
1107 1110
1108 if (error_description) 1111 if (error_description)
1109 *error_description = LocalizedError::GetErrorDetails(error, is_post); 1112 *error_description = LocalizedError::GetErrorDetails(error, is_post);
1110 } 1113 }
1111 1114
1112 bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { 1115 bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() {
1113 #if defined(ENABLE_EXTENSIONS) 1116 #if defined(ENABLE_EXTENSIONS)
1114 return !IsStandaloneExtensionProcess(); 1117 return !IsStandaloneExtensionProcess();
1115 #else 1118 #else
1116 return true; 1119 return true;
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 // chrome.system.network.getNetworkInterfaces provides the same 1468 // chrome.system.network.getNetworkInterfaces provides the same
1466 // information. Also, the enforcement of sending and binding UDP is already done 1469 // information. Also, the enforcement of sending and binding UDP is already done
1467 // by chrome extension permission model. 1470 // by chrome extension permission model.
1468 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { 1471 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() {
1469 #if defined(ENABLE_EXTENSIONS) 1472 #if defined(ENABLE_EXTENSIONS)
1470 return !IsStandaloneExtensionProcess(); 1473 return !IsStandaloneExtensionProcess();
1471 #else 1474 #else
1472 return true; 1475 return true;
1473 #endif 1476 #endif
1474 } 1477 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698