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

Unified Diff: chrome/browser/ui/intents/web_intent_picker_model.cc

Issue 11035017: Mac Web Intents Part 15: Inline extension install prompt (model) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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/ui/intents/web_intent_picker_model.cc
diff --git a/chrome/browser/ui/intents/web_intent_picker_model.cc b/chrome/browser/ui/intents/web_intent_picker_model.cc
index 826a94c78c8a1c105bacc299c315b51b93d135c3..3977b06589992b059791c6e182d44eca0faf9bae 100644
--- a/chrome/browser/ui/intents/web_intent_picker_model.cc
+++ b/chrome/browser/ui/intents/web_intent_picker_model.cc
@@ -27,7 +27,8 @@ WebIntentPickerModel::WebIntentPickerModel()
: observer_(NULL),
waiting_for_suggestions_(true),
default_service_hash_(0),
- pending_extension_install_download_progress_(0) {
+ pending_extension_install_download_progress_(0),
+ pending_extension_install_prompt_(NULL) {
}
WebIntentPickerModel::~WebIntentPickerModel() {
@@ -209,10 +210,27 @@ void WebIntentPickerModel::SetPendingExtensionInstallStatusString(
observer_->OnModelChanged(this);
}
+void WebIntentPickerModel::SetPendingExtensionInstallDelegate(
+ ExtensionInstallPrompt::Delegate* delegate) {
+ pending_extension_install_delegate_ = delegate;
+ if (observer_)
+ observer_->OnModelChanged(this);
+}
+
+void WebIntentPickerModel::SetPendingExtensionInstallPrompt(
+ const ExtensionInstallPrompt::Prompt& prompt) {
+ pending_extension_install_prompt_.reset(
+ new ExtensionInstallPrompt::Prompt(prompt));
+ if (observer_)
+ observer_->OnModelChanged(this);
+}
+
void WebIntentPickerModel::ClearPendingExtensionInstall() {
pending_extension_install_id_.clear();
pending_extension_install_download_progress_ = 0;
pending_extension_install_status_string_.clear();
+ pending_extension_install_delegate_ = NULL;
+ pending_extension_install_prompt_.reset();
if (observer_)
observer_->OnModelChanged(this);
}

Powered by Google App Engine
This is Rietveld 408576698