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

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

Issue 11071005: Add native file picker impl using SelectFileDialog. (Closed) Base URL: http://git.chromium.org/chromium/src.git@filePicker
Patch Set: Don't use "DeleteService" as a method name since Windows munges it at compile time. Created 8 years, 2 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 3c7622f5755e96323baf15a9195cd7a14a836527..e318db07507bb114aaa036fd02634dd5ba42c7a2 100644
--- a/chrome/browser/ui/intents/web_intent_picker_controller.cc
+++ b/chrome/browser/ui/intents/web_intent_picker_controller.cc
@@ -136,6 +136,13 @@ class SourceWindowObserver : content::WebContentsObserver {
base::WeakPtr<WebIntentPickerController> controller_;
};
+// Deletes |service|, presumably called from a dispatcher callback.
+void DeleteIntentService(
+ web_intents::IntentServiceHost* service,
+ webkit_glue::WebIntentReplyType type) {
+ delete service;
+}
+
} // namespace
// UMAReporter handles reporting Web Intents events to UMA.
@@ -363,8 +370,12 @@ void WebIntentPickerController::OnServiceChosen(
case webkit_glue::WebIntentServiceData::DISPOSITION_NATIVE: {
web_intents::IntentServiceHost* service =
native_services_->CreateServiceInstance(
- url, intents_dispatcher_->GetIntent());
+ url, intents_dispatcher_->GetIntent(), web_contents_);
DCHECK(service);
+
+ intents_dispatcher_->RegisterReplyNotification(
+ base::Bind(&DeleteIntentService, base::Unretained(service)));
+
service->HandleIntent(intents_dispatcher_);
break;
}
« no previous file with comments | « chrome/browser/ui/intents/native_file_picker_service.cc ('k') | chrome/browser/ui/views/web_intents_native_services.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698