From 9bec08811b1da383460e87ac80b3ecc46ef8ce19 Mon Sep 17 00:00:00 2001 From: "dpolukhin@chromium.org" Date: Tue, 5 Nov 2013 06:48:01 +0000 Subject: [PATCH] chrome.windows.create should return new window id in Guest mode Some context: Chrome OS Guest mode is incognito mode and user extensions are disabled but we have couple component extensions that work in Guest mode. QuickOffice is one of them. It uses incognito split mode and runs in incognito profile. CanCrossIncognito returns false if extension runs in not split mode. Therefore include_incognito is false. But in general there is no problem if chrome.windows.create return incognito window if extension itself already works in incognito mode. BUG=313789 TEST=manual Review URL: https://codereview.chromium.org/49463006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232931 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/api/tabs/tabs_api.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc index c4ba43b14704..671330f00b25 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc @@ -625,8 +625,10 @@ bool WindowsCreateFunction::RunImpl() { else new_window->window()->ShowInactive(); - if (new_window->profile()->IsOffTheRecord() && !include_incognito()) { - // Don't expose incognito windows if the extension isn't allowed. + if (new_window->profile()->IsOffTheRecord() && + !GetProfile()->IsOffTheRecord() && !include_incognito()) { + // Don't expose incognito windows if extension itself works in non-incognito + // profile and CanCrossIncognito isn't allowed. SetResult(Value::CreateNullValue()); } else { SetResult( -- 2.11.4.GIT