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

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

Issue 10969016: web intents. Fix callbacks to restore tab management on service exit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improve comments 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_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();

Powered by Google App Engine
This is Rietveld 408576698