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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 std::string* error_html, | 167 std::string* error_html, |
168 base::string16* error_description) { | 168 base::string16* error_description) { |
169 if (error_html) { | 169 if (error_html) { |
170 GURL error_url(failed_request.url()); | 170 GURL error_url(failed_request.url()); |
171 std::string err = base::UTF16ToUTF8(error.localizedDescription); | 171 std::string err = base::UTF16ToUTF8(error.localizedDescription); |
172 std::string contents; | 172 std::string contents; |
173 if (err.empty()) { | 173 if (err.empty()) { |
174 contents = AwResource::GetNoDomainPageContent(); | 174 contents = AwResource::GetNoDomainPageContent(); |
175 } else { | 175 } else { |
176 contents = AwResource::GetLoadErrorPageContent(); | 176 contents = AwResource::GetLoadErrorPageContent(); |
177 ReplaceSubstringsAfterOffset(&contents, 0, "%e", err); | 177 base::ReplaceSubstringsAfterOffset(&contents, 0, "%e", err); |
178 } | 178 } |
179 | 179 |
180 ReplaceSubstringsAfterOffset(&contents, 0, "%s", | 180 base::ReplaceSubstringsAfterOffset(&contents, 0, "%s", |
181 net::EscapeForHTML(error_url.possibly_invalid_spec())); | 181 net::EscapeForHTML(error_url.possibly_invalid_spec())); |
182 *error_html = contents; | 182 *error_html = contents; |
183 } | 183 } |
184 if (error_description) { | 184 if (error_description) { |
185 if (error.localizedDescription.isEmpty()) | 185 if (error.localizedDescription.isEmpty()) |
186 *error_description = base::ASCIIToUTF16(net::ErrorToString(error.reason)); | 186 *error_description = base::ASCIIToUTF16(net::ErrorToString(error.reason)); |
187 else | 187 else |
188 *error_description = error.localizedDescription; | 188 *error_description = error.localizedDescription; |
189 } | 189 } |
190 } | 190 } |
(...skipping 15 matching lines...) Expand all Loading... |
206 | 206 |
207 bool AwContentRendererClient::ShouldOverridePageVisibilityState( | 207 bool AwContentRendererClient::ShouldOverridePageVisibilityState( |
208 const content::RenderFrame* render_frame, | 208 const content::RenderFrame* render_frame, |
209 blink::WebPageVisibilityState* override_state) { | 209 blink::WebPageVisibilityState* override_state) { |
210 // webview is always visible due to rendering requirements. | 210 // webview is always visible due to rendering requirements. |
211 *override_state = blink::WebPageVisibilityStateVisible; | 211 *override_state = blink::WebPageVisibilityStateVisible; |
212 return true; | 212 return true; |
213 } | 213 } |
214 | 214 |
215 } // namespace android_webview | 215 } // namespace android_webview |
OLD | NEW |