| 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 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/themes/theme_service.h" | 23 #include "chrome/browser/themes/theme_service.h" |
| 24 #include "chrome/browser/themes/theme_service_factory.h" | 24 #include "chrome/browser/themes/theme_service_factory.h" |
| 25 #include "chrome/browser/ui/panels/native_panel.h" | 25 #include "chrome/browser/ui/panels/native_panel.h" |
| 26 #include "chrome/browser/ui/panels/panel_collection.h" | 26 #include "chrome/browser/ui/panels/panel_collection.h" |
| 27 #include "chrome/browser/ui/panels/panel_host.h" | 27 #include "chrome/browser/ui/panels/panel_host.h" |
| 28 #include "chrome/browser/ui/panels/panel_manager.h" | 28 #include "chrome/browser/ui/panels/panel_manager.h" |
| 29 #include "chrome/browser/ui/panels/stacked_panel_collection.h" | 29 #include "chrome/browser/ui/panels/stacked_panel_collection.h" |
| 30 #include "chrome/browser/web_applications/web_app.h" | 30 #include "chrome/browser/web_applications/web_app.h" |
| 31 #include "chrome/common/chrome_notification_types.h" | 31 #include "chrome/common/chrome_notification_types.h" |
| 32 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 32 #include "chrome/common/extensions/extension.h" | 33 #include "chrome/common/extensions/extension.h" |
| 33 #include "content/public/browser/notification_service.h" | 34 #include "content/public/browser/notification_service.h" |
| 34 #include "content/public/browser/notification_source.h" | 35 #include "content/public/browser/notification_source.h" |
| 35 #include "content/public/browser/notification_types.h" | 36 #include "content/public/browser/notification_types.h" |
| 36 #include "content/public/browser/render_view_host.h" | 37 #include "content/public/browser/render_view_host.h" |
| 37 #include "content/public/browser/user_metrics.h" | 38 #include "content/public/browser/user_metrics.h" |
| 38 #include "content/public/browser/web_contents.h" | 39 #include "content/public/browser/web_contents.h" |
| 39 #include "ui/gfx/image/image.h" | 40 #include "ui/gfx/image/image.h" |
| 40 #include "ui/gfx/rect.h" | 41 #include "ui/gfx/rect.h" |
| 41 | 42 |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 } | 850 } |
| 850 | 851 |
| 851 void Panel::UpdateAppIcon() { | 852 void Panel::UpdateAppIcon() { |
| 852 const extensions::Extension* extension = GetExtension(); | 853 const extensions::Extension* extension = GetExtension(); |
| 853 if (!extension) | 854 if (!extension) |
| 854 return; | 855 return; |
| 855 | 856 |
| 856 extensions::ImageLoader* loader = extensions::ImageLoader::Get(profile()); | 857 extensions::ImageLoader* loader = extensions::ImageLoader::Get(profile()); |
| 857 loader->LoadImageAsync( | 858 loader->LoadImageAsync( |
| 858 extension, | 859 extension, |
| 859 extension->GetIconResource(extension_misc::EXTENSION_ICON_SMALL, | 860 extensions::IconsInfo::GetIconResource( |
| 860 ExtensionIconSet::MATCH_BIGGER), | 861 extension, |
| 862 extension_misc::EXTENSION_ICON_SMALL, |
| 863 ExtensionIconSet::MATCH_BIGGER), |
| 861 gfx::Size(extension_misc::EXTENSION_ICON_SMALL, | 864 gfx::Size(extension_misc::EXTENSION_ICON_SMALL, |
| 862 extension_misc::EXTENSION_ICON_SMALL), | 865 extension_misc::EXTENSION_ICON_SMALL), |
| 863 base::Bind(&Panel::OnImageLoaded, | 866 base::Bind(&Panel::OnImageLoaded, |
| 864 image_loader_ptr_factory_.GetWeakPtr())); | 867 image_loader_ptr_factory_.GetWeakPtr())); |
| 865 } | 868 } |
| 866 | 869 |
| 867 // static | 870 // static |
| 868 void Panel::FormatTitleForDisplay(string16* title) { | 871 void Panel::FormatTitleForDisplay(string16* title) { |
| 869 size_t current_index = 0; | 872 size_t current_index = 0; |
| 870 size_t match_index; | 873 size_t match_index; |
| 871 while ((match_index = title->find(L'\n', current_index)) != string16::npos) { | 874 while ((match_index = title->find(L'\n', current_index)) != string16::npos) { |
| 872 title->replace(match_index, 1, string16()); | 875 title->replace(match_index, 1, string16()); |
| 873 current_index = match_index; | 876 current_index = match_index; |
| 874 } | 877 } |
| 875 } | 878 } |
| OLD | NEW |