OLD | NEW |
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 #include "chrome/browser/ui/cocoa/web_intent_picker_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/web_intent_picker_cocoa.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 const string16& extension_id) { | 154 const string16& extension_id) { |
155 // We don't handle individual icon changes - just redo the whole model. | 155 // We don't handle individual icon changes - just redo the whole model. |
156 PerformLayout(); | 156 PerformLayout(); |
157 } | 157 } |
158 | 158 |
159 void WebIntentPickerCocoa::OnInlineDisposition(const string16& title, | 159 void WebIntentPickerCocoa::OnInlineDisposition(const string16& title, |
160 const GURL& url) { | 160 const GURL& url) { |
161 content::WebContents* web_contents = content::WebContents::Create( | 161 content::WebContents* web_contents = content::WebContents::Create( |
162 tab_contents_->profile(), | 162 tab_contents_->profile(), |
163 tab_util::GetSiteInstanceForNewTab(tab_contents_->profile(), url), | 163 tab_util::GetSiteInstanceForNewTab(tab_contents_->profile(), url), |
164 MSG_ROUTING_NONE, NULL, NULL); | 164 MSG_ROUTING_NONE, NULL); |
165 inline_disposition_tab_contents_.reset(new TabContents(web_contents)); | 165 inline_disposition_tab_contents_.reset(new TabContents(web_contents)); |
166 Browser* browser = browser::FindBrowserWithWebContents( | 166 Browser* browser = browser::FindBrowserWithWebContents( |
167 tab_contents_->web_contents()); | 167 tab_contents_->web_contents()); |
168 inline_disposition_delegate_.reset( | 168 inline_disposition_delegate_.reset( |
169 new WebIntentInlineDispositionDelegate(this, web_contents, browser)); | 169 new WebIntentInlineDispositionDelegate(this, web_contents, browser)); |
170 | 170 |
171 // Must call this immediately after WebContents creation to avoid race | 171 // Must call this immediately after WebContents creation to avoid race |
172 // with load. | 172 // with load. |
173 delegate_->OnInlineDispositionWebContentsCreated(web_contents); | 173 delegate_->OnInlineDispositionWebContentsCreated(web_contents); |
174 | 174 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 } | 240 } |
241 | 241 |
242 void WebIntentPickerCocoa::OnChooseAnotherService() { | 242 void WebIntentPickerCocoa::OnChooseAnotherService() { |
243 DCHECK(delegate_); | 243 DCHECK(delegate_); |
244 delegate_->OnChooseAnotherService(); | 244 delegate_->OnChooseAnotherService(); |
245 inline_disposition_tab_contents_.reset(); | 245 inline_disposition_tab_contents_.reset(); |
246 inline_disposition_delegate_.reset(); | 246 inline_disposition_delegate_.reset(); |
247 [sheet_controller_ setInlineDispositionTabContents:NULL]; | 247 [sheet_controller_ setInlineDispositionTabContents:NULL]; |
248 PerformLayout(); | 248 PerformLayout(); |
249 } | 249 } |
OLD | NEW |