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

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

Issue 628263004: [Android] Simplify logic for grabbing initial country-code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 "android_webview/browser/aw_browser_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_browser_main_parts.h" 8 #include "android_webview/browser/aw_browser_main_parts.h"
9 #include "android_webview/browser/aw_browser_permission_request_delegate.h" 9 #include "android_webview/browser/aw_browser_permission_request_delegate.h"
10 #include "android_webview/browser/aw_contents_client_bridge_base.h" 10 #include "android_webview/browser/aw_contents_client_bridge_base.h"
11 #include "android_webview/browser/aw_contents_io_thread_client.h" 11 #include "android_webview/browser/aw_contents_io_thread_client.h"
12 #include "android_webview/browser/aw_cookie_access_policy.h" 12 #include "android_webview/browser/aw_cookie_access_policy.h"
13 #include "android_webview/browser/aw_dev_tools_manager_delegate.h" 13 #include "android_webview/browser/aw_dev_tools_manager_delegate.h"
14 #include "android_webview/browser/aw_quota_permission_context.h" 14 #include "android_webview/browser/aw_quota_permission_context.h"
15 #include "android_webview/browser/aw_web_preferences_populater.h" 15 #include "android_webview/browser/aw_web_preferences_populater.h"
16 #include "android_webview/browser/jni_dependency_factory.h" 16 #include "android_webview/browser/jni_dependency_factory.h"
17 #include "android_webview/browser/net/aw_url_request_context_getter.h" 17 #include "android_webview/browser/net/aw_url_request_context_getter.h"
18 #include "android_webview/browser/net_disk_cache_remover.h" 18 #include "android_webview/browser/net_disk_cache_remover.h"
19 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h" 19 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h"
20 #include "android_webview/common/render_view_messages.h" 20 #include "android_webview/common/render_view_messages.h"
21 #include "android_webview/common/url_constants.h" 21 #include "android_webview/common/url_constants.h"
22 #include "base/android/locale_utils.h"
22 #include "base/base_paths_android.h" 23 #include "base/base_paths_android.h"
23 #include "base/path_service.h" 24 #include "base/path_service.h"
24 #include "components/cdm/browser/cdm_message_filter_android.h" 25 #include "components/cdm/browser/cdm_message_filter_android.h"
25 #include "content/public/browser/access_token_store.h" 26 #include "content/public/browser/access_token_store.h"
26 #include "content/public/browser/browser_message_filter.h" 27 #include "content/public/browser/browser_message_filter.h"
27 #include "content/public/browser/browser_thread.h" 28 #include "content/public/browser/browser_thread.h"
28 #include "content/public/browser/child_process_security_policy.h" 29 #include "content/public/browser/child_process_security_policy.h"
29 #include "content/public/browser/render_process_host.h" 30 #include "content/public/browser/render_process_host.h"
30 #include "content/public/browser/render_view_host.h" 31 #include "content/public/browser/render_view_host.h"
31 #include "content/public/browser/web_contents.h" 32 #include "content/public/browser/web_contents.h"
32 #include "content/public/common/url_constants.h" 33 #include "content/public/common/url_constants.h"
33 #include "content/public/common/web_preferences.h" 34 #include "content/public/common/web_preferences.h"
34 #include "net/android/network_library.h" 35 #include "net/android/network_library.h"
35 #include "net/ssl/ssl_cert_request_info.h" 36 #include "net/ssl/ssl_cert_request_info.h"
36 #include "net/ssl/ssl_info.h" 37 #include "net/ssl/ssl_info.h"
37 #include "ui/base/l10n/l10n_util_android.h"
38 #include "ui/base/resource/resource_bundle.h" 38 #include "ui/base/resource/resource_bundle.h"
39 #include "ui/resources/grit/ui_resources.h" 39 #include "ui/resources/grit/ui_resources.h"
40 40
41 using content::BrowserThread; 41 using content::BrowserThread;
42 using content::ResourceType; 42 using content::ResourceType;
43 43
44 namespace android_webview { 44 namespace android_webview {
45 namespace { 45 namespace {
46 46
47 // TODO(sgurun) move this to its own file. 47 // TODO(sgurun) move this to its own file.
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 AwBrowserPermissionRequestDelegate::FromID(render_process_id, 148 AwBrowserPermissionRequestDelegate::FromID(render_process_id,
149 render_view_id); 149 render_view_id);
150 if (delegate) 150 if (delegate)
151 delegate->CancelProtectedMediaIdentifierPermissionRequests(origin); 151 delegate->CancelProtectedMediaIdentifierPermissionRequests(origin);
152 } 152 }
153 153
154 } // namespace 154 } // namespace
155 155
156 std::string AwContentBrowserClient::GetAcceptLangsImpl() { 156 std::string AwContentBrowserClient::GetAcceptLangsImpl() {
157 // Start with the currnet locale. 157 // Start with the currnet locale.
158 std::string langs = l10n_util::GetDefaultLocale(); 158 std::string langs = base::android::GetDefaultLocale();
159 159
160 // If we're not en-US, add in en-US which will be 160 // If we're not en-US, add in en-US which will be
161 // used with a lower q-value. 161 // used with a lower q-value.
162 if (base::StringToLowerASCII(langs) != "en-us") { 162 if (base::StringToLowerASCII(langs) != "en-us") {
163 langs += ",en-US"; 163 langs += ",en-US";
164 } 164 }
165 return langs; 165 return langs;
166 } 166 }
167 167
168 AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() { 168 AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 return alias_name; 252 return alias_name;
253 } 253 }
254 254
255 void AwContentBrowserClient::AppendExtraCommandLineSwitches( 255 void AwContentBrowserClient::AppendExtraCommandLineSwitches(
256 base::CommandLine* command_line, 256 base::CommandLine* command_line,
257 int child_process_id) { 257 int child_process_id) {
258 NOTREACHED() << "Android WebView does not support multi-process yet"; 258 NOTREACHED() << "Android WebView does not support multi-process yet";
259 } 259 }
260 260
261 std::string AwContentBrowserClient::GetApplicationLocale() { 261 std::string AwContentBrowserClient::GetApplicationLocale() {
262 return l10n_util::GetDefaultLocale(); 262 return base::android::GetDefaultLocale();
263 } 263 }
264 264
265 std::string AwContentBrowserClient::GetAcceptLangs( 265 std::string AwContentBrowserClient::GetAcceptLangs(
266 content::BrowserContext* context) { 266 content::BrowserContext* context) {
267 return GetAcceptLangsImpl(); 267 return GetAcceptLangsImpl();
268 } 268 }
269 269
270 const gfx::ImageSkia* AwContentBrowserClient::GetDefaultFavicon() { 270 const gfx::ImageSkia* AwContentBrowserClient::GetDefaultFavicon() {
271 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 271 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
272 // TODO(boliu): Bundle our own default favicon? 272 // TODO(boliu): Bundle our own default favicon?
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); 575 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents);
576 } 576 }
577 #endif 577 #endif
578 578
579 content::DevToolsManagerDelegate* 579 content::DevToolsManagerDelegate*
580 AwContentBrowserClient::GetDevToolsManagerDelegate() { 580 AwContentBrowserClient::GetDevToolsManagerDelegate() {
581 return new AwDevToolsManagerDelegate(); 581 return new AwDevToolsManagerDelegate();
582 } 582 }
583 583
584 } // namespace android_webview 584 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_browser_main_parts.cc ('k') | android_webview/browser/aw_form_database_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698