Chromium Code Reviews| 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 edc64d7dc26c0aea88e60ae322990e953624328c..de5917878b7f9d6aaa596337e0108a309f3d6c1b 100644 |
| --- a/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm |
| +++ b/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm |
| @@ -93,6 +93,10 @@ WebIntentPickerCocoa::~WebIntentPickerCocoa() { |
| } |
| void WebIntentPickerCocoa::Close() { |
| + DCHECK(controller_); |
| + [controller_ close]; |
| + if (inline_disposition_tab_contents_.get()) |
| + inline_disposition_tab_contents_->web_contents()->OnCloseStarted(); |
| } |
| void WebIntentPickerCocoa::PerformDelayedLayout() { |
| @@ -160,7 +164,8 @@ void WebIntentPickerCocoa::OnInlineDisposition(WebIntentPickerModel* model) { |
| void WebIntentPickerCocoa::OnCancelled() { |
| DCHECK(delegate_); |
| delegate_->OnCancelled(); |
| - controller_ = NULL; // Controller will be unusable soon, abandon. |
| + delegate_->OnClosing(); |
| + delete this; |
|
Robert Sesek
2012/02/07 00:28:17
Is this safe? Could anything access |this| after t
groby-ooo-7-16
2012/02/08 03:27:42
Done.
|
| } |
| void WebIntentPickerCocoa::OnServiceChosen(size_t index) { |