| 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 InvokeService(*default_service); | 571 InvokeService(*default_service); |
| 572 return; | 572 return; |
| 573 } | 573 } |
| 574 } | 574 } |
| 575 | 575 |
| 576 OnPickerEvent(kPickerEventRegistryDataComplete); | 576 OnPickerEvent(kPickerEventRegistryDataComplete); |
| 577 OnIntentDataArrived(); | 577 OnIntentDataArrived(); |
| 578 } | 578 } |
| 579 | 579 |
| 580 void WebIntentPickerController::OnFaviconDataAvailable( | 580 void WebIntentPickerController::OnFaviconDataAvailable( |
| 581 FaviconService::Handle handle, history::FaviconData favicon_data) { | 581 FaviconService::Handle handle, |
| 582 history::FaviconData favicon_data, |
| 583 std::vector<GURL> icon_urls_in_db) { |
| 582 size_t index = favicon_consumer_.GetClientDataForCurrentRequest(); | 584 size_t index = favicon_consumer_.GetClientDataForCurrentRequest(); |
| 583 if (favicon_data.is_valid()) { | 585 if (favicon_data.has_valid_bitmaps()) { |
| 584 SkBitmap icon_bitmap; | 586 SkBitmap icon_bitmap; |
| 585 | 587 |
| 586 if (gfx::PNGCodec::Decode(favicon_data.image_data->front(), | 588 scoped_refptr<base::RefCountedMemory> bitmap_data( |
| 587 favicon_data.image_data->size(), | 589 favicon_data.first_bitmap()); |
| 590 if (gfx::PNGCodec::Decode(bitmap_data->front(), bitmap_data->size(), |
| 588 &icon_bitmap)) { | 591 &icon_bitmap)) { |
| 589 gfx::Image icon_image(icon_bitmap); | 592 gfx::Image icon_image(icon_bitmap); |
| 590 picker_model_->UpdateFaviconAt(index, icon_image); | 593 picker_model_->UpdateFaviconAt(index, icon_image); |
| 591 return; | 594 return; |
| 592 } | 595 } |
| 593 } | 596 } |
| 594 | 597 |
| 595 AsyncOperationFinished(); | 598 AsyncOperationFinished(); |
| 596 } | 599 } |
| 597 | 600 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 picker_->SetActionString(GetIntentActionString( | 890 picker_->SetActionString(GetIntentActionString( |
| 888 UTF16ToUTF8(picker_model_->action()))); | 891 UTF16ToUTF8(picker_model_->action()))); |
| 889 picker_shown_ = true; | 892 picker_shown_ = true; |
| 890 } | 893 } |
| 891 | 894 |
| 892 void WebIntentPickerController::ClosePicker() { | 895 void WebIntentPickerController::ClosePicker() { |
| 893 SetDialogState(kPickerHidden); | 896 SetDialogState(kPickerHidden); |
| 894 if (picker_) | 897 if (picker_) |
| 895 picker_->Close(); | 898 picker_->Close(); |
| 896 } | 899 } |
| OLD | NEW |