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

Issue 1172093002: Implement HttpUserAgentSettings delegate for Android WebView (Closed)

Created:
5 years, 6 months ago by ctserng
Modified:
5 years, 4 months ago
Reviewers:
Yaron, Torne
CC:
android-webview-reviews_chromium.org, cbentzel+watch_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement HttpUserAgentSettings delegate for Android WebView Instead of using a static accept language and user agent, we set a HttpUserAgentSettings delegate to allow those values to change dynamically. BUG=35049 Committed: https://crrev.com/67e9830ff10d26bf8840598dde988e4af9581fde Cr-Commit-Position: refs/heads/master@{#341931}

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Strawman proposal for plumbing locale #

Patch Set 4 : Initialize and cache locale #

Patch Set 5 : New plumbing #

Total comments: 16

Patch Set 6 : Rebase #

Patch Set 7 : Fixing style and minor issues #

Patch Set 8 : Add locale check on attach #

Total comments: 2

Patch Set 9 : Cache locale on native side #

Patch Set 10 : Added accept lang test #

Patch Set 11 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+302 lines, -11 lines) Patch
M android_webview/android_webview.gyp View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -0 lines 0 comments Download
M android_webview/browser/aw_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +10 lines, -2 lines 0 comments Download
A android_webview/browser/aw_locale_manager.h View 1 2 3 4 5 6 1 chunk +28 lines, -0 lines 0 comments Download
M android_webview/browser/jni_dependency_factory.h View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
A android_webview/browser/net/aw_http_user_agent_settings.h View 1 2 3 4 5 6 1 chunk +41 lines, -0 lines 0 comments Download
A android_webview/browser/net/aw_http_user_agent_settings.cc View 1 2 3 4 5 6 1 chunk +39 lines, -0 lines 0 comments Download
M android_webview/browser/net/aw_url_request_context_getter.h View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M android_webview/browser/net/aw_url_request_context_getter.cc View 1 2 3 4 5 6 5 chunks +5 lines, -3 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwContents.java View 1 2 3 4 5 6 7 8 9 10 7 chunks +18 lines, -1 line 0 comments Download
A android_webview/javatests/src/org/chromium/android_webview/test/AcceptLanguageTest.java View 1 2 3 4 5 6 7 8 9 1 chunk +72 lines, -0 lines 0 comments Download
M android_webview/lib/main/aw_main_delegate.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/lib/main/aw_main_delegate.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -0 lines 0 comments Download
M android_webview/native/aw_contents.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M android_webview/native/aw_contents.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +12 lines, -0 lines 0 comments Download
A android_webview/native/aw_locale_manager_impl.h View 1 2 3 4 5 6 1 chunk +26 lines, -0 lines 0 comments Download
A android_webview/native/aw_locale_manager_impl.cc View 1 2 3 4 1 chunk +21 lines, -0 lines 0 comments Download
M android_webview/native/webview_native.gyp View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M base/android/java/src/org/chromium/base/LocaleUtils.java View 1 2 3 4 5 6 7 8 9 10 2 chunks +13 lines, -5 lines 0 comments Download

Messages

