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

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

Issue 10980002: Mac Web Intents Part 1: Show extension download progress (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 131f735d8b04be7fbcaf702035b20b6e682a8ed0..024f672fe64d786ce16d02eede4442ec373def86 100644
--- a/chrome/browser/ui/intents/web_intent_picker_model.cc
+++ b/chrome/browser/ui/intents/web_intent_picker_model.cc
@@ -24,7 +24,8 @@ const size_t kMaxSuggestionCount = 5; // Maximum number of visible suggestions.
WebIntentPickerModel::WebIntentPickerModel()
: observer_(NULL),
waiting_for_suggestions_(true),
- default_service_hash_(0) {
+ default_service_hash_(0),
+ pending_install_download_percent_(0) {
Steve McKay 2012/09/25 18:56:04 pending_install_download_percent_ > pending_instal
sail 2012/10/02 18:57:01 Done.
}
WebIntentPickerModel::~WebIntentPickerModel() {
@@ -62,6 +63,7 @@ void WebIntentPickerModel::Clear() {
type_.clear();
inline_disposition_url_ = GURL::EmptyGURL();
waiting_for_suggestions_ = true;
+ ClearPendingInstall();
Steve McKay 2012/09/25 18:56:04 There are a lot of things at play in the picker. I
sail 2012/10/02 18:57:01 Done. Updated all the other fields as well.
if (observer_)
observer_->OnModelChanged(this);
}
@@ -160,6 +162,33 @@ void WebIntentPickerModel::SetWaitingForSuggestions(bool waiting) {
observer_->OnModelChanged(this);
}
+void WebIntentPickerModel::SetPendingInstallExtensionId(const std::string& id) {
+ pending_install_extension_id_ = id;
+ if (observer_)
+ observer_->OnModelChanged(this);
+}
+
+void WebIntentPickerModel::SetPendingInstallDownloadPercent(int percent) {
+ pending_install_download_percent_ = percent;
+ if (observer_)
+ observer_->OnModelChanged(this);
groby-ooo-7-16 2012/09/25 22:20:56 Pre your refactor, OnModelChanged used to trigger
sail 2012/10/02 18:57:01 Yea, it's really cheap now and I don't see any vis
+}
+
+void WebIntentPickerModel::SetPendingInstallStatusString(
+ const string16& status) {
+ pending_install_status_string_ = status;
+ if (observer_)
+ observer_->OnModelChanged(this);
+}
+
+void WebIntentPickerModel::ClearPendingInstall() {
+ pending_install_extension_id_.clear();
+ pending_install_download_percent_ = 0;
+ pending_install_status_string_.clear();
+ if (observer_)
+ observer_->OnModelChanged(this);
+}
+
void WebIntentPickerModel::DestroyAll() {
STLDeleteElements(&installed_services_);
}

Powered by Google App Engine
This is Rietveld 408576698