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

Issue 1062963006: Make WebUI webview content script work with incognito. (Closed)

Created:
5 years, 8 months ago by Xi Han
Modified:
5 years, 8 months ago
Reviewers:
xiyuan, Devlin
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, Fady Samuel, xiyuan
Base URL:
https://chromium.googlesource.com/chromium/src.git@webui_api_4
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make WebUI webview content script work with incognito. In WebUIUserScriptLoader, if it is incognito mode, we need to get the OffTheRecordContext and pass it to URLfetchers to load user scripts. Currently, UserScriptLoader can only refer to regular profiles. To fix this, we pass in a flag to show whether it is incognito mode when adding scripts. We are able to choose the correct profile pointer by using this flag. BUG=461052 Committed: https://crrev.com/6233f60f246f03cd193bd9ecebbeb314813406d8 Cr-Commit-Position: refs/heads/master@{#327096}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Using RenderProcessHost to get BrowserContext. #

Patch Set 3 : Add a test. #

Total comments: 2

Patch Set 4 : Comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -5 lines) Patch
M chrome/browser/ui/webui/webui_webview_browsertest.cc View 1 2 3 2 chunks +18 lines, -0 lines 0 comments Download
M extensions/browser/web_ui_user_script_loader.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M extensions/browser/web_ui_user_script_loader.cc View 1 2 4 chunks +11 lines, -5 lines 0 comments Download

Messages

Total messages: 22 (7 generated)
Xi Han
Hi Devlin, can you review this patch parallel? Thanks a lot:)
5 years, 8 months ago (2015-04-23 17:49:44 UTC) #2
Devlin
https://codereview.chromium.org/1062963006/diff/1/extensions/browser/web_ui_user_script_loader.cc File extensions/browser/web_ui_user_script_loader.cc (right): https://codereview.chromium.org/1062963006/diff/1/extensions/browser/web_ui_user_script_loader.cc#newcode110 extensions/browser/web_ui_user_script_loader.cc:110: content::BrowserContext* browser_context = iter->second.is_incognito Can't we basically replace this ...
5 years, 8 months ago (2015-04-23 17:53:47 UTC) #3
Xi Han
On 2015/04/23 17:53:47, Devlin wrote: > https://codereview.chromium.org/1062963006/diff/1/extensions/browser/web_ui_user_script_loader.cc > File extensions/browser/web_ui_user_script_loader.cc (right): > > https://codereview.chromium.org/1062963006/diff/1/extensions/browser/web_ui_user_script_loader.cc#newcode110 > ...
5 years, 8 months ago (2015-04-23 18:02:46 UTC) #4
Xi Han
On 2015/04/23 17:53:47, Devlin wrote: > https://codereview.chromium.org/1062963006/diff/1/extensions/browser/web_ui_user_script_loader.cc > File extensions/browser/web_ui_user_script_loader.cc (right): > > https://codereview.chromium.org/1062963006/diff/1/extensions/browser/web_ui_user_script_loader.cc#newcode110 > ...
5 years, 8 months ago (2015-04-23 18:02:47 UTC) #5
Devlin
On 2015/04/23 18:02:47, Xi Han wrote: > On 2015/04/23 17:53:47, Devlin wrote: > > > ...
5 years, 8 months ago (2015-04-23 18:04:42 UTC) #6
Xi Han
Cool, that sounds a really easy fix. PTAL, thanks!
5 years, 8 months ago (2015-04-23 19:13:56 UTC) #7
Devlin
Would it be possible to add a test for this, to make sure it works ...
5 years, 8 months ago (2015-04-27 15:58:14 UTC) #8
Xi Han
Hi Devlin: a test is added, PTAL, thanks.
5 years, 8 months ago (2015-04-27 17:41:34 UTC) #11
Xi Han
+xiyuan@chromium.org: Please review changes in -chrome/browser/ui/webui/webui_webview_browsertest.cc Thanks.
5 years, 8 months ago (2015-04-27 17:42:47 UTC) #13
xiyuan
webui_webview_browsertest.cc LGTM
5 years, 8 months ago (2015-04-27 17:43:36 UTC) #14
Devlin
lgtm https://codereview.chromium.org/1062963006/diff/80001/chrome/browser/ui/webui/webui_webview_browsertest.cc File chrome/browser/ui/webui/webui_webview_browsertest.cc (right): https://codereview.chromium.org/1062963006/diff/80001/chrome/browser/ui/webui/webui_webview_browsertest.cc#newcode138 chrome/browser/ui/webui/webui_webview_browsertest.cc:138: IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, AddContentScriptIncognito) { Awesome. Can you: - Put ...
5 years, 8 months ago (2015-04-27 17:55:56 UTC) #15
Xi Han
https://codereview.chromium.org/1062963006/diff/80001/chrome/browser/ui/webui/webui_webview_browsertest.cc File chrome/browser/ui/webui/webui_webview_browsertest.cc (right): https://codereview.chromium.org/1062963006/diff/80001/chrome/browser/ui/webui/webui_webview_browsertest.cc#newcode138 chrome/browser/ui/webui/webui_webview_browsertest.cc:138: IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, AddContentScriptIncognito) { On 2015/04/27 17:55:56, Devlin wrote: > ...
5 years, 8 months ago (2015-04-27 18:17:48 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1062963006/120001
5 years, 8 months ago (2015-04-27 18:19:43 UTC) #20
commit-bot: I haz the power
Committed patchset #4 (id:120001)
5 years, 8 months ago (2015-04-27 19:09:13 UTC) #21
commit-bot: I haz the power
5 years, 8 months ago (2015-04-27 19:10:58 UTC) #22
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/6233f60f246f03cd193bd9ecebbeb314813406d8
Cr-Commit-Position: refs/heads/master@{#327096}

Powered by Google App Engine
This is Rietveld 408576698