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

Side by Side Diff: chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa2.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa2.h" 5 #import "chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa2.h"
6 6
7 #include <Cocoa/Cocoa.h> 7 #include <Cocoa/Cocoa.h>
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 WebIntentPickerCocoa2::~WebIntentPickerCocoa2() { 39 WebIntentPickerCocoa2::~WebIntentPickerCocoa2() {
40 } 40 }
41 41
42 void WebIntentPickerCocoa2::Close() { 42 void WebIntentPickerCocoa2::Close() {
43 constrained_window_->CloseConstrainedWindow(); 43 constrained_window_->CloseConstrainedWindow();
44 } 44 }
45 45
46 void WebIntentPickerCocoa2::SetActionString(const string16& action) { 46 void WebIntentPickerCocoa2::SetActionString(const string16& action) {
47 // Ignored. Action string it retrieved from the model. 47 // Ignored. Action string is retrieved from the model.
48 } 48 }
49 49
50 void WebIntentPickerCocoa2::OnExtensionInstallSuccess(const std::string& id) { 50 void WebIntentPickerCocoa2::OnExtensionInstallSuccess(const std::string& id) {
51 [view_controller_ update]; 51 [view_controller_ update];
52 } 52 }
53 53
54 void WebIntentPickerCocoa2::OnExtensionInstallFailure(const std::string& id) { 54 void WebIntentPickerCocoa2::OnExtensionInstallFailure(const std::string& id) {
55 [view_controller_ update]; 55 [view_controller_ update];
56 } 56 }
57 57
(...skipping 19 matching lines...) Expand all
77 ChromeEventProcessingWindow* window = 77 ChromeEventProcessingWindow* window =
78 base::mac::ObjCCastStrict<ChromeEventProcessingWindow>( 78 base::mac::ObjCCastStrict<ChromeEventProcessingWindow>(
79 constrained_window_->GetNativeWindow()); 79 constrained_window_->GetNativeWindow());
80 [window redispatchKeyEvent:event.os_event]; 80 [window redispatchKeyEvent:event.os_event];
81 } 81 }
82 82
83 void WebIntentPickerCocoa2::OnPendingAsyncCompleted() { 83 void WebIntentPickerCocoa2::OnPendingAsyncCompleted() {
84 [view_controller_ update]; 84 [view_controller_ update];
85 } 85 }
86 86
87 void WebIntentPickerCocoa2::InvalidateDelegate() {
88 delegate_ = NULL;
89 }
90
87 void WebIntentPickerCocoa2::OnInlineDispositionWebContentsLoaded( 91 void WebIntentPickerCocoa2::OnInlineDispositionWebContentsLoaded(
88 content::WebContents* web_contents) { 92 content::WebContents* web_contents) {
89 [view_controller_ update]; 93 [view_controller_ update];
90 } 94 }
91 95
92 gfx::Size WebIntentPickerCocoa2::GetMinInlineDispositionSize() { 96 gfx::Size WebIntentPickerCocoa2::GetMinInlineDispositionSize() {
93 return [view_controller_ minimumInlineWebViewSize]; 97 return [view_controller_ minimumInlineWebViewSize];
94 } 98 }
95 99
96 void WebIntentPickerCocoa2::OnModelChanged(WebIntentPickerModel* model) { 100 void WebIntentPickerCocoa2::OnModelChanged(WebIntentPickerModel* model) {
(...skipping 15 matching lines...) Expand all
112 const GURL& url) { 116 const GURL& url) {
113 [view_controller_ update]; 117 [view_controller_ update];
114 } 118 }
115 119
116 void WebIntentPickerCocoa2::OnConstrainedWindowClosed( 120 void WebIntentPickerCocoa2::OnConstrainedWindowClosed(
117 ConstrainedWindowMac2* window) { 121 ConstrainedWindowMac2* window) {
118 // After the OnClosing call the model may be deleted so unset this reference. 122 // After the OnClosing call the model may be deleted so unset this reference.
119 model_->set_observer(NULL); 123 model_->set_observer(NULL);
120 model_ = NULL; 124 model_ = NULL;
121 125
122 delegate_->OnClosing(); 126 if (delegate_)
127 delegate_->OnClosing();
123 MessageLoop::current()->DeleteSoon(FROM_HERE, this); 128 MessageLoop::current()->DeleteSoon(FROM_HERE, this);
124 } 129 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/intents/web_intent_picker_cocoa2.h ('k') | chrome/browser/ui/cocoa/web_intent_picker_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698