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

Side by Side Diff: android_webview/browser/aw_content_browser_client.cc

Issue 2559243003: Extend with a language code in http accept languages
Patch Set: Rebased, fixed nits and handed over this CL :( Created 4 years 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/browser/net/aw_http_user_agent_settings.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/browser/aw_content_browser_client.h" 5 #include "android_webview/browser/aw_content_browser_client.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "android_webview/browser/aw_browser_context.h" 9 #include "android_webview/browser/aw_browser_context.h"
10 #include "android_webview/browser/aw_browser_main_parts.h" 10 #include "android_webview/browser/aw_browser_main_parts.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 void AwContentsMessageFilter::OnSubFrameCreated(int parent_render_frame_id, 155 void AwContentsMessageFilter::OnSubFrameCreated(int parent_render_frame_id,
156 int child_render_frame_id) { 156 int child_render_frame_id) {
157 AwContentsIoThreadClient::SubFrameCreated( 157 AwContentsIoThreadClient::SubFrameCreated(
158 process_id_, parent_render_frame_id, child_render_frame_id); 158 process_id_, parent_render_frame_id, child_render_frame_id);
159 } 159 }
160 160
161 AwLocaleManager* g_locale_manager = NULL; 161 AwLocaleManager* g_locale_manager = NULL;
162 162
163 } // anonymous namespace 163 } // anonymous namespace
164 164
165 // TODO(yirui): can use similar logic as in PrependToAcceptLanguagesIfNecessary
166 // in chrome/browser/android/preferences/pref_service_bridge.cc
167 // static 165 // static
168 std::string AwContentBrowserClient::GetAcceptLangsImpl() { 166 std::string AwContentBrowserClient::GetAcceptLangsImpl() {
169 // Start with the current locale(s) in BCP47 format. 167 // Start with the current locale(s) in BCP47 format.
170 std::string locales_string = g_locale_manager->GetLocaleList(); 168 std::string locales_string = g_locale_manager->GetLocaleList();
171 169
172 // If accept languages do not contain en-US, add in en-US which will be 170 // If accept languages do not contain en-US, add in en-US which will be
173 // used with a lower q-value. 171 // used with a lower q-value.
174 if (locales_string.find("en-US") == std::string::npos) 172 if (locales_string.find("en-US") == std::string::npos)
175 locales_string += ",en-US"; 173 locales_string += ",en-US";
176 return locales_string; 174 return locales_string;
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 558
561 void AwContentBrowserClient::RegisterRenderFrameMojoInterfaces( 559 void AwContentBrowserClient::RegisterRenderFrameMojoInterfaces(
562 service_manager::InterfaceRegistry* registry, 560 service_manager::InterfaceRegistry* registry,
563 content::RenderFrameHost* render_frame_host) { 561 content::RenderFrameHost* render_frame_host) {
564 registry->AddInterface( 562 registry->AddInterface(
565 base::Bind(&autofill::ContentAutofillDriverFactory::BindAutofillDriver, 563 base::Bind(&autofill::ContentAutofillDriverFactory::BindAutofillDriver,
566 render_frame_host)); 564 render_frame_host));
567 } 565 }
568 566
569 } // namespace android_webview 567 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/net/aw_http_user_agent_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698