| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BUNDLE_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 std::string id; | 71 std::string id; |
| 72 std::string manifest; | 72 std::string manifest; |
| 73 std::string localized_name; | 73 std::string localized_name; |
| 74 State state; | 74 State state; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 typedef std::vector<Item> ItemList; | 77 typedef std::vector<Item> ItemList; |
| 78 | 78 |
| 79 BundleInstaller(Profile* profile, const ItemList& items); | 79 BundleInstaller(Profile* profile, const ItemList& items); |
| 80 virtual ~BundleInstaller(); | |
| 81 | 80 |
| 82 // Returns true if the user has approved the bundle's permissions. | 81 // Returns true if the user has approved the bundle's permissions. |
| 83 bool approved() const { return approved_; } | 82 bool approved() const { return approved_; } |
| 84 | 83 |
| 85 // Gets the items in the given state. | 84 // Gets the items in the given state. |
| 86 ItemList GetItemsWithState(Item::State state) const; | 85 ItemList GetItemsWithState(Item::State state) const; |
| 87 | 86 |
| 88 // Parses the extension manifests and then prompts the user to approve their | 87 // Parses the extension manifests and then prompts the user to approve their |
| 89 // permissions. One of OnBundleInstallApproved or OnBundleInstallCanceled | 88 // permissions. One of OnBundleInstallApproved or OnBundleInstallCanceled |
| 90 // will be called when complete if |delegate| is not NULL. | 89 // will be called when complete if |delegate| is not NULL. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 109 // STATE_INSTALLED - installed bubble successful installs list | 108 // STATE_INSTALLED - installed bubble successful installs list |
| 110 // STATE_FAILED - installed bubble failed installs list | 109 // STATE_FAILED - installed bubble failed installs list |
| 111 string16 GetHeadingTextFor(Item::State state) const; | 110 string16 GetHeadingTextFor(Item::State state) const; |
| 112 | 111 |
| 113 private: | 112 private: |
| 114 friend class base::RefCountedThreadSafe<BundleInstaller>; | 113 friend class base::RefCountedThreadSafe<BundleInstaller>; |
| 115 | 114 |
| 116 typedef std::map<std::string, Item> ItemMap; | 115 typedef std::map<std::string, Item> ItemMap; |
| 117 typedef std::map<std::string, linked_ptr<base::DictionaryValue> > ManifestMap; | 116 typedef std::map<std::string, linked_ptr<base::DictionaryValue> > ManifestMap; |
| 118 | 117 |
| 118 virtual ~BundleInstaller(); |
| 119 |
| 119 // Displays the install bubble for |bundle| on |browser|. | 120 // Displays the install bubble for |bundle| on |browser|. |
| 120 // Note: this is a platform specific implementation. | 121 // Note: this is a platform specific implementation. |
| 121 static void ShowInstalledBubble(const BundleInstaller* bundle, | 122 static void ShowInstalledBubble(const BundleInstaller* bundle, |
| 122 Browser* browser); | 123 Browser* browser); |
| 123 | 124 |
| 124 // Parses the manifests using WebstoreInstallHelper. | 125 // Parses the manifests using WebstoreInstallHelper. |
| 125 void ParseManifests(); | 126 void ParseManifests(); |
| 126 | 127 |
| 127 // Notifies the delegate that the installation has been approved. | 128 // Notifies the delegate that the installation has been approved. |
| 128 void ReportApproved(); | 129 void ReportApproved(); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 scoped_ptr<ExtensionInstallUI> install_ui_; | 190 scoped_ptr<ExtensionInstallUI> install_ui_; |
| 190 | 191 |
| 191 Delegate* delegate_; | 192 Delegate* delegate_; |
| 192 | 193 |
| 193 DISALLOW_COPY_AND_ASSIGN(BundleInstaller); | 194 DISALLOW_COPY_AND_ASSIGN(BundleInstaller); |
| 194 }; | 195 }; |
| 195 | 196 |
| 196 } // namespace extensions | 197 } // namespace extensions |
| 197 | 198 |
| 198 #endif // CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ | 199 #endif // CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ |
| OLD | NEW |