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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 picker_->SetActionString(GetIntentActionString( | 583 picker_->SetActionString(GetIntentActionString( |
584 UTF16ToUTF8(picker_model_->action()))); | 584 UTF16ToUTF8(picker_model_->action()))); |
585 } | 585 } |
586 | 586 |
587 void WebIntentPickerController::OnFaviconDataAvailable( | 587 void WebIntentPickerController::OnFaviconDataAvailable( |
588 FaviconService::Handle handle, history::FaviconData favicon_data) { | 588 FaviconService::Handle handle, history::FaviconData favicon_data) { |
589 size_t index = favicon_consumer_.GetClientDataForCurrentRequest(); | 589 size_t index = favicon_consumer_.GetClientDataForCurrentRequest(); |
590 if (favicon_data.is_valid()) { | 590 if (favicon_data.is_valid()) { |
591 SkBitmap icon_bitmap; | 591 SkBitmap icon_bitmap; |
592 | 592 |
593 if (gfx::PNGCodec::Decode(favicon_data.image_data->front(), | 593 history::FaviconDataElement element = favicon_data.elements[0]; |
594 favicon_data.image_data->size(), | 594 if (gfx::PNGCodec::Decode(element.bitmap_data->front(), |
| 595 element.bitmap_data->size(), |
595 &icon_bitmap)) { | 596 &icon_bitmap)) { |
596 gfx::Image icon_image(icon_bitmap); | 597 gfx::Image icon_image(icon_bitmap); |
597 picker_model_->UpdateFaviconAt(index, icon_image); | 598 picker_model_->UpdateFaviconAt(index, icon_image); |
598 return; | 599 return; |
599 } | 600 } |
600 } | 601 } |
601 | 602 |
602 AsyncOperationFinished(); | 603 AsyncOperationFinished(); |
603 } | 604 } |
604 | 605 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 // If picker is non-NULL, it was set by a test. | 768 // If picker is non-NULL, it was set by a test. |
768 if (picker_ == NULL) | 769 if (picker_ == NULL) |
769 picker_ = WebIntentPicker::Create(tab_contents_, this, picker_model_.get()); | 770 picker_ = WebIntentPicker::Create(tab_contents_, this, picker_model_.get()); |
770 picker_shown_ = true; | 771 picker_shown_ = true; |
771 } | 772 } |
772 | 773 |
773 void WebIntentPickerController::ClosePicker() { | 774 void WebIntentPickerController::ClosePicker() { |
774 if (picker_) | 775 if (picker_) |
775 picker_->Close(); | 776 picker_->Close(); |
776 } | 777 } |
OLD | NEW |