Index: chrome/browser/extensions/default_apps_provider.h |
=================================================================== |
--- chrome/browser/extensions/default_apps_provider.h (revision 0) |
+++ chrome/browser/extensions/default_apps_provider.h (revision 0) |
@@ -0,0 +1,72 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_PROVIDER_H_ |
+#define CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_PROVIDER_H_ |
+#pragma once |
+ |
+#include "chrome/browser/extensions/external_extension_provider_impl.h" |
+#include "content/public/browser/notification_observer.h" |
+#include "content/public/browser/notification_registrar.h" |
+ |
+class ExternalExtensionLoader; |
+class PrefService; |
+class Profile; |
+ |
+namespace base { |
+class DictionaryValue; |
+} |
+ |
+// A provider of apps that are installed by default into all new profiles. |
+class DefaultAppsProvider : public ExternalExtensionProviderImpl, |
+ public content::NotificationObserver { |
+ public: |
+ // These values are persisted in the user preferences so values should not |
+ // be changed. |
+ enum InstallState { |
+ kInstallNotStarted, |
+ kInstalling, |
+ kInstallDone |
+ }; |
+ |
+ DefaultAppsProvider(VisitorInterface* service, |
+ ExternalExtensionLoader* loader, |
+ Profile* profile); |
+ virtual ~DefaultAppsProvider(); |
+ |
+ // Register preference properties used by DefaultAppsProvider to maintain |
+ // install state. |
+ static void RegisterUserPrefs(PrefService* prefs); |
+ |
+ // Determines whether default apps should be installed into the specified |
+ // profile. If true, then an instance of DefaultAppsProvider should be |
+ // added to the external providers list. |
+ static bool ShouldRegister(Profile* profile); |
+ |
+ // ExternalExtensionProviderImpl overrides: |
+ virtual void SetPrefs(base::DictionaryValue* prefs) OVERRIDE; |
+ virtual void ServiceShutdown() OVERRIDE; |
+ virtual void VisitRegisteredExtension() const OVERRIDE; |
+ |
+ // Implementation of NotificationObserver: |
+ virtual void Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) OVERRIDE; |
+ |
+ // Used only for testing. |
+ const std::set<std::string>& install_error_extensions() const { |
+ return install_error_extensions_; |
+ } |
+ |
+ private: |
+ Profile* profile_; |
+ content::NotificationRegistrar registrar_; |
+ |
+ // Set of extensions that failed to install for some reason. |
+ std::set<std::string> install_error_extensions_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(DefaultAppsProvider); |
+}; |
+ |
+#endif // CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_PROVIDER_H_ |
Property changes on: chrome\browser\extensions\default_apps_provider.h |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |