| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |