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

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

Issue 10823424: Make sure controller is properly reset when the picker is closed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « chrome/browser/ui/intents/web_intent_picker_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/intents/web_intent_picker_controller.cc
diff --git a/chrome/browser/ui/intents/web_intent_picker_controller.cc b/chrome/browser/ui/intents/web_intent_picker_controller.cc
index 01c4068ca1cc8b0b86e759c170f8a3fe1b85b914..f98a36811195dab85d9538cf36b57ca70bdabd15 100644
--- a/chrome/browser/ui/intents/web_intent_picker_controller.cc
+++ b/chrome/browser/ui/intents/web_intent_picker_controller.cc
@@ -690,6 +690,27 @@ void WebIntentPickerController::OnIntentDataArrived() {
OnPickerEvent(kPickerEventAsyncDataComplete);
}
+void WebIntentPickerController::Reset() {
+ // Can only be invoked when picker is hidden
+ DCHECK(dialog_state_ == kPickerHidden);
sky 2012/08/20 23:08:20 DCHECK_EQ
groby-ooo-7-16 2012/08/21 03:40:30 Done.
+
+ // Abandon all callbacks.
+ weak_ptr_factory_.InvalidateWeakPtrs();
+ timer_factory_.InvalidateWeakPtrs();
+
+ // Reset state associated with callbacks.
+ pending_async_count_ = 0;
+ pending_registry_calls_count_ = 0;
+ pending_cws_request_ = false;
+
+ // Reset picker.
+ picker_model_.reset(new WebIntentPickerModel());
+ picker_shown_ = false;
+
+ DCHECK(tab_contents_);
+ tab_contents_->constrained_window_tab_helper()->BlockTabContent(false);
+}
+
// static
void WebIntentPickerController::DecodeExtensionIconAndResize(
scoped_ptr<std::string> icon_response,
@@ -862,6 +883,7 @@ void WebIntentPickerController::SetDialogState(WebIntentPickerState state) {
break;
case kPickerHidden:
+ Reset();
break;
default:
« no previous file with comments | « chrome/browser/ui/intents/web_intent_picker_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698