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

Side by Side Diff: android_webview/renderer/aw_content_renderer_client.cc

Issue 1259673002: Make UTF16ToASCII and UTF16TOUTF8 take a StringPiece (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months 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
« no previous file with comments | « no previous file | android_webview/renderer/aw_render_view_ext.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | android_webview/renderer/aw_render_view_ext.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698