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

Side by Side Diff: android_webview/native/aw_contents.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
« no previous file with comments | « android_webview/browser/aw_form_database_service.cc ('k') | base/BUILD.gn » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/native/aw_contents.h" 5 #include "android_webview/native/aw_contents.h"
6 6
7 #include <limits> 7 #include <limits>
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 15 matching lines...) Expand all
26 #include "android_webview/native/aw_web_contents_delegate.h" 26 #include "android_webview/native/aw_web_contents_delegate.h"
27 #include "android_webview/native/java_browser_view_renderer_helper.h" 27 #include "android_webview/native/java_browser_view_renderer_helper.h"
28 #include "android_webview/native/permission/aw_permission_request.h" 28 #include "android_webview/native/permission/aw_permission_request.h"
29 #include "android_webview/native/permission/permission_request_handler.h" 29 #include "android_webview/native/permission/permission_request_handler.h"
30 #include "android_webview/native/permission/simple_permission_request.h" 30 #include "android_webview/native/permission/simple_permission_request.h"
31 #include "android_webview/native/state_serializer.h" 31 #include "android_webview/native/state_serializer.h"
32 #include "android_webview/public/browser/draw_gl.h" 32 #include "android_webview/public/browser/draw_gl.h"
33 #include "base/android/jni_android.h" 33 #include "base/android/jni_android.h"
34 #include "base/android/jni_array.h" 34 #include "base/android/jni_array.h"
35 #include "base/android/jni_string.h" 35 #include "base/android/jni_string.h"
36 #include "base/android/locale_utils.h"
36 #include "base/android/scoped_java_ref.h" 37 #include "base/android/scoped_java_ref.h"
37 #include "base/atomicops.h" 38 #include "base/atomicops.h"
38 #include "base/bind.h" 39 #include "base/bind.h"
39 #include "base/callback.h" 40 #include "base/callback.h"
40 #include "base/memory/memory_pressure_listener.h" 41 #include "base/memory/memory_pressure_listener.h"
41 #include "base/message_loop/message_loop.h" 42 #include "base/message_loop/message_loop.h"
42 #include "base/pickle.h" 43 #include "base/pickle.h"
43 #include "base/strings/string16.h" 44 #include "base/strings/string16.h"
44 #include "base/supports_user_data.h" 45 #include "base/supports_user_data.h"
45 #include "components/autofill/content/browser/content_autofill_driver.h" 46 #include "components/autofill/content/browser/content_autofill_driver.h"
46 #include "components/autofill/core/browser/autofill_manager.h" 47 #include "components/autofill/core/browser/autofill_manager.h"
47 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" 48 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
48 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" 49 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h"
49 #include "components/navigation_interception/intercept_navigation_delegate.h" 50 #include "components/navigation_interception/intercept_navigation_delegate.h"
50 #include "content/public/browser/android/content_view_core.h" 51 #include "content/public/browser/android/content_view_core.h"
51 #include "content/public/browser/browser_thread.h" 52 #include "content/public/browser/browser_thread.h"
52 #include "content/public/browser/cert_store.h" 53 #include "content/public/browser/cert_store.h"
53 #include "content/public/browser/favicon_status.h" 54 #include "content/public/browser/favicon_status.h"
54 #include "content/public/browser/navigation_entry.h" 55 #include "content/public/browser/navigation_entry.h"
55 #include "content/public/browser/render_frame_host.h" 56 #include "content/public/browser/render_frame_host.h"
56 #include "content/public/browser/render_process_host.h" 57 #include "content/public/browser/render_process_host.h"
57 #include "content/public/browser/render_view_host.h" 58 #include "content/public/browser/render_view_host.h"
58 #include "content/public/browser/web_contents.h" 59 #include "content/public/browser/web_contents.h"
59 #include "content/public/common/renderer_preferences.h" 60 #include "content/public/common/renderer_preferences.h"
60 #include "content/public/common/ssl_status.h" 61 #include "content/public/common/ssl_status.h"
61 #include "jni/AwContents_jni.h" 62 #include "jni/AwContents_jni.h"
62 #include "net/base/auth.h" 63 #include "net/base/auth.h"
63 #include "net/cert/x509_certificate.h" 64 #include "net/cert/x509_certificate.h"
64 #include "third_party/skia/include/core/SkPicture.h" 65 #include "third_party/skia/include/core/SkPicture.h"
65 #include "ui/base/l10n/l10n_util_android.h"
66 #include "ui/gfx/android/java_bitmap.h" 66 #include "ui/gfx/android/java_bitmap.h"
67 #include "ui/gfx/image/image.h" 67 #include "ui/gfx/image/image.h"
68 #include "ui/gfx/size.h" 68 #include "ui/gfx/size.h"
69 69
70 struct AwDrawSWFunctionTable; 70 struct AwDrawSWFunctionTable;
71 struct AwDrawGLFunctionTable; 71 struct AwDrawGLFunctionTable;
72 72
73 using autofill::ContentAutofillDriver; 73 using autofill::ContentAutofillDriver;
74 using autofill::AutofillManager; 74 using autofill::AutofillManager;
75 using base::android::AttachCurrentThread; 75 using base::android::AttachCurrentThread;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 content::WebContents* web_contents = web_contents_.get(); 245 content::WebContents* web_contents = web_contents_.get();
246 if (ContentAutofillDriver::FromWebContents(web_contents)) 246 if (ContentAutofillDriver::FromWebContents(web_contents))
247 return; 247 return;
248 248
249 AwBrowserContext::FromWebContents(web_contents)-> 249 AwBrowserContext::FromWebContents(web_contents)->
250 CreateUserPrefServiceIfNecessary(); 250 CreateUserPrefServiceIfNecessary();
251 AwAutofillClient::CreateForWebContents(web_contents); 251 AwAutofillClient::CreateForWebContents(web_contents);
252 ContentAutofillDriver::CreateForWebContentsAndDelegate( 252 ContentAutofillDriver::CreateForWebContentsAndDelegate(
253 web_contents, 253 web_contents,
254 AwAutofillClient::FromWebContents(web_contents), 254 AwAutofillClient::FromWebContents(web_contents),
255 l10n_util::GetDefaultLocale(), 255 base::android::GetDefaultLocale(),
256 AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER); 256 AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER);
257 } 257 }
258 258
259 void AwContents::SetAwAutofillClient(jobject client) { 259 void AwContents::SetAwAutofillClient(jobject client) {
260 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 260 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
261 JNIEnv* env = AttachCurrentThread(); 261 JNIEnv* env = AttachCurrentThread();
262 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 262 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
263 if (obj.is_null()) 263 if (obj.is_null())
264 return; 264 return;
265 Java_AwContents_setAwAutofillClient(env, obj.obj(), client); 265 Java_AwContents_setAwAutofillClient(env, obj.obj(), client);
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 } 1168 }
1169 1169
1170 browser_view_renderer_.TrimMemory(level, visible); 1170 browser_view_renderer_.TrimMemory(level, visible);
1171 } 1171 }
1172 1172
1173 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { 1173 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) {
1174 g_should_download_favicons = true; 1174 g_should_download_favicons = true;
1175 } 1175 }
1176 1176
1177 } // namespace android_webview 1177 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_form_database_service.cc ('k') | base/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698