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/intents/web_intent_picker_controller.h" | 5 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 break; | 305 break; |
306 | 306 |
307 case WebIntentPickerModel::DISPOSITION_WINDOW: { | 307 case WebIntentPickerModel::DISPOSITION_WINDOW: { |
308 int index = TabStripModel::kNoTab; | 308 int index = TabStripModel::kNoTab; |
309 Browser* browser = browser::FindBrowserForController( | 309 Browser* browser = browser::FindBrowserForController( |
310 &tab_contents_->web_contents()->GetController(), &index); | 310 &tab_contents_->web_contents()->GetController(), &index); |
311 TabContents* contents = chrome::TabContentsFactory( | 311 TabContents* contents = chrome::TabContentsFactory( |
312 tab_contents_->profile(), | 312 tab_contents_->profile(), |
313 tab_util::GetSiteInstanceForNewTab( | 313 tab_util::GetSiteInstanceForNewTab( |
314 tab_contents_->profile(), url), | 314 tab_contents_->profile(), url), |
315 MSG_ROUTING_NONE, NULL, NULL); | 315 MSG_ROUTING_NONE, NULL); |
316 | 316 |
317 // Let the controller for the target TabContents know that it is hosting a | 317 // Let the controller for the target TabContents know that it is hosting a |
318 // web intents service. | 318 // web intents service. |
319 contents->web_intent_picker_controller()->SetWindowDispositionSource( | 319 contents->web_intent_picker_controller()->SetWindowDispositionSource( |
320 tab_contents_->web_contents(), intents_dispatcher_); | 320 tab_contents_->web_contents(), intents_dispatcher_); |
321 | 321 |
322 intents_dispatcher_->DispatchIntent(contents->web_contents()); | 322 intents_dispatcher_->DispatchIntent(contents->web_contents()); |
323 service_tab_ = contents->web_contents(); | 323 service_tab_ = contents->web_contents(); |
324 | 324 |
325 // This call performs all the tab strip manipulation, notifications, etc. | 325 // This call performs all the tab strip manipulation, notifications, etc. |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 // If picker is non-NULL, it was set by a test. | 767 // If picker is non-NULL, it was set by a test. |
768 if (picker_ == NULL) | 768 if (picker_ == NULL) |
769 picker_ = WebIntentPicker::Create(tab_contents_, this, picker_model_.get()); | 769 picker_ = WebIntentPicker::Create(tab_contents_, this, picker_model_.get()); |
770 picker_shown_ = true; | 770 picker_shown_ = true; |
771 } | 771 } |
772 | 772 |
773 void WebIntentPickerController::ClosePicker() { | 773 void WebIntentPickerController::ClosePicker() { |
774 if (picker_) | 774 if (picker_) |
775 picker_->Close(); | 775 picker_->Close(); |
776 } | 776 } |
OLD | NEW |