Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1446)

Unified Diff: chrome/browser/extensions/extension_install_prompt.cc

Issue 145153002: Make sideloaded (externally installed) extensions display webstore info (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ChromeOS fix Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_install_prompt.cc
diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc
index 6e94baa0e37dd266d1c29a016048ad7d77914932..f4d9ff682a5b08cc9c42621f506276d359f0ca4f 100644
--- a/chrome/browser/extensions/extension_install_prompt.cc
+++ b/chrome/browser/extensions/extension_install_prompt.cc
@@ -198,7 +198,8 @@ ExtensionInstallPrompt::Prompt::Prompt(PromptType type)
bundle_(NULL),
average_rating_(0.0),
rating_count_(0),
- show_user_count_(false) {
+ show_user_count_(false),
+ has_webstore_data_(false) {
}
ExtensionInstallPrompt::Prompt::~Prompt() {
@@ -253,16 +254,17 @@ void ExtensionInstallPrompt::Prompt::SetUserNameFromProfile(Profile* profile) {
}
}
-void ExtensionInstallPrompt::Prompt::SetInlineInstallWebstoreData(
+void ExtensionInstallPrompt::Prompt::SetWebstoreData(
const std::string& localized_user_count,
bool show_user_count,
double average_rating,
int rating_count) {
- CHECK_EQ(INLINE_INSTALL_PROMPT, type_);
+ CHECK(type_ == INLINE_INSTALL_PROMPT || type_ == EXTERNAL_INSTALL_PROMPT);
localized_user_count_ = localized_user_count;
show_user_count_ = show_user_count;
average_rating_ = average_rating;
rating_count_ = rating_count;
+ has_webstore_data_ = true;
}
base::string16 ExtensionInstallPrompt::Prompt::GetDialogTitle() const {
@@ -387,7 +389,7 @@ bool ExtensionInstallPrompt::Prompt::ShouldShowPermissions() const {
void ExtensionInstallPrompt::Prompt::AppendRatingStars(
StarAppender appender, void* data) const {
CHECK(appender);
- CHECK_EQ(INLINE_INSTALL_PROMPT, type_);
+ CHECK(type_ == INLINE_INSTALL_PROMPT || type_ == EXTERNAL_INSTALL_PROMPT);
int rating_integer = floor(average_rating_);
double rating_fractional = average_rating_ - rating_integer;
@@ -414,13 +416,13 @@ void ExtensionInstallPrompt::Prompt::AppendRatingStars(
}
base::string16 ExtensionInstallPrompt::Prompt::GetRatingCount() const {
- CHECK_EQ(INLINE_INSTALL_PROMPT, type_);
+ CHECK(type_ == INLINE_INSTALL_PROMPT || type_ == EXTERNAL_INSTALL_PROMPT);
return l10n_util::GetStringFUTF16(IDS_EXTENSION_RATING_COUNT,
base::IntToString16(rating_count_));
}
base::string16 ExtensionInstallPrompt::Prompt::GetUserCount() const {
- CHECK_EQ(INLINE_INSTALL_PROMPT, type_);
+ CHECK(type_ == INLINE_INSTALL_PROMPT || type_ == EXTERNAL_INSTALL_PROMPT);
if (show_user_count_) {
return l10n_util::GetStringFUTF16(IDS_EXTENSION_USER_COUNT,
@@ -647,12 +649,13 @@ void ExtensionInstallPrompt::ConfirmReEnable(Delegate* delegate,
void ExtensionInstallPrompt::ConfirmExternalInstall(
Delegate* delegate,
const Extension* extension,
- const ShowDialogCallback& show_dialog_callback) {
+ const ShowDialogCallback& show_dialog_callback,
+ const Prompt& prompt) {
DCHECK(ui_loop_ == base::MessageLoop::current());
extension_ = extension;
permissions_ = extension->GetActivePermissions();
delegate_ = delegate;
- prompt_.set_type(EXTERNAL_INSTALL_PROMPT);
+ prompt_ = prompt;
show_dialog_callback_ = show_dialog_callback;
LoadImageIfNeeded();
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.h ('k') | chrome/browser/extensions/external_install_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698