Chromium Code Reviews| 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(); |
|
please use gerrit instead
2012/09/20 16:38:30
When you say "not a well-handled case", do you mea
Greg Billock
2012/09/20 16:45:19
The right solution is a "ChromeIntentsDispatcher"
|
| 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(); |