| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "android_webview/renderer/aw_content_renderer_client.h" | 5 #include "android_webview/renderer/aw_content_renderer_client.h" |
| 6 | 6 |
| 7 #include "android_webview/common/aw_resource.h" | 7 #include "android_webview/common/aw_resource.h" |
| 8 #include "android_webview/common/render_view_messages.h" | 8 #include "android_webview/common/render_view_messages.h" |
| 9 #include "android_webview/common/url_constants.h" | 9 #include "android_webview/common/url_constants.h" |
| 10 #include "android_webview/renderer/aw_content_settings_client.h" | 10 #include "android_webview/renderer/aw_content_settings_client.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 void AwContentRendererClient::GetNavigationErrorStrings( | 105 void AwContentRendererClient::GetNavigationErrorStrings( |
| 106 content::RenderView* /* render_view */, | 106 content::RenderView* /* render_view */, |
| 107 blink::WebFrame* /* frame */, | 107 blink::WebFrame* /* frame */, |
| 108 const blink::WebURLRequest& failed_request, | 108 const blink::WebURLRequest& failed_request, |
| 109 const blink::WebURLError& error, | 109 const blink::WebURLError& error, |
| 110 std::string* error_html, | 110 std::string* error_html, |
| 111 base::string16* error_description) { | 111 base::string16* error_description) { |
| 112 if (error_html) { | 112 if (error_html) { |
| 113 GURL error_url(failed_request.url()); | 113 GURL error_url(failed_request.url()); |
| 114 std::string err = base::UTF16ToUTF8(error.localizedDescription); | 114 std::string err = |
| 115 base::UTF16ToUTF8(base::StringPiece16(error.localizedDescription)); |
| 115 std::string contents; | 116 std::string contents; |
| 116 if (err.empty()) { | 117 if (err.empty()) { |
| 117 contents = AwResource::GetNoDomainPageContent(); | 118 contents = AwResource::GetNoDomainPageContent(); |
| 118 } else { | 119 } else { |
| 119 contents = AwResource::GetLoadErrorPageContent(); | 120 contents = AwResource::GetLoadErrorPageContent(); |
| 120 base::ReplaceSubstringsAfterOffset(&contents, 0, "%e", err); | 121 base::ReplaceSubstringsAfterOffset(&contents, 0, "%e", err); |
| 121 } | 122 } |
| 122 | 123 |
| 123 base::ReplaceSubstringsAfterOffset(&contents, 0, "%s", | 124 base::ReplaceSubstringsAfterOffset(&contents, 0, "%s", |
| 124 net::EscapeForHTML(error_url.possibly_invalid_spec())); | 125 net::EscapeForHTML(error_url.possibly_invalid_spec())); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 149 | 150 |
| 150 bool AwContentRendererClient::ShouldOverridePageVisibilityState( | 151 bool AwContentRendererClient::ShouldOverridePageVisibilityState( |
| 151 const content::RenderFrame* render_frame, | 152 const content::RenderFrame* render_frame, |
| 152 blink::WebPageVisibilityState* override_state) { | 153 blink::WebPageVisibilityState* override_state) { |
| 153 // webview is always visible due to rendering requirements. | 154 // webview is always visible due to rendering requirements. |
| 154 *override_state = blink::WebPageVisibilityStateVisible; | 155 *override_state = blink::WebPageVisibilityStateVisible; |
| 155 return true; | 156 return true; |
| 156 } | 157 } |
| 157 | 158 |
| 158 } // namespace android_webview | 159 } // namespace android_webview |
| OLD | NEW |