| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 inline_disposition_delegate_.reset( | 169 inline_disposition_delegate_.reset( |
| 170 new WebIntentInlineDispositionDelegate(this, web_contents, browser)); | 170 new WebIntentInlineDispositionDelegate(this, web_contents, browser)); |
| 171 | 171 |
| 172 // Must call this immediately after WebContents creation to avoid race | 172 // Must call this immediately after WebContents creation to avoid race |
| 173 // with load. | 173 // with load. |
| 174 delegate_->OnInlineDispositionWebContentsCreated(web_contents); | 174 delegate_->OnInlineDispositionWebContentsCreated(web_contents); |
| 175 | 175 |
| 176 inline_disposition_tab_contents_->web_contents()->GetController().LoadURL( | 176 inline_disposition_tab_contents_->web_contents()->GetController().LoadURL( |
| 177 url, | 177 url, |
| 178 content::Referrer(), | 178 content::Referrer(), |
| 179 content::PAGE_TRANSITION_START_PAGE, | 179 content::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 180 std::string()); | 180 std::string()); |
| 181 [sheet_controller_ setInlineDispositionTitle: | 181 [sheet_controller_ setInlineDispositionTitle: |
| 182 base::SysUTF16ToNSString(title)]; | 182 base::SysUTF16ToNSString(title)]; |
| 183 [sheet_controller_ setInlineDispositionTabContents: | 183 [sheet_controller_ setInlineDispositionTabContents: |
| 184 inline_disposition_tab_contents_.get()]; | 184 inline_disposition_tab_contents_.get()]; |
| 185 PerformLayout(); | 185 PerformLayout(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void WebIntentPickerCocoa::OnCancelled() { | 188 void WebIntentPickerCocoa::OnCancelled() { |
| 189 DCHECK(delegate_); | 189 DCHECK(delegate_); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 } | 239 } |
| 240 | 240 |
| 241 void WebIntentPickerCocoa::OnChooseAnotherService() { | 241 void WebIntentPickerCocoa::OnChooseAnotherService() { |
| 242 DCHECK(delegate_); | 242 DCHECK(delegate_); |
| 243 delegate_->OnChooseAnotherService(); | 243 delegate_->OnChooseAnotherService(); |
| 244 inline_disposition_tab_contents_.reset(); | 244 inline_disposition_tab_contents_.reset(); |
| 245 inline_disposition_delegate_.reset(); | 245 inline_disposition_delegate_.reset(); |
| 246 [sheet_controller_ setInlineDispositionTabContents:NULL]; | 246 [sheet_controller_ setInlineDispositionTabContents:NULL]; |
| 247 PerformLayout(); | 247 PerformLayout(); |
| 248 } | 248 } |
| OLD | NEW |