Chromium Code Reviews| Index: chrome/browser/extensions/chrome_process_manager_delegate.cc |
| diff --git a/chrome/browser/extensions/chrome_process_manager_delegate.cc b/chrome/browser/extensions/chrome_process_manager_delegate.cc |
| index e5804aab7c89b436ade61cc18225ba081b7f3229..174d4d930299eeb15d7db6f1e3b1b230ab353210 100644 |
| --- a/chrome/browser/extensions/chrome_process_manager_delegate.cc |
| +++ b/chrome/browser/extensions/chrome_process_manager_delegate.cc |
| @@ -9,6 +9,7 @@ |
| #include "build/build_config.h" |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/chrome_notification_types.h" |
| +#include "chrome/browser/extensions/extension_management.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/profiles/profile_manager.h" |
| #include "chrome/browser/ui/browser.h" |
| @@ -21,6 +22,10 @@ |
| #include "extensions/browser/process_manager_factory.h" |
| #include "extensions/common/one_shot_event.h" |
| +#if defined(OS_CHROMEOS) |
| +#include "chrome/browser/chromeos/profiles/profile_helper.h" |
| +#endif |
| + |
| namespace extensions { |
| ChromeProcessManagerDelegate::ChromeProcessManagerDelegate() { |
| @@ -44,16 +49,35 @@ bool ChromeProcessManagerDelegate::IsBackgroundPageAllowed( |
| bool is_normal_session = !profile->IsGuestSession() && |
| !profile->IsSystemProfile(); |
| + bool allow_for_signin_profile = false; |
| + |
| #if defined(OS_CHROMEOS) |
| - is_normal_session = is_normal_session && |
| - user_manager::UserManager::Get()->IsUserLoggedIn(); |
| + if (is_normal_session) { |
| + const bool user_logged_in = |
| + user_manager::UserManager::Get()->IsUserLoggedIn(); |
| + is_normal_session = user_logged_in; |
| + |
| + const bool is_signin_profile = |
| + chromeos::ProfileHelper::IsSigninProfile(profile); |
| + const bool signin_apps_enabled = |
| + base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kEnableSigninApps); |
| + const bool signin_apps_installed = |
| + !ExtensionManagementFactory::GetForBrowserContext(context) |
| + ->GetForceInstallList() |
| + ->empty(); |
| + |
| + allow_for_signin_profile = |
| + is_signin_profile && signin_apps_enabled && signin_apps_installed; |
| + } |
| #endif |
| // Disallow if the current session is a Guest mode session or login screen but |
| // the current browser context is *not* off-the-record. Such context is |
| // artificial and background page shouldn't be created in it. |
| // http://crbug.com/329498 |
| - return is_normal_session || profile->IsOffTheRecord(); |
| + return is_normal_session || profile->IsOffTheRecord() || |
| + allow_for_signin_profile; |
|
emaxx
2016/11/10 15:03:44
I think there's still something wrong with this ex
|
| } |
| bool ChromeProcessManagerDelegate::DeferCreatingStartupBackgroundHosts( |