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

Side by Side Diff: chrome/browser/extensions/extension_system_impl.cc

Issue 2807683003: Prevent loading of session extensions into the sign-in profile (Closed)
Patch Set: Fix the condition Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_system_impl.h" 5 #include "chrome/browser/extensions/extension_system_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "apps/app_restore_service.h" 9 #include "apps/app_restore_service.h"
10 #include "apps/app_restore_service_factory.h" 10 #include "apps/app_restore_service_factory.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 management_policy_.reset(new ManagementPolicy); 237 management_policy_.reset(new ManagementPolicy);
238 RegisterManagementPolicyProviders(); 238 RegisterManagementPolicyProviders();
239 } 239 }
240 240
241 // Extension API calls require QuotaService, so create it before loading any 241 // Extension API calls require QuotaService, so create it before loading any
242 // extensions. 242 // extensions.
243 quota_service_.reset(new QuotaService); 243 quota_service_.reset(new QuotaService);
244 244
245 bool skip_session_extensions = false; 245 bool skip_session_extensions = false;
246 #if defined(OS_CHROMEOS) 246 #if defined(OS_CHROMEOS)
247 // Skip loading session extensions if we are not in a user session. 247 // Skip loading session extensions if we are not in a user session or if the
248 skip_session_extensions = !chromeos::LoginState::Get()->IsUserLoggedIn(); 248 // profile is the sign-in profile, which doesn't correspond to a user session.
249 skip_session_extensions = !chromeos::LoginState::Get()->IsUserLoggedIn() ||
250 chromeos::ProfileHelper::IsSigninProfile(profile_);
Devlin 2017/04/10 15:40:54 It's surprising to me that the user can be logged
emaxx 2017/04/11 12:12:36 I think the sign-in profile (and the initial profi
249 if (chrome::IsRunningInForcedAppMode()) { 251 if (chrome::IsRunningInForcedAppMode()) {
250 extension_service_->component_loader()-> 252 extension_service_->component_loader()->
251 AddDefaultComponentExtensionsForKioskMode(skip_session_extensions); 253 AddDefaultComponentExtensionsForKioskMode(skip_session_extensions);
252 } else { 254 } else {
253 extension_service_->component_loader()->AddDefaultComponentExtensions( 255 extension_service_->component_loader()->AddDefaultComponentExtensions(
254 skip_session_extensions); 256 skip_session_extensions);
255 } 257 }
256 #else 258 #else
257 extension_service_->component_loader()->AddDefaultComponentExtensions( 259 extension_service_->component_loader()->AddDefaultComponentExtensions(
258 skip_session_extensions); 260 skip_session_extensions);
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( 465 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts(
464 const std::string& extension_id, 466 const std::string& extension_id,
465 const UnloadedExtensionInfo::Reason reason) { 467 const UnloadedExtensionInfo::Reason reason) {
466 BrowserThread::PostTask( 468 BrowserThread::PostTask(
467 BrowserThread::IO, 469 BrowserThread::IO,
468 FROM_HERE, 470 FROM_HERE,
469 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); 471 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason));
470 } 472 }
471 473
472 } // namespace extensions 474 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698