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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); | 164 MSG_ROUTING_NONE, NULL); |
165 inline_disposition_tab_contents_.reset(new TabContents(web_contents)); | 165 inline_disposition_tab_contents_.reset( |
| 166 TabContents::Factory::CreateTabContents(web_contents)); |
166 Browser* browser = browser::FindBrowserWithWebContents( | 167 Browser* browser = browser::FindBrowserWithWebContents( |
167 tab_contents_->web_contents()); | 168 tab_contents_->web_contents()); |
168 inline_disposition_delegate_.reset( | 169 inline_disposition_delegate_.reset( |
169 new WebIntentInlineDispositionDelegate(this, web_contents, browser)); | 170 new WebIntentInlineDispositionDelegate(this, web_contents, browser)); |
170 | 171 |
171 // Must call this immediately after WebContents creation to avoid race | 172 // Must call this immediately after WebContents creation to avoid race |
172 // with load. | 173 // with load. |
173 delegate_->OnInlineDispositionWebContentsCreated(web_contents); | 174 delegate_->OnInlineDispositionWebContentsCreated(web_contents); |
174 | 175 |
175 inline_disposition_tab_contents_->web_contents()->GetController().LoadURL( | 176 inline_disposition_tab_contents_->web_contents()->GetController().LoadURL( |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 } | 239 } |
239 | 240 |
240 void WebIntentPickerCocoa::OnChooseAnotherService() { | 241 void WebIntentPickerCocoa::OnChooseAnotherService() { |
241 DCHECK(delegate_); | 242 DCHECK(delegate_); |
242 delegate_->OnChooseAnotherService(); | 243 delegate_->OnChooseAnotherService(); |
243 inline_disposition_tab_contents_.reset(); | 244 inline_disposition_tab_contents_.reset(); |
244 inline_disposition_delegate_.reset(); | 245 inline_disposition_delegate_.reset(); |
245 [sheet_controller_ setInlineDispositionTabContents:NULL]; | 246 [sheet_controller_ setInlineDispositionTabContents:NULL]; |
246 PerformLayout(); | 247 PerformLayout(); |
247 } | 248 } |
OLD | NEW |