summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authoryukishiino@chromium.org <yukishiino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-03 17:02:47 +0000
committeryukishiino@chromium.org <yukishiino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-03 17:02:47 +0000
commitd012be2ba345e689347d409432729472de325cd3 (patch)
tree5adfbb8da90226246081c5320ddc222e8b1ca050 /extensions
parentc80b3502ba5dda8c0fa8f712f585aa1aad45f385 (diff)
downloadchromium_src-d012be2ba345e689347d409432729472de325cd3.zip
chromium_src-d012be2ba345e689347d409432729472de325cd3.tar.gz
chromium_src-d012be2ba345e689347d409432729472de325cd3.tar.bz2
Makes text input extensions available in guest session on CrOS.
The behavioral changes are: 1) Creates background pages of extensions in guest session even if the extension is not "split" mode. Since the guest session has only the off-the-record context and does not have a regular context, we should treat the off-the-record context like the default regular context. Even if the extension is "spanning" mode, creates a background page for the off-the-record context in guest session. Otherwise, extensions in guest session cannot have a background page. 2) Passs key events, etc. to the off-the-record context regardless of whether extensions are enabled in incognito mode or not. The reason is the same. We should treat the off-the-record context as the default regular context in guest session. BUG=339318 TEST=Done manually. 1) Log in as guest, 2) Add Japanese language and enable Google Japanese Input, 3) Activate one of Japanese input method, 4) Type something. Review URL: https://codereview.chromium.org/177533002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254481 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions')
-rw-r--r--extensions/browser/extensions_browser_client.h2
-rw-r--r--extensions/browser/process_manager.cc14
2 files changed, 13 insertions, 3 deletions
diff --git a/extensions/browser/extensions_browser_client.h b/extensions/browser/extensions_browser_client.h
index 08ffa58..51cff43 100644
--- a/extensions/browser/extensions_browser_client.h
+++ b/extensions/browser/extensions_browser_client.h
@@ -70,7 +70,7 @@ class ExtensionsBrowserClient {
content::BrowserContext* context) = 0;
// Returns true if |context| corresponds to a guest session.
- virtual bool IsGuestSession(content::BrowserContext* context) = 0;
+ virtual bool IsGuestSession(content::BrowserContext* context) const = 0;
// Returns true if |extension_id| can run in an incognito window.
virtual bool IsExtensionIncognitoEnabled(
diff --git a/extensions/browser/process_manager.cc b/extensions/browser/process_manager.cc
index c2db585..721bc14 100644
--- a/extensions/browser/process_manager.cc
+++ b/extensions/browser/process_manager.cc
@@ -177,11 +177,21 @@ struct ProcessManager::BackgroundPageData {
// static
ProcessManager* ProcessManager::Create(BrowserContext* context) {
+ ExtensionsBrowserClient* client = ExtensionsBrowserClient::Get();
+ if (client->IsGuestSession(context)) {
+ // In the guest session, there is a single off-the-record context. Unlike
+ // a regular incognito mode, background pages of extensions must be
+ // created regardless of whether extensions use "spanning" or "split"
+ // incognito behavior.
+ BrowserContext* original_context = client->GetOriginalContext(context);
+ return new ProcessManager(context, original_context);
+ }
+
if (context->IsOffTheRecord()) {
- BrowserContext* original_context =
- ExtensionsBrowserClient::Get()->GetOriginalContext(context);
+ BrowserContext* original_context = client->GetOriginalContext(context);
return new IncognitoProcessManager(context, original_context);
}
+
return new ProcessManager(context, context);
}