Chromium Code Reviews| Index: content/renderer/render_view_impl.cc |
| =================================================================== |
| --- content/renderer/render_view_impl.cc (revision 225096) |
| +++ content/renderer/render_view_impl.cc (working copy) |
| @@ -133,6 +133,7 @@ |
| #include "net/base/data_url.h" |
| #include "net/base/escape.h" |
| #include "net/base/net_errors.h" |
| +#include "net/base/net_util.h" |
| #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| #include "net/http/http_util.h" |
| #include "third_party/WebKit/public/platform/WebCString.h" |
| @@ -2199,7 +2200,8 @@ |
| error_html = &html; |
| } else { |
| GetContentClient()->renderer()->GetNavigationErrorStrings( |
| - frame, failed_request, error, &alt_html, NULL); |
| + frame, failed_request, error, renderer_preferences_.accept_languages, |
| + &alt_html, NULL); |
| error_html = &alt_html; |
| } |
| @@ -3134,6 +3136,10 @@ |
| return ssl_status; |
| } |
| +const std::string& RenderViewImpl::GetAcceptLanguages() const { |
| + return renderer_preferences_.accept_languages; |
| +} |
| + |
| WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation( |
| WebFrame* frame, WebDataSource::ExtraData* extraData, |
| const WebURLRequest& request, WebNavigationType type, |
| @@ -3623,6 +3629,7 @@ |
| frame, |
| failed_request, |
| error, |
| + renderer_preferences_.accept_languages, |
| NULL, |
| ¶ms.error_description); |
| params.url = error.unreachableURL; |
| @@ -3869,6 +3876,7 @@ |
| frame, |
| failed_request, |
| error, |
| + renderer_preferences_.accept_languages, |
| NULL, |
| &error_description); |
| Send(new ViewHostMsg_DidFailLoadWithError(routing_id_, |
| @@ -4565,7 +4573,9 @@ |
| remove_params.ClearQuery(); |
| remove_params.ClearRef(); |
| const GURL url_to_send = failed_url.ReplaceComponents(remove_params); |
| - std::string spec_to_send = url_to_send.spec(); |
| + std::string spec_to_send = UTF16ToUTF8(net::FormatUrl(url_to_send, |
| + renderer_preferences_.accept_languages, net::kFormatUrlOmitNothing, |
| + net::UnescapeRule::NORMAL, NULL, NULL, NULL)); |
|
mmenke
2013/09/26 16:23:01
Believe this formatting violates the style guide.
mmenke
2013/09/26 16:23:01
I've reached out to the Link Doctor team to make s
mmenke
2013/09/26 18:28:22
After talking to the Link Doctor team, it looks li
yuusuke
2013/09/27 14:16:52
Done.
|
| // Notify link doctor of the url truncation by sending of "?" at the end. |
| if (failed_url.has_query()) |
| spec_to_send.append("?"); |