Chromium Code Reviews| Index: chrome/browser/extensions/extension_install_ui.h |
| diff --git a/chrome/browser/extensions/extension_install_ui.h b/chrome/browser/extensions/extension_install_ui.h |
| index a2a48810dd15df870995d359c42c22be6c33e93e..64bb8b54736f4f86e888e6ba90e99117f72eb1fa 100644 |
| --- a/chrome/browser/extensions/extension_install_ui.h |
| +++ b/chrome/browser/extensions/extension_install_ui.h |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2012 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. |
| @@ -24,6 +24,10 @@ class Profile; |
| class InfoBarDelegate; |
| class TabContentsWrapper; |
| +namespace extensions { |
| +class BundleInstaller; |
| +} // namespace extensions |
| + |
| // Displays all the UI around extension installation. |
| class ExtensionInstallUI : public ImageLoadingTracker::Observer { |
| public: |
| @@ -31,6 +35,7 @@ class ExtensionInstallUI : public ImageLoadingTracker::Observer { |
| UNSET_PROMPT_TYPE = -1, |
| INSTALL_PROMPT = 0, |
| INLINE_INSTALL_PROMPT, |
| + BUNDLE_INSTALL_PROMPT, |
| RE_ENABLE_PROMPT, |
| PERMISSIONS_PROMPT, |
| NUM_PROMPT_TYPES |
| @@ -53,12 +58,16 @@ class ExtensionInstallUI : public ImageLoadingTracker::Observer { |
| PromptType type() const { return type_; } |
| // Getters for UI element labels. |
| - string16 GetDialogTitle(const Extension* extension) const; |
| - string16 GetHeading(const std::string& extension_name) const; |
| + string16 GetDialogTitle() const; |
| + string16 GetHeading() const; |
| string16 GetAcceptButtonLabel() const; |
| bool HasAbortButtonLabel() const; |
| string16 GetAbortButtonLabel() const; |
| - string16 GetPermissionsHeader() const; |
| + string16 GetPermissionsHeading() const; |
| + |
| + // Not populated for BUNDLE_INSTALL_PROMPT. |
| + const SkBitmap& icon() const { return icon_; } |
|
Robert Sesek
2012/02/23 20:12:32
If this class is used exclusively for displaying U
jstritar
2012/02/24 18:21:46
Done.
|
| + void set_icon(SkBitmap icon) { icon_ = icon; } |
| // Getters for webstore metadata. Only populated when the type is |
| // INLINE_INSTALL_PROMPT. |
| @@ -72,7 +81,17 @@ class ExtensionInstallUI : public ImageLoadingTracker::Observer { |
| string16 GetRatingCount() const; |
| string16 GetUserCount() const; |
| size_t GetPermissionCount() const; |
| - string16 GetPermission(int index) const; |
| + string16 GetPermission(size_t index) const; |
| + |
| + // Populated for BUNDLE_INSTALL_PROMPT. |
| + const extensions::BundleInstaller* bundle() const { return bundle_; } |
| + void set_bundle(const extensions::BundleInstaller* bundle) { |
| + bundle_ = bundle; |
| + } |
| + |
| + // Populated for all other types. |
| + const Extension* extension() const { return extension_; } |
| + void set_extension(const Extension* extension) { extension_ = extension; } |
| private: |
| PromptType type_; |
| @@ -80,6 +99,13 @@ class ExtensionInstallUI : public ImageLoadingTracker::Observer { |
| // permissions if only additional ones are being requested) |
| std::vector<string16> permissions_; |
| + // The extension or bundle being installed. |
| + const Extension* extension_; |
| + const extensions::BundleInstaller* bundle_; |
| + |
| + // The icon to be displayed. |
| + SkBitmap icon_; |
| + |
| // These fields are populated only when the prompt type is |
| // INLINE_INSTALL_PROMPT |
| // Already formatted to be locale-specific. |
| @@ -117,8 +143,8 @@ class ExtensionInstallUI : public ImageLoadingTracker::Observer { |
| } |
| // Whether or not to show the default UI after completing the installation. |
| - void set_skip_post_install_ui(bool is_bundle) { |
| - skip_post_install_ui_ = is_bundle; |
| + void set_skip_post_install_ui(bool skip_ui) { |
| + skip_post_install_ui_ = skip_ui; |
| } |
| // This is called by the installer to verify whether the installation should |