| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // no apps need to be installed. | 43 // no apps need to be installed. |
| 44 const ExtensionIdSet* GetAppsToInstall() const; | 44 const ExtensionIdSet* GetAppsToInstall() const; |
| 45 | 45 |
| 46 // Gets the list of default apps. | 46 // Gets the list of default apps. |
| 47 const ExtensionIdSet* GetDefaultApps() const; | 47 const ExtensionIdSet* GetDefaultApps() const; |
| 48 | 48 |
| 49 // Should be called after each app is installed. Once installed_ids contains | 49 // Should be called after each app is installed. Once installed_ids contains |
| 50 // all the default apps, GetAppsToInstall() will start returning NULL. | 50 // all the default apps, GetAppsToInstall() will start returning NULL. |
| 51 void DidInstallApp(const ExtensionIdSet& installed_ids); | 51 void DidInstallApp(const ExtensionIdSet& installed_ids); |
| 52 | 52 |
| 53 // Returns true if the apps promo should be displayed in the launcher. This | 53 // Returns true if the apps promo should be displayed in the launcher. |
| 54 // starts returning true once the default apps have all been installed and | 54 // |
| 55 // stops after the promo expires. | 55 // NOTE: If the default apps have been installed, but |installed_ids| is |
| 56 bool ShouldShowPromo(const ExtensionIdSet& installed_ids); | 56 // different than GetDefaultApps(), this will permanently expire the promo. |
| 57 bool CheckShouldShowPromo(const ExtensionIdSet& installed_ids); |
| 57 | 58 |
| 58 // Should be called after each time the promo is installed. | 59 // Should be called after each time the promo is installed. |
| 59 void DidShowPromo(); | 60 void DidShowPromo(); |
| 60 | 61 |
| 61 // Force the promo to be hidden. | 62 // Force the promo to be hidden. |
| 62 void SetPromoHidden(); | 63 void SetPromoHidden(); |
| 63 | 64 |
| 64 private: | 65 private: |
| 65 FRIEND_TEST_ALL_PREFIXES(DefaultApps, Basics); | 66 FRIEND_TEST_ALL_PREFIXES(ExtensionDefaultApps, Basics); |
| 66 FRIEND_TEST_ALL_PREFIXES(DefaultApps, HidePromo); | 67 FRIEND_TEST_ALL_PREFIXES(ExtensionDefaultApps, HidePromo); |
| 67 FRIEND_TEST_ALL_PREFIXES(DefaultApps, InstallingAnAppHidesPromo); | 68 FRIEND_TEST_ALL_PREFIXES(ExtensionDefaultApps, InstallingAnAppHidesPromo); |
| 68 FRIEND_TEST_ALL_PREFIXES(DefaultApps, | 69 FRIEND_TEST_ALL_PREFIXES(ExtensionDefaultApps, |
| 69 ManualAppInstalledWhileInstallingDefaultApps); | 70 ManualAppInstalledWhileInstallingDefaultApps); |
| 70 | 71 |
| 71 bool GetDefaultAppsInstalled() const; | 72 bool GetDefaultAppsInstalled() const; |
| 72 void SetDefaultAppsInstalled(bool val); | 73 void SetDefaultAppsInstalled(bool val); |
| 73 | 74 |
| 74 int GetPromoCounter() const; | 75 int GetPromoCounter() const; |
| 75 void SetPromoCounter(int val); | 76 void SetPromoCounter(int val); |
| 76 | 77 |
| 77 // Our permanent state is stored in this PrefService instance. | 78 // Our permanent state is stored in this PrefService instance. |
| 78 PrefService* prefs_; | 79 PrefService* prefs_; |
| 79 | 80 |
| 80 // The set of default extensions. Initialized to a static list in the | 81 // The set of default extensions. Initialized to a static list in the |
| 81 // constructor. | 82 // constructor. |
| 82 ExtensionIdSet ids_; | 83 ExtensionIdSet ids_; |
| 83 | 84 |
| 84 DISALLOW_COPY_AND_ASSIGN(DefaultApps); | 85 DISALLOW_COPY_AND_ASSIGN(DefaultApps); |
| 85 }; | 86 }; |
| 86 | 87 |
| 87 #endif // CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ | 88 #endif // CHROME_BROWSER_EXTENSIONS_DEFAULT_APPS_H_ |
| OLD | NEW |