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(WebIntentPickerModel* model, | 159 void WebIntentPickerCocoa::OnInlineDisposition(WebIntentPickerModel* model, |
160 const GURL& url) { | 160 const GURL& url) { |
161 DCHECK(browser_); | 161 DCHECK(browser_); |
162 content::WebContents* web_contents = content::WebContents::Create( | 162 content::WebContents* web_contents = content::WebContents::Create( |
163 browser_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); | 163 browser_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); |
164 inline_disposition_tab_contents_.reset(new TabContentsWrapper(web_contents)); | 164 inline_disposition_tab_contents_.reset(new TabContentsWrapper(web_contents)); |
165 inline_disposition_delegate_.reset(new WebIntentInlineDispositionDelegate); | 165 inline_disposition_delegate_.reset( |
| 166 new WebIntentInlineDispositionDelegate(this)); |
166 web_contents->SetDelegate(inline_disposition_delegate_.get()); | 167 web_contents->SetDelegate(inline_disposition_delegate_.get()); |
167 | 168 |
168 // Must call this immediately after WebContents creation to avoid race | 169 // Must call this immediately after WebContents creation to avoid race |
169 // with load. | 170 // with load. |
170 delegate_->OnInlineDispositionWebContentsCreated(web_contents); | 171 delegate_->OnInlineDispositionWebContentsCreated(web_contents); |
171 | 172 |
172 inline_disposition_tab_contents_->web_contents()->GetController().LoadURL( | 173 inline_disposition_tab_contents_->web_contents()->GetController().LoadURL( |
173 url, | 174 url, |
174 content::Referrer(), | 175 content::Referrer(), |
175 content::PAGE_TRANSITION_START_PAGE, | 176 content::PAGE_TRANSITION_START_PAGE, |
(...skipping 25 matching lines...) Expand all Loading... |
201 const std::string& extension_id) { | 202 const std::string& extension_id) { |
202 delegate_->OnExtensionInstallRequested(extension_id); | 203 delegate_->OnExtensionInstallRequested(extension_id); |
203 } | 204 } |
204 | 205 |
205 void WebIntentPickerCocoa::OnExtensionInstallSuccess(const std::string& id) { | 206 void WebIntentPickerCocoa::OnExtensionInstallSuccess(const std::string& id) { |
206 } | 207 } |
207 | 208 |
208 void WebIntentPickerCocoa::OnExtensionInstallFailure(const std::string& id) { | 209 void WebIntentPickerCocoa::OnExtensionInstallFailure(const std::string& id) { |
209 // TODO(groby): What to do on failure? (See also binji for views/gtk) | 210 // TODO(groby): What to do on failure? (See also binji for views/gtk) |
210 } | 211 } |
OLD | NEW |