| 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 intents_dispatcher_->DispatchIntent(contents->web_contents()); | 294 intents_dispatcher_->DispatchIntent(contents->web_contents()); |
| 295 service_tab_ = contents->web_contents(); | 295 service_tab_ = contents->web_contents(); |
| 296 | 296 |
| 297 // This call performs all the tab strip manipulation, notifications, etc. | 297 // This call performs all the tab strip manipulation, notifications, etc. |
| 298 // Since we're passing in a target_contents, it assumes that we will | 298 // Since we're passing in a target_contents, it assumes that we will |
| 299 // navigate the page ourselves, though. | 299 // navigate the page ourselves, though. |
| 300 chrome::NavigateParams params(browser, url, | 300 chrome::NavigateParams params(browser, url, |
| 301 content::PAGE_TRANSITION_AUTO_BOOKMARK); | 301 content::PAGE_TRANSITION_AUTO_BOOKMARK); |
| 302 params.target_contents = contents; | 302 params.target_contents = contents; |
| 303 params.disposition = NEW_FOREGROUND_TAB; | 303 params.disposition = NEW_FOREGROUND_TAB; |
| 304 params.profile = tab_contents_->profile(); | |
| 305 chrome::Navigate(¶ms); | 304 chrome::Navigate(¶ms); |
| 306 | 305 |
| 307 service_tab_->GetController().LoadURL( | 306 service_tab_->GetController().LoadURL( |
| 308 url, content::Referrer(), | 307 url, content::Referrer(), |
| 309 content::PAGE_TRANSITION_AUTO_BOOKMARK, std::string()); | 308 content::PAGE_TRANSITION_AUTO_BOOKMARK, std::string()); |
| 310 | 309 |
| 311 ClosePicker(); | 310 ClosePicker(); |
| 312 break; | 311 break; |
| 313 } | 312 } |
| 314 | 313 |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 // If picker is non-NULL, it was set by a test. | 709 // If picker is non-NULL, it was set by a test. |
| 711 if (picker_ == NULL) | 710 if (picker_ == NULL) |
| 712 picker_ = WebIntentPicker::Create(tab_contents_, this, picker_model_.get()); | 711 picker_ = WebIntentPicker::Create(tab_contents_, this, picker_model_.get()); |
| 713 picker_shown_ = true; | 712 picker_shown_ = true; |
| 714 } | 713 } |
| 715 | 714 |
| 716 void WebIntentPickerController::ClosePicker() { | 715 void WebIntentPickerController::ClosePicker() { |
| 717 if (picker_) | 716 if (picker_) |
| 718 picker_->Close(); | 717 picker_->Close(); |
| 719 } | 718 } |
| OLD | NEW |