| 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/panels/panel.h" | 5 #include "chrome/browser/ui/panels/panel.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 } | 812 } |
| 813 | 813 |
| 814 void Panel::UpdateAppIcon() { | 814 void Panel::UpdateAppIcon() { |
| 815 const extensions::Extension* extension = GetExtension(); | 815 const extensions::Extension* extension = GetExtension(); |
| 816 if (!extension) | 816 if (!extension) |
| 817 return; | 817 return; |
| 818 | 818 |
| 819 app_icon_loader_.reset(new ImageLoadingTracker(this)); | 819 app_icon_loader_.reset(new ImageLoadingTracker(this)); |
| 820 app_icon_loader_->LoadImage( | 820 app_icon_loader_->LoadImage( |
| 821 extension, | 821 extension, |
| 822 extension->GetIconResource(extension_misc::EXTENSION_ICON_SMALLISH, | 822 extension->GetIconResource(extension_misc::EXTENSION_ICON_SMALL, |
| 823 ExtensionIconSet::MATCH_BIGGER), | 823 ExtensionIconSet::MATCH_BIGGER), |
| 824 gfx::Size(extension_misc::EXTENSION_ICON_SMALLISH, | 824 gfx::Size(extension_misc::EXTENSION_ICON_SMALL, |
| 825 extension_misc::EXTENSION_ICON_SMALLISH), | 825 extension_misc::EXTENSION_ICON_SMALL), |
| 826 ImageLoadingTracker::CACHE); | 826 ImageLoadingTracker::CACHE); |
| 827 } | 827 } |
| 828 | 828 |
| 829 void Panel::OnImageLoaded(const gfx::Image& image, | 829 void Panel::OnImageLoaded(const gfx::Image& image, |
| 830 const std::string& extension_id, | 830 const std::string& extension_id, |
| 831 int index) { | 831 int index) { |
| 832 if (!image.IsEmpty()) { | 832 if (!image.IsEmpty()) { |
| 833 app_icon_ = image; | 833 app_icon_ = image; |
| 834 native_panel_->UpdatePanelTitleBar(); | 834 native_panel_->UpdatePanelTitleBar(); |
| 835 } | 835 } |
| 836 app_icon_loader_.reset(); | 836 app_icon_loader_.reset(); |
| 837 } | 837 } |
| OLD | NEW |