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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, history::FaviconData favicon_data) { |
582 size_t index = favicon_consumer_.GetClientDataForCurrentRequest(); | 582 size_t index = favicon_consumer_.GetClientDataForCurrentRequest(); |
583 if (favicon_data.is_valid()) { | 583 if (favicon_data.is_valid()) { |
584 SkBitmap icon_bitmap; | 584 SkBitmap icon_bitmap; |
585 | 585 |
586 if (gfx::PNGCodec::Decode(favicon_data.image_data->front(), | 586 const history::FaviconDataElement& element = favicon_data.elements[0]; |
587 favicon_data.image_data->size(), | 587 if (gfx::PNGCodec::Decode(element.bitmap_data->front(), |
| 588 element.bitmap_data->size(), |
588 &icon_bitmap)) { | 589 &icon_bitmap)) { |
589 gfx::Image icon_image(icon_bitmap); | 590 gfx::Image icon_image(icon_bitmap); |
590 picker_model_->UpdateFaviconAt(index, icon_image); | 591 picker_model_->UpdateFaviconAt(index, icon_image); |
591 return; | 592 return; |
592 } | 593 } |
593 } | 594 } |
594 | 595 |
595 AsyncOperationFinished(); | 596 AsyncOperationFinished(); |
596 } | 597 } |
597 | 598 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 picker_->SetActionString(GetIntentActionString( | 886 picker_->SetActionString(GetIntentActionString( |
886 UTF16ToUTF8(picker_model_->action()))); | 887 UTF16ToUTF8(picker_model_->action()))); |
887 picker_shown_ = true; | 888 picker_shown_ = true; |
888 } | 889 } |
889 | 890 |
890 void WebIntentPickerController::ClosePicker() { | 891 void WebIntentPickerController::ClosePicker() { |
891 SetDialogState(kPickerHidden); | 892 SetDialogState(kPickerHidden); |
892 if (picker_) | 893 if (picker_) |
893 picker_->Close(); | 894 picker_->Close(); |
894 } | 895 } |
OLD | NEW |