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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
300 } | 300 } |
301 | 301 |
302 void WebIntentPickerController::OnInlineDispositionWebContentsCreated( | 302 void WebIntentPickerController::OnInlineDispositionWebContentsCreated( |
303 content::WebContents* web_contents) { | 303 content::WebContents* web_contents) { |
304 if (web_contents) | 304 if (web_contents) |
305 intents_dispatcher_->DispatchIntent(web_contents); | 305 intents_dispatcher_->DispatchIntent(web_contents); |
306 } | 306 } |
307 | 307 |
308 void WebIntentPickerController::OnExtensionInstallRequested( | 308 void WebIntentPickerController::OnExtensionInstallRequested( |
309 const std::string& id) { | 309 const std::string& id) { |
310 // Only need to set extension_id, manifest, etc, if we want to skip the | |
Mihai Parparita -not on Chrome
2012/05/14 23:25:04
Nit: You could enforce this by making Approval int
Aaron Boodman
2012/05/15 05:30:07
Done, trybotting.
| |
311 // install dialog. | |
312 scoped_ptr<WebstoreInstaller::Approval> approval( | |
313 new WebstoreInstaller::Approval()); | |
314 approval->profile = wrapper_->profile(); | |
315 | |
310 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller( | 316 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller( |
311 wrapper_->profile(), this, &wrapper_->web_contents()->GetController(), id, | 317 wrapper_->profile(), this, &wrapper_->web_contents()->GetController(), id, |
312 scoped_ptr<WebstoreInstaller::Approval>(NULL), | 318 approval.Pass(), WebstoreInstaller::FLAG_INLINE_INSTALL); |
313 WebstoreInstaller::FLAG_INLINE_INSTALL); | |
314 | 319 |
315 pending_async_count_++; | 320 pending_async_count_++; |
316 installer->Start(); | 321 installer->Start(); |
317 } | 322 } |
318 | 323 |
319 void WebIntentPickerController::OnExtensionLinkClicked(const std::string& id) { | 324 void WebIntentPickerController::OnExtensionLinkClicked(const std::string& id) { |
320 // Navigate from source tab. | 325 // Navigate from source tab. |
321 Browser* browser = | 326 Browser* browser = |
322 BrowserList::FindBrowserWithWebContents(wrapper_->web_contents()); | 327 BrowserList::FindBrowserWithWebContents(wrapper_->web_contents()); |
323 GURL extension_url(extension_urls::GetWebstoreItemDetailURLPrefix() + id); | 328 GURL extension_url(extension_urls::GetWebstoreItemDetailURLPrefix() + id); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
684 // If picker is non-NULL, it was set by a test. | 689 // If picker is non-NULL, it was set by a test. |
685 if (picker_ == NULL) | 690 if (picker_ == NULL) |
686 picker_ = WebIntentPicker::Create(wrapper_, this, picker_model_.get()); | 691 picker_ = WebIntentPicker::Create(wrapper_, this, picker_model_.get()); |
687 picker_shown_ = true; | 692 picker_shown_ = true; |
688 } | 693 } |
689 | 694 |
690 void WebIntentPickerController::ClosePicker() { | 695 void WebIntentPickerController::ClosePicker() { |
691 if (picker_) | 696 if (picker_) |
692 picker_->Close(); | 697 picker_->Close(); |
693 } | 698 } |
OLD | NEW |