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

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: Move invalidation 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
« 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 4ba14602061f8db9938e9f065c8ba4defb8ea61c..75dd7fd8dab27847bb2d0ca05f100183a996dca7 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,
@@ -217,10 +218,13 @@ WebIntentPickerController::~WebIntentPickerController() {
// TODO(gbillock): combine this with ShowDialog.
void WebIntentPickerController::SetIntentsDispatcher(
content::WebIntentsDispatcher* 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();
intents_dispatcher_ = intents_dispatcher;
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();
« 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