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

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

Issue 1200393002: Add more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string
Patch Set: Android Created 5 years, 6 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 | « android_webview/native/aw_media_url_interceptor.cc ('k') | ash/system/user/login_status.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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « android_webview/native/aw_media_url_interceptor.cc ('k') | ash/system/user/login_status.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698