| 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> |
| 11 | 11 |
| 12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
| 13 #include "base/string16.h" |
| 13 #include "chrome/browser/extensions/extension_install_ui.h" | 14 #include "chrome/browser/extensions/extension_install_ui.h" |
| 14 #include "chrome/browser/extensions/webstore_installer.h" | 15 #include "chrome/browser/extensions/webstore_installer.h" |
| 15 #include "chrome/browser/extensions/webstore_install_helper.h" | 16 #include "chrome/browser/extensions/webstore_install_helper.h" |
| 16 #include "chrome/browser/ui/browser_list.h" | 17 #include "chrome/browser/ui/browser_list.h" |
| 17 #include "chrome/common/extensions/extension.h" | 18 #include "chrome/common/extensions/extension.h" |
| 18 | 19 |
| 19 namespace base { | 20 namespace base { |
| 20 class DictionaryValue; | 21 class DictionaryValue; |
| 21 } // namespace base | 22 } // namespace base |
| 22 | 23 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // If the bundle has been approved, this downloads and installs the member | 90 // If the bundle has been approved, this downloads and installs the member |
| 90 // extensions. OnBundleInstallComplete will be called when the process is | 91 // extensions. OnBundleInstallComplete will be called when the process is |
| 91 // complete and |delegate| is not NULL. The download process uses the | 92 // complete and |delegate| is not NULL. The download process uses the |
| 92 // specified |controller|. When complete, we show a confirmation bubble in | 93 // specified |controller|. When complete, we show a confirmation bubble in |
| 93 // the specified |browser|. | 94 // the specified |browser|. |
| 94 // Note: the |delegate| must stay alive until receiving the callback. | 95 // Note: the |delegate| must stay alive until receiving the callback. |
| 95 void CompleteInstall(content::NavigationController* controller, | 96 void CompleteInstall(content::NavigationController* controller, |
| 96 Browser* browser, | 97 Browser* browser, |
| 97 Delegate* delegate); | 98 Delegate* delegate); |
| 98 | 99 |
| 100 // We change the headings in the install prompt and installed bubble depending |
| 101 // on whether the bundle contains apps, extensions or both. This method gets |
| 102 // the correct heading for the items in the specified |state|, or an empty |
| 103 // string if no items are in the |state|. |
| 104 // STATE_PENDING - install prompt |
| 105 // STATE_INSTALLED - installed bubble successful installs list |
| 106 // STATE_FAILED - installed bubble failed installs list |
| 107 string16 GetHeadingTextFor(Item::State state) const; |
| 108 |
| 99 private: | 109 private: |
| 100 friend class base::RefCountedThreadSafe<BundleInstaller>; | 110 friend class base::RefCountedThreadSafe<BundleInstaller>; |
| 101 | 111 |
| 102 typedef std::map<std::string, Item> ItemMap; | 112 typedef std::map<std::string, Item> ItemMap; |
| 103 typedef std::map<std::string, linked_ptr<base::DictionaryValue> > ManifestMap; | 113 typedef std::map<std::string, linked_ptr<base::DictionaryValue> > ManifestMap; |
| 104 | 114 |
| 105 // Displays the install bubble for |bundle| on |browser|. | 115 // Displays the install bubble for |bundle| on |browser|. |
| 106 // Note: this is a platform specific implementation. | 116 // Note: this is a platform specific implementation. |
| 107 static void ShowInstalledBubble(const BundleInstaller* bundle, | 117 static void ShowInstalledBubble(const BundleInstaller* bundle, |
| 108 Browser* browser); | 118 Browser* browser); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 Profile* profile_; | 182 Profile* profile_; |
| 173 | 183 |
| 174 Delegate* delegate_; | 184 Delegate* delegate_; |
| 175 | 185 |
| 176 DISALLOW_COPY_AND_ASSIGN(BundleInstaller); | 186 DISALLOW_COPY_AND_ASSIGN(BundleInstaller); |
| 177 }; | 187 }; |
| 178 | 188 |
| 179 } // namespace extensions | 189 } // namespace extensions |
| 180 | 190 |
| 181 #endif // CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ | 191 #endif // CHROME_BROWSER_EXTENSIONS_BUNDLE_INSTALLER_H_ |
| OLD | NEW |