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

Unified Diff: chrome/browser/extensions/chrome_process_manager_delegate.cc

Issue 2306143002: Plumbing for login apps device policy to extensions. (Closed)
Patch Set: Mege Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_management.h » ('j') | chrome/common/chrome_switches.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4577cfc816935d2a892848be9428f9f1b94e66f4 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() {
@@ -45,8 +50,22 @@ bool ChromeProcessManagerDelegate::IsBackgroundPageAllowed(
bool is_normal_session = !profile->IsGuestSession() &&
!profile->IsSystemProfile();
#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();
+ const bool is_signin_profile =
+ chromeos::ProfileHelper::IsSigninProfile(profile);
+ const bool login_apps_enabled =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableLoginApps);
+ const bool login_apps_installed =
+ !ExtensionManagementFactory::GetForBrowserContext(profile)
emaxx 2016/11/04 13:54:51 nit: There's a variable "context" in this scope, s
Denis Kuznetsov (DE-MUC) 2016/11/08 18:47:49 Done.
+ ->GetForceInstallList()
+ ->empty();
+ is_normal_session =
emaxx 2016/11/04 13:54:51 I don't actually understand the logic here. Looks
Denis Kuznetsov (DE-MUC) 2016/11/08 18:47:48 If you follow the crbug link below, the whole purp
Denis Kuznetsov (DE-MUC) 2016/11/08 18:47:49 Done.
+ user_logged_in ||
+ (is_signin_profile && login_apps_enabled && login_apps_installed);
emaxx 2016/11/04 13:54:51 I'll repeat my comment from the original CL:
Denis Kuznetsov (DE-MUC) 2016/11/08 18:47:48 Done.
+ }
#endif
// Disallow if the current session is a Guest mode session or login screen but
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_management.h » ('j') | chrome/common/chrome_switches.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698