Chromium Code Reviews| 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_); |
| } |