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 570ac53eedb99ca86951227017ca3aa178559630..55b22b3288b4468209ff6183d10e21126c8058ca 100644 |
--- a/chrome/browser/ui/intents/web_intent_picker_controller.cc |
+++ b/chrome/browser/ui/intents/web_intent_picker_controller.cc |
@@ -199,7 +199,8 @@ WebIntentPickerController::WebIntentPickerController( |
intents_dispatcher_(NULL), |
service_tab_(NULL), |
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), |
- ALLOW_THIS_IN_INITIALIZER_LIST(timer_factory_(this)) { |
+ ALLOW_THIS_IN_INITIALIZER_LIST(timer_factory_(this)), |
+ ALLOW_THIS_IN_INITIALIZER_LIST(dispatcher_factory_(this)) { |
content::NavigationController* controller = |
&tab_contents->web_contents()->GetController(); |
registrar_.Add(this, content::NOTIFICATION_LOAD_START, |
@@ -218,9 +219,12 @@ WebIntentPickerController::~WebIntentPickerController() { |
void WebIntentPickerController::SetIntentsDispatcher( |
content::WebIntentsDispatcher* intents_dispatcher) { |
intents_dispatcher_ = intents_dispatcher; |
+ // TODO(gbillock): This is to account for multiple dispatches in the same tab. |
+ // That is currently not a well-handled case, and this is a band-aid. |
+ dispatcher_factory_.InvalidateWeakPtrs(); |
groby-ooo-7-16
2012/09/21 02:25:21
Don't you want to invalidate _before_ you change m
Greg Billock
2012/09/21 05:10:09
Good point. I'll do it.
On 2012/09/21 02:25:21, g
|
intents_dispatcher_->RegisterReplyNotification( |
base::Bind(&WebIntentPickerController::OnSendReturnMessage, |
- weak_ptr_factory_.GetWeakPtr())); |
+ dispatcher_factory_.GetWeakPtr())); |
// Initialize the reporting bucket. |
const webkit_glue::WebIntentData& intent = intents_dispatcher_->GetIntent(); |