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

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 separate Generate AcceptLanguage Header from http_util 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
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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 void AwContentsMessageFilter::OnSubFrameCreated(int parent_render_frame_id, 153 void AwContentsMessageFilter::OnSubFrameCreated(int parent_render_frame_id,
154 int child_render_frame_id) { 154 int child_render_frame_id) {
155 AwContentsIoThreadClient::SubFrameCreated( 155 AwContentsIoThreadClient::SubFrameCreated(
156 process_id_, parent_render_frame_id, child_render_frame_id); 156 process_id_, parent_render_frame_id, child_render_frame_id);
157 } 157 }
158 158
159 AwLocaleManager* g_locale_manager = NULL; 159 AwLocaleManager* g_locale_manager = NULL;
160 160
161 } // anonymous namespace 161 } // anonymous namespace
162 162
163 // TODO(yirui): can use similar logic as in PrependToAcceptLanguagesIfNecessary
164 // in chrome/browser/android/preferences/pref_service_bridge.cc
165 // static 163 // static
166 std::string AwContentBrowserClient::GetAcceptLangsImpl() { 164 std::string AwContentBrowserClient::GetAcceptLangsImpl() {
167 // Start with the current locale(s) in BCP47 format. 165 // Start with the current locale(s) in BCP47 format.
168 std::string locales_string = g_locale_manager->GetLocaleList(); 166 std::string locales_string = g_locale_manager->GetLocaleList();
169 167
170 // If accept languages do not contain en-US, add in en-US which will be 168 // If accept languages do not contain en-US, add in en-US which will be
171 // used with a lower q-value. 169 // used with a lower q-value.
172 if (locales_string.find("en-US") == std::string::npos) 170 if (locales_string.find("en-US") == std::string::npos)
173 locales_string += ",en-US"; 171 locales_string += ",en-US";
174 return locales_string; 172 return locales_string;
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 545
548 void AwContentBrowserClient::RegisterRenderFrameMojoInterfaces( 546 void AwContentBrowserClient::RegisterRenderFrameMojoInterfaces(
549 service_manager::InterfaceRegistry* registry, 547 service_manager::InterfaceRegistry* registry,
550 content::RenderFrameHost* render_frame_host) { 548 content::RenderFrameHost* render_frame_host) {
551 registry->AddInterface( 549 registry->AddInterface(
552 base::Bind(&autofill::ContentAutofillDriverFactory::BindAutofillDriver, 550 base::Bind(&autofill::ContentAutofillDriverFactory::BindAutofillDriver,
553 render_frame_host)); 551 render_frame_host));
554 } 552 }
555 553
556 } // namespace android_webview 554 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698