Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / recovery / recovery_install_global_error_factory.cc
blob659e0c9a0d3ab214b4d6887fceb8f28b23a6b895
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
3 // found in the LICENSE file.
5 #include "chrome/browser/recovery/recovery_install_global_error_factory.h"
7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/recovery/recovery_install_global_error.h"
10 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
13 RecoveryInstallGlobalErrorFactory::RecoveryInstallGlobalErrorFactory()
14 : BrowserContextKeyedServiceFactory(
15 "RecoveryInstallGlobalError",
16 BrowserContextDependencyManager::GetInstance()) {
17 DependsOn(GlobalErrorServiceFactory::GetInstance());
20 RecoveryInstallGlobalErrorFactory::~RecoveryInstallGlobalErrorFactory() {}
22 // static
23 RecoveryInstallGlobalError*
24 RecoveryInstallGlobalErrorFactory::GetForProfile(Profile* profile) {
25 return static_cast<RecoveryInstallGlobalError*>(
26 GetInstance()->GetServiceForBrowserContext(profile, true));
29 // static
30 RecoveryInstallGlobalErrorFactory*
31 RecoveryInstallGlobalErrorFactory::GetInstance() {
32 return base::Singleton<RecoveryInstallGlobalErrorFactory>::get();
35 KeyedService* RecoveryInstallGlobalErrorFactory::BuildServiceInstanceFor(
36 content::BrowserContext* context) const {
37 #if defined(OS_WIN) || defined(OS_MACOSX)
38 return new RecoveryInstallGlobalError(static_cast<Profile*>(context));
39 #else
40 return NULL;
41 #endif