diff options
author | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-07 08:37:42 +0000 |
---|---|---|
committer | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-07 08:37:42 +0000 |
commit | 69496e5ed48a3e9ba29d3eca2c4061a9c8faabec (patch) | |
tree | 275f334ed77bda94d87551bda22f15b10a14a768 /apps/shortcut_manager_factory.h | |
parent | be0ed64414d297230cb8c5ea4052fc1736122e88 (diff) | |
download | chromium_src-69496e5ed48a3e9ba29d3eca2c4061a9c8faabec.zip chromium_src-69496e5ed48a3e9ba29d3eca2c4061a9c8faabec.tar.gz chromium_src-69496e5ed48a3e9ba29d3eca2c4061a9c8faabec.tar.bz2 |
Move apps_shortcut_manager into src/apps
BUG=159366
Review URL: https://chromiumcodereview.appspot.com/12378037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186648 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps/shortcut_manager_factory.h')
-rw-r--r-- | apps/shortcut_manager_factory.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/apps/shortcut_manager_factory.h b/apps/shortcut_manager_factory.h new file mode 100644 index 0000000..946fba2 --- /dev/null +++ b/apps/shortcut_manager_factory.h @@ -0,0 +1,42 @@ +// Copyright 2013 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 APPS_SHORTCUT_MANAGER_FACTORY_H_ +#define APPS_SHORTCUT_MANAGER_FACTORY_H_ + +#include "chrome/browser/profiles/profile_keyed_service_factory.h" + +template<typename Type> struct DefaultSingletonTraits; + +namespace apps { + +class ShortcutManager; + +// Singleton that owns all ShortcutManagers and associates them with +// Profiles. Listens for the Profile's destruction notification and cleans up +// the associated ShortcutManager. +// ShortcutManagers should not exist in incognito profiles. +class ShortcutManagerFactory : public ProfileKeyedServiceFactory { + public: + static ShortcutManager* GetForProfile(Profile* profile); + + static void ResetForProfile(Profile* profile); + + static ShortcutManagerFactory* GetInstance(); + + private: + friend struct DefaultSingletonTraits<ShortcutManagerFactory>; + + ShortcutManagerFactory(); + virtual ~ShortcutManagerFactory(); + + // ProfileKeyedServiceFactory: + virtual ProfileKeyedService* BuildServiceInstanceFor( + Profile* profile) const OVERRIDE; + virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; +}; + +} // namespace apps + +#endif // APPS_SHORTCUT_MANAGER_FACTORY_H_ |