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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 true)) { // Include disabled. | 552 true)) { // Include disabled. |
553 continue; | 553 continue; |
554 } | 554 } |
555 | 555 |
556 picker_model_->AddSuggestedExtension( | 556 picker_model_->AddSuggestedExtension( |
557 info.name, | 557 info.name, |
558 info.id, | 558 info.id, |
559 info.average_rating); | 559 info.average_rating); |
560 | 560 |
561 pending_async_count_++; | 561 pending_async_count_++; |
562 content::URLFetcher* icon_url_fetcher = content::URLFetcher::Create( | 562 net::URLFetcher* icon_url_fetcher = content::URLFetcher::Create( |
563 0, | 563 0, |
564 info.icon_url, | 564 info.icon_url, |
565 content::URLFetcher::GET, | 565 net::URLFetcher::GET, |
566 new URLFetcherTrampoline( | 566 new URLFetcherTrampoline( |
567 base::Bind( | 567 base::Bind( |
568 &WebIntentPickerController::OnExtensionIconURLFetchComplete, | 568 &WebIntentPickerController::OnExtensionIconURLFetchComplete, |
569 weak_ptr_factory_.GetWeakPtr(), info.id))); | 569 weak_ptr_factory_.GetWeakPtr(), info.id))); |
570 | 570 |
571 icon_url_fetcher->SetLoadFlags( | 571 icon_url_fetcher->SetLoadFlags( |
572 net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES); | 572 net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES); |
573 icon_url_fetcher->SetRequestContext( | 573 icon_url_fetcher->SetRequestContext( |
574 wrapper_->profile()->GetRequestContext()); | 574 wrapper_->profile()->GetRequestContext()); |
575 icon_url_fetcher->Start(); | 575 icon_url_fetcher->Start(); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 // If picker is non-NULL, it was set by a test. | 688 // If picker is non-NULL, it was set by a test. |
689 if (picker_ == NULL) | 689 if (picker_ == NULL) |
690 picker_ = WebIntentPicker::Create(wrapper_, this, picker_model_.get()); | 690 picker_ = WebIntentPicker::Create(wrapper_, this, picker_model_.get()); |
691 picker_shown_ = true; | 691 picker_shown_ = true; |
692 } | 692 } |
693 | 693 |
694 void WebIntentPickerController::ClosePicker() { | 694 void WebIntentPickerController::ClosePicker() { |
695 if (picker_) | 695 if (picker_) |
696 picker_->Close(); | 696 picker_->Close(); |
697 } | 697 } |
OLD | NEW |