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

Unified Diff: chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm

Issue 11141037: Disable delegation to picker controller once it is deleted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix tests. 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
« no previous file with comments | « chrome/browser/ui/cocoa/web_intent_picker_cocoa.h ('k') | chrome/browser/ui/gtk/web_intent_picker_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm b/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm
index b563a2e7f6cc453fa844cff2c273c1c665162bf6..f1a45c6dc79a6a21dd0a2777c75c8c87761540e0 100644
--- a/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm
+++ b/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm
@@ -120,7 +120,8 @@ void WebIntentPickerCocoa::OnSheetDidEnd(NSWindow* sheet) {
[sheet orderOut:sheet_controller_];
if (window_)
window_->CloseConstrainedWindow();
- delegate_->OnClosing();
+ if (delegate_)
+ delegate_->OnClosing();
}
void WebIntentPickerCocoa::Close() {
@@ -164,7 +165,7 @@ void WebIntentPickerCocoa::OnExtensionIconChanged(
void WebIntentPickerCocoa::OnInlineDisposition(const string16& title,
const GURL& url) {
-
+ DCHECK(delegate_);
content::WebContents* web_contents =
delegate_->CreateWebContentsForInlineDisposition(
tab_contents_->profile(), url);
@@ -207,6 +208,7 @@ void WebIntentPickerCocoa::OnServiceChosen(size_t index) {
void WebIntentPickerCocoa::OnExtensionInstallRequested(
const std::string& extension_id) {
+ DCHECK(delegate_);
delegate_->OnExtensionInstallRequested(extension_id);
}
@@ -231,6 +233,10 @@ void WebIntentPickerCocoa::OnInlineDispositionAutoResize(
void WebIntentPickerCocoa::OnPendingAsyncCompleted() {
}
+void WebIntentPickerCocoa::InvalidateDelegate() {
+ delegate_ = NULL;
+}
+
void WebIntentPickerCocoa::OnExtensionLinkClicked(
const std::string& id,
WindowOpenDisposition disposition) {
« no previous file with comments | « chrome/browser/ui/cocoa/web_intent_picker_cocoa.h ('k') | chrome/browser/ui/gtk/web_intent_picker_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698