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

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

Issue 2306143002: Plumbing for login apps device policy to extensions. (Closed)
Patch Set: Fix Maxim's finding Created 4 years, 1 month 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
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 "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 #include "chrome/browser/notifications/notifier_state_tracker.h" 60 #include "chrome/browser/notifications/notifier_state_tracker.h"
61 #include "chrome/browser/notifications/notifier_state_tracker_factory.h" 61 #include "chrome/browser/notifications/notifier_state_tracker_factory.h"
62 #include "ui/message_center/notifier_settings.h" 62 #include "ui/message_center/notifier_settings.h"
63 #endif 63 #endif
64 64
65 #if defined(OS_CHROMEOS) 65 #if defined(OS_CHROMEOS)
66 #include "chrome/browser/app_mode/app_mode_utils.h" 66 #include "chrome/browser/app_mode/app_mode_utils.h"
67 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.h" 67 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.h"
68 #include "chrome/browser/chromeos/extensions/device_local_account_management_pol icy_provider.h" 68 #include "chrome/browser/chromeos/extensions/device_local_account_management_pol icy_provider.h"
69 #include "chrome/browser/chromeos/policy/device_local_account.h" 69 #include "chrome/browser/chromeos/policy/device_local_account.h"
70 #include "chrome/browser/chromeos/profiles/profile_helper.h"
70 #include "chromeos/chromeos_switches.h" 71 #include "chromeos/chromeos_switches.h"
71 #include "chromeos/login/login_state.h" 72 #include "chromeos/login/login_state.h"
72 #include "components/user_manager/user.h" 73 #include "components/user_manager/user.h"
73 #include "components/user_manager/user_manager.h" 74 #include "components/user_manager/user_manager.h"
74 #endif 75 #endif
75 76
76 using content::BrowserThread; 77 using content::BrowserThread;
77 78
78 namespace extensions { 79 namespace extensions {
79 80
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 service_worker_manager_.reset(new ServiceWorkerManager(profile_)); 184 service_worker_manager_.reset(new ServiceWorkerManager(profile_));
184 185
185 shared_user_script_master_.reset(new SharedUserScriptMaster(profile_)); 186 shared_user_script_master_.reset(new SharedUserScriptMaster(profile_));
186 187
187 // ExtensionService depends on RuntimeData. 188 // ExtensionService depends on RuntimeData.
188 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_))); 189 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_)));
189 190
190 bool autoupdate_enabled = !profile_->IsGuestSession() && 191 bool autoupdate_enabled = !profile_->IsGuestSession() &&
191 !profile_->IsSystemProfile(); 192 !profile_->IsSystemProfile();
192 #if defined(OS_CHROMEOS) 193 #if defined(OS_CHROMEOS)
194 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
195 switches::kEnableSigninApps) &&
196 chromeos::ProfileHelper::IsSigninProfile(profile_)) {
197 extensions_enabled = true;
198 }
193 if (!extensions_enabled) 199 if (!extensions_enabled)
194 autoupdate_enabled = false; 200 autoupdate_enabled = false;
195 #endif // defined(OS_CHROMEOS) 201 #endif // defined(OS_CHROMEOS)
196 extension_service_.reset(new ExtensionService( 202 extension_service_.reset(new ExtensionService(
197 profile_, base::CommandLine::ForCurrentProcess(), 203 profile_, base::CommandLine::ForCurrentProcess(),
198 profile_->GetPath().AppendASCII(extensions::kInstallDirectoryName), 204 profile_->GetPath().AppendASCII(extensions::kInstallDirectoryName),
199 ExtensionPrefs::Get(profile_), Blacklist::Get(profile_), 205 ExtensionPrefs::Get(profile_), Blacklist::Get(profile_),
200 autoupdate_enabled, extensions_enabled, &ready_)); 206 autoupdate_enabled, extensions_enabled, &ready_));
201 207
202 uninstall_ping_sender_.reset(new UninstallPingSender( 208 uninstall_ping_sender_.reset(new UninstallPingSender(
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( 455 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts(
450 const std::string& extension_id, 456 const std::string& extension_id,
451 const UnloadedExtensionInfo::Reason reason) { 457 const UnloadedExtensionInfo::Reason reason) {
452 BrowserThread::PostTask( 458 BrowserThread::PostTask(
453 BrowserThread::IO, 459 BrowserThread::IO,
454 FROM_HERE, 460 FROM_HERE,
455 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); 461 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason));
456 } 462 }
457 463
458 } // namespace extensions 464 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698