Total messages: 37 (8 generated)
ctserng
Hello, Here's a proposed patch for point #1 in: https://code.google.com/p/chromium/issues/detail?id=35049#c25 Thanks, Chris
5 years, 6 months ago (2015-06-09 19:00:27 UTC) #2
ctserng
+boliu for an extra set of eyes.
5 years, 6 months ago (2015-06-12 13:52:22 UTC) #4
Torne
Does this actually work in a real app when the locale change is initiated by ...
5 years, 6 months ago (2015-06-12 14:00:24 UTC) #5
ctserng
On 2015/06/12 at 14:00:24, torne wrote: > Does this actually work in a real app ...
5 years, 6 months ago (2015-06-12 14:41:16 UTC) #6
boliu
Yeah I share the concern for polling locale on every request. Those methods are const ...
5 years, 6 months ago (2015-06-12 15:31:57 UTC) #7
Torne
On 2015/06/12 14:41:16, ctserng wrote: > On 2015/06/12 at 14:00:24, torne wrote: > > Does ...
5 years, 6 months ago (2015-06-12 15:41:43 UTC) #9
ctserng
It's looking pretty involved to plumb locale configuration change to the right location to cache ...
5 years, 6 months ago (2015-06-18 18:30:24 UTC) #10
ctserng
So I put up a prototype along the lines of what I'm thinking. It seems ...
5 years, 6 months ago (2015-06-23 15:33:33 UTC) #11
Torne
On 2015/06/23 15:33:33, ctserng wrote: > So I put up a prototype along the lines ...
5 years, 5 months ago (2015-06-29 13:14:38 UTC) #12
ctserng
Ok, so I'm going to see if there is a different way to plumb this ...
5 years, 5 months ago (2015-07-02 16:48:49 UTC) #13
ctserng
Seems like simplest way is to create a static AwContents method that allows us to ...
5 years, 5 months ago (2015-07-02 17:50:29 UTC) #14
ctserng
Exposed AwContents static method for retrieving locale. However since android_webview/browser can't access native, tried plumbing ...
5 years, 5 months ago (2015-07-02 21:37:14 UTC) #15
ctserng
torne, You mind taking a look at what I have so far. Thanks!
5 years, 5 months ago (2015-07-13 14:29:44 UTC) #16
Torne
On 2015/07/13 14:29:44, ctserng wrote: > torne, > > You mind taking a look at ...
5 years, 5 months ago (2015-07-15 14:56:00 UTC) #17
Torne
Seems generally reasonable, I have some style nits and also one issue: https://codereview.chromium.org/1172093002/diff/80001/android_webview/browser/aw_content_browser_client.cc File android_webview/browser/aw_content_browser_client.cc ...
5 years, 5 months ago (2015-07-17 13:33:19 UTC) #18
ctserng
https://codereview.chromium.org/1172093002/diff/80001/android_webview/browser/aw_content_browser_client.cc File android_webview/browser/aw_content_browser_client.cc (right): https://codereview.chromium.org/1172093002/diff/80001/android_webview/browser/aw_content_browser_client.cc#newcode142 android_webview/browser/aw_content_browser_client.cc:142: AwLocaleManager* g_locale_manager = NULL; On 2015/07/17 at 13:33:18, Torne ...
5 years, 5 months ago (2015-07-17 16:51:15 UTC) #19
Torne
Not sure if you were ready for review on this or not (rietveld doesn't email ...
5 years, 5 months ago (2015-07-24 10:55:39 UTC) #20
ctserng
On 2015/07/24 at 10:55:39, torne wrote: > Not sure if you were ready for review ...
5 years, 5 months ago (2015-07-24 18:16:49 UTC) #21
ctserng
https://codereview.chromium.org/1172093002/diff/140001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/1172093002/diff/140001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode619 android_webview/java/src/org/chromium/android_webview/AwContents.java:619: if (!sCurrentLocale.equals(newLocale)) { On 2015/07/24 at 10:55:39, Torne wrote: ...
5 years, 5 months ago (2015-07-24 18:17:22 UTC) #22
Torne
Yeah, I can't think of an easy way to write a test for the full ...
5 years, 4 months ago (2015-07-28 13:04:07 UTC) #23
ctserng
On 2015/07/28 at 13:04:07, torne wrote: > Yeah, I can't think of an easy way ...
5 years, 4 months ago (2015-08-04 17:55:21 UTC) #24
Torne
Thanks; LGTM.
5 years, 4 months ago (2015-08-05 12:15:48 UTC) #25
ctserng
+ yfriedman as owner for LocaleUtils.java changes
5 years, 4 months ago (2015-08-05 13:40:13 UTC) #27
Yaron
lgtm
5 years, 4 months ago (2015-08-05 13:46:21 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1172093002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1172093002/200001
5 years, 4 months ago (2015-08-05 16:29:12 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/52232)
5 years, 4 months ago (2015-08-05 17:04:18 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1172093002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1172093002/200001
5 years, 4 months ago (2015-08-05 17:51:39 UTC) #35
commit-bot: I haz the power
Committed patchset #11 (id:200001)
5 years, 4 months ago (2015-08-05 19:01:51 UTC) #36
commit-bot: I haz the power
5 years, 4 months ago (2015-08-05 19:02:31 UTC) #37
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/67e9830ff10d26bf8840598dde988e4af9581fde
Cr-Commit-Position: refs/heads/master@{#341931}

Powered by Google App Engine
This is Rietveld 408576698