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/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/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
981 return false; | 981 return false; |
982 } | 982 } |
983 | 983 |
984 *error_domain = LocalizedError::kHttpErrorDomain; | 984 *error_domain = LocalizedError::kHttpErrorDomain; |
985 return true; | 985 return true; |
986 } | 986 } |
987 | 987 |
988 bool ChromeContentRendererClient::ShouldSuppressErrorPage( | 988 bool ChromeContentRendererClient::ShouldSuppressErrorPage( |
989 content::RenderFrame* render_frame, | 989 content::RenderFrame* render_frame, |
990 const GURL& url) { | 990 const GURL& url) { |
991 if (render_frame->GetRenderView()->GetMainRenderFrame() == render_frame | |
992 && NetErrorHelper::Get(render_frame)->ShouldSuppressErrorPage(url)) | |
mmenke
2014/03/04 17:26:25
Optional: I think it's cleaner not to have the ma
Elly Fong-Jones
2014/03/06 21:48:37
Done.
| |
993 return true; | |
mmenke
2014/03/04 17:26:25
nit: Use braces when either part of an if takes m
Elly Fong-Jones
2014/03/06 21:48:37
Done.
| |
991 // Do not flash an error page if the Instant new tab page fails to load. | 994 // Do not flash an error page if the Instant new tab page fails to load. |
992 return search_bouncer_.get() && search_bouncer_->IsNewTabPage(url); | 995 return search_bouncer_.get() && search_bouncer_->IsNewTabPage(url); |
993 } | 996 } |
994 | 997 |
995 void ChromeContentRendererClient::GetNavigationErrorStrings( | 998 void ChromeContentRendererClient::GetNavigationErrorStrings( |
996 content::RenderView* render_view, | 999 content::RenderView* render_view, |
997 blink::WebFrame* frame, | 1000 blink::WebFrame* frame, |
998 const blink::WebURLRequest& failed_request, | 1001 const blink::WebURLRequest& failed_request, |
999 const blink::WebURLError& error, | 1002 const blink::WebURLError& error, |
1000 std::string* error_html, | 1003 std::string* error_html, |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1437 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1440 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
1438 return !command_line->HasSwitch(extensions::switches::kExtensionProcess); | 1441 return !command_line->HasSwitch(extensions::switches::kExtensionProcess); |
1439 } | 1442 } |
1440 | 1443 |
1441 blink::WebWorkerPermissionClientProxy* | 1444 blink::WebWorkerPermissionClientProxy* |
1442 ChromeContentRendererClient::CreateWorkerPermissionClientProxy( | 1445 ChromeContentRendererClient::CreateWorkerPermissionClientProxy( |
1443 content::RenderFrame* render_frame, | 1446 content::RenderFrame* render_frame, |
1444 blink::WebFrame* frame) { | 1447 blink::WebFrame* frame) { |
1445 return new WorkerPermissionClientProxy(render_frame, frame); | 1448 return new WorkerPermissionClientProxy(render_frame, frame); |
1446 } | 1449 } |
OLD | NEW |