diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-09 19:32:22 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-09 19:32:22 +0000 |
commit | 0db486f96bc1d4a62d8e08f02d485247d860fa7a (patch) | |
tree | 6d144d758c7e6cece1e4bd2d6df3e4ec3787b6c9 | |
parent | e9307cd7e9de8a0581c765cf525501c464c90600 (diff) | |
download | chromium_src-0db486f96bc1d4a62d8e08f02d485247d860fa7a.zip chromium_src-0db486f96bc1d4a62d8e08f02d485247d860fa7a.tar.gz chromium_src-0db486f96bc1d4a62d8e08f02d485247d860fa7a.tar.bz2 |
Move extensions manifest IconsHandler to //extensions
Icon support is a general extension concept. This patch allows app_shell
(and eventually extension_protocol.cc) to use it.
BUG=361373
TEST=browser_tests *Extension*
TBR=sky@chromium.org for mechanical header file move across chrome
Review URL: https://codereview.chromium.org/229813002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262771 0039d316-1c4b-4281-b951-d872f2087c98
56 files changed, 139 insertions, 130 deletions
diff --git a/apps/app_window.cc b/apps/app_window.cc index 0ee51cc..5e872f5 100644 --- a/apps/app_window.cc +++ b/apps/app_window.cc @@ -20,7 +20,6 @@ #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" #include "chrome/browser/extensions/suggest_permission_util.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "components/web_modal/web_contents_modal_dialog_manager.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/invalidate_type.h" @@ -40,6 +39,7 @@ #include "extensions/browser/view_type_utils.h" #include "extensions/common/extension.h" #include "extensions/common/extension_messages.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "third_party/skia/include/core/SkRegion.h" #include "ui/gfx/screen.h" diff --git a/chrome/browser/background/background_application_list_model.cc b/chrome/browser/background/background_application_list_model.cc index 7409c0c..7ffb220 100644 --- a/chrome/browser/background/background_application_list_model.cc +++ b/chrome/browser/background/background_application_list_model.cc @@ -21,7 +21,6 @@ #include "chrome/browser/extensions/image_loader.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "extensions/browser/extension_prefs.h" @@ -32,6 +31,7 @@ #include "extensions/common/extension_resource.h" #include "extensions/common/extension_set.h" #include "extensions/common/manifest_handlers/background_info.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/permissions/permission_set.h" #include "ui/base/l10n/l10n_util_collator.h" #include "ui/gfx/image/image.h" diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc index ee28ac4..9dbe637a 100644 --- a/chrome/browser/background/background_contents_service.cc +++ b/chrome/browser/background/background_contents_service.cc @@ -33,7 +33,6 @@ #include "chrome/browser/ui/host_desktop.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/pref_names.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/site_instance.h" @@ -45,6 +44,7 @@ #include "extensions/common/extension_icon_set.h" #include "extensions/common/extension_set.h" #include "extensions/common/manifest_handlers/background_info.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "ipc/ipc_message.h" diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_data.cc b/chrome/browser/chromeos/app_mode/kiosk_app_data.cc index d97c75d..2efd3ae 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_data.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_data.cc @@ -24,11 +24,11 @@ #include "chrome/browser/image_decoder.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/browser_thread.h" #include "extensions/browser/extension_system.h" #include "extensions/common/manifest.h" #include "extensions/common/manifest_constants.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "ui/gfx/codec/png_codec.h" #include "ui/gfx/image/image.h" diff --git a/chrome/browser/chromeos/offline/offline_load_page.cc b/chrome/browser/chromeos/offline/offline_load_page.cc index 79a9190..0937b5d 100644 --- a/chrome/browser/chromeos/offline/offline_load_page.cc +++ b/chrome/browser/chromeos/offline/offline_load_page.cc @@ -22,7 +22,6 @@ #include "chrome/browser/renderer_preferences_util.h" #include "chrome/browser/tab_contents/tab_util.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/localized_error.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" @@ -33,6 +32,7 @@ #include "extensions/browser/extension_system.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc index 1440f33..7657899 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc @@ -40,7 +40,6 @@ #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" #include "chrome/common/extensions/api/developer_private.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/extensions/manifest_url_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" @@ -61,6 +60,7 @@ #include "extensions/common/extension_set.h" #include "extensions/common/install_warning.h" #include "extensions/common/manifest_handlers/background_info.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/manifest_handlers/incognito_info.h" #include "extensions/common/manifest_handlers/offline_enabled_info.h" #include "extensions/common/switches.h" diff --git a/chrome/browser/extensions/api/management/management_api.cc b/chrome/browser/extensions/api/management/management_api.cc index 11ee846..c4473fd 100644 --- a/chrome/browser/extensions/api/management/management_api.cc +++ b/chrome/browser/extensions/api/management/management_api.cc @@ -31,7 +31,6 @@ #include "chrome/common/extensions/api/management.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/extensions/manifest_url_handler.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" @@ -45,6 +44,7 @@ #include "extensions/common/error_utils.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/manifest_handlers/offline_enabled_info.h" #include "extensions/common/permissions/permission_set.h" #include "extensions/common/permissions/permissions_data.h" diff --git a/chrome/browser/extensions/app_icon_loader_impl.cc b/chrome/browser/extensions/app_icon_loader_impl.cc index 62aad03..99e8f49 100644 --- a/chrome/browser/extensions/app_icon_loader_impl.cc +++ b/chrome/browser/extensions/app_icon_loader_impl.cc @@ -9,9 +9,9 @@ #include "chrome/browser/extensions/extension_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "extensions/browser/extension_system.h" #include "extensions/common/extension.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/image/image_skia_operations.h" diff --git a/chrome/browser/extensions/bookmark_app_helper.cc b/chrome/browser/extensions/bookmark_app_helper.cc index c08faf4..476faa2 100644 --- a/chrome/browser/extensions/bookmark_app_helper.cc +++ b/chrome/browser/extensions/bookmark_app_helper.cc @@ -12,11 +12,11 @@ #include "chrome/browser/extensions/tab_helper.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/web_contents.h" #include "extensions/common/extension.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/url_pattern.h" #include "skia/ext/image_operations.h" #include "skia/ext/platform_canvas.h" diff --git a/chrome/browser/extensions/bookmark_app_helper_unittest.cc b/chrome/browser/extensions/bookmark_app_helper_unittest.cc index 6f5f9b4..4c4ef21 100644 --- a/chrome/browser/extensions/bookmark_app_helper_unittest.cc +++ b/chrome/browser/extensions/bookmark_app_helper_unittest.cc @@ -7,10 +7,10 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/extensions/extension_service_unittest.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/test/base/testing_profile.h" #include "extensions/browser/extension_registry.h" #include "extensions/common/extension_icon_set.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkBitmap.h" diff --git a/chrome/browser/extensions/convert_web_app_browsertest.cc b/chrome/browser/extensions/convert_web_app_browsertest.cc index 0ab8937..888cade 100644 --- a/chrome/browser/extensions/convert_web_app_browsertest.cc +++ b/chrome/browser/extensions/convert_web_app_browsertest.cc @@ -12,7 +12,6 @@ #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/test_switches.h" #include "chrome/test/base/ui_test_utils.h" @@ -24,6 +23,7 @@ #include "content/public/test/browser_test_utils.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/permissions/permission_set.h" namespace extensions { diff --git a/chrome/browser/extensions/convert_web_app_unittest.cc b/chrome/browser/extensions/convert_web_app_unittest.cc index 964fdb4..b8be22f 100644 --- a/chrome/browser/extensions/convert_web_app_unittest.cc +++ b/chrome/browser/extensions/convert_web_app_unittest.cc @@ -17,11 +17,11 @@ #include "base/version.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/web_application_info.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" #include "extensions/common/extension_resource.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/permissions/permission_set.h" #include "extensions/common/url_pattern.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/extensions/extension_action.cc b/chrome/browser/extensions/extension_action.cc index c7d23ed..ddf8d4f 100644 --- a/chrome/browser/extensions/extension_action.cc +++ b/chrome/browser/extensions/extension_action.cc @@ -58,6 +58,7 @@ bool HasValue(const std::map<int, T>& map, int tab_id) { } // namespace const int ExtensionAction::kDefaultTabId = -1; +const int ExtensionAction::kPageActionIconMaxSize = 19; ExtensionAction::ExtensionAction(const std::string& extension_id, extensions::ActionInfo::Type action_type, diff --git a/chrome/browser/extensions/extension_action.h b/chrome/browser/extensions/extension_action.h index 82b8188..999102f 100644 --- a/chrome/browser/extensions/extension_action.h +++ b/chrome/browser/extensions/extension_action.h @@ -42,6 +42,9 @@ class ExtensionAction { // parameter. static const int kDefaultTabId; + // Max size (both dimensions) for page actions. + static const int kPageActionIconMaxSize; + ExtensionAction(const std::string& extension_id, extensions::ActionInfo::Type action_type, const extensions::ActionInfo& manifest_data); diff --git a/chrome/browser/extensions/extension_disabled_ui.cc b/chrome/browser/extensions/extension_disabled_ui.cc index d600e71..b264adb 100644 --- a/chrome/browser/extensions/extension_disabled_ui.cc +++ b/chrome/browser/extensions/extension_disabled_ui.cc @@ -26,13 +26,13 @@ #include "chrome/browser/ui/global_error/global_error_service.h" #include "chrome/browser/ui/global_error/global_error_service_factory.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_source.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/permissions/permission_message_provider.h" #include "extensions/common/permissions/permission_set.h" #include "grit/chromium_strings.h" diff --git a/chrome/browser/extensions/extension_icon_image_unittest.cc b/chrome/browser/extensions/extension_icon_image_unittest.cc index 53bda30..ddf3a83 100644 --- a/chrome/browser/extensions/extension_icon_image_unittest.cc +++ b/chrome/browser/extensions/extension_icon_image_unittest.cc @@ -10,11 +10,11 @@ #include "chrome/browser/extensions/image_loader.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/test/base/testing_profile.h" #include "content/public/test/test_browser_thread.h" #include "extensions/common/extension.h" #include "extensions/common/manifest.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/theme_resources.h" #include "skia/ext/image_operations.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/extensions/extension_icon_manager.cc b/chrome/browser/extensions/extension_icon_manager.cc index ccdf6b7..82c48281 100644 --- a/chrome/browser/extensions/extension_icon_manager.cc +++ b/chrome/browser/extensions/extension_icon_manager.cc @@ -8,11 +8,11 @@ #include "base/logging.h" #include "base/stl_util.h" #include "chrome/browser/extensions/image_loader.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" #include "extensions/common/extension_resource.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/theme_resources.h" #include "skia/ext/image_operations.h" #include "ui/base/resource/resource_bundle.h" diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc index 1614368..4f0ef54 100644 --- a/chrome/browser/extensions/extension_install_prompt.cc +++ b/chrome/browser/extensions/extension_install_prompt.cc @@ -22,7 +22,6 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/api/identity/oauth2_manifest_handler.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/pref_names.h" #include "components/signin/core/browser/profile_oauth2_token_service.h" #include "content/public/browser/web_contents.h" @@ -34,6 +33,7 @@ #include "extensions/common/feature_switch.h" #include "extensions/common/manifest.h" #include "extensions/common/manifest_constants.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/permissions/permission_message_provider.h" #include "extensions/common/permissions/permission_set.h" #include "extensions/common/permissions/permissions_data.h" diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc index e3e9865..84299af 100644 --- a/chrome/browser/extensions/extension_protocols.cc +++ b/chrome/browser/extensions/extension_protocols.cc @@ -28,7 +28,6 @@ #include "chrome/browser/extensions/extension_renderer_state.h" #include "chrome/browser/extensions/image_loader.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/extensions/manifest_url_handler.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" @@ -40,6 +39,7 @@ #include "extensions/common/file_util.h" #include "extensions/common/manifest_handlers/background_info.h" #include "extensions/common/manifest_handlers/csp_info.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/manifest_handlers/incognito_info.h" #include "extensions/common/manifest_handlers/shared_module_info.h" #include "extensions/common/manifest_handlers/web_accessible_resources_info.h" diff --git a/chrome/browser/extensions/extension_storage_monitor.cc b/chrome/browser/extensions/extension_storage_monitor.cc index fbc17343..a5ddf47 100644 --- a/chrome/browser/extensions/extension_storage_monitor.cc +++ b/chrome/browser/extensions/extension_storage_monitor.cc @@ -14,7 +14,6 @@ #include "chrome/browser/extensions/extension_util.h" #include "chrome/browser/extensions/image_loader.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_details.h" @@ -23,6 +22,7 @@ #include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_registry.h" #include "extensions/common/extension.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" #include "ui/message_center/message_center.h" diff --git a/chrome/browser/extensions/extension_uninstall_dialog.cc b/chrome/browser/extensions/extension_uninstall_dialog.cc index 31aef19..dc792e2 100644 --- a/chrome/browser/extensions/extension_uninstall_dialog.cc +++ b/chrome/browser/extensions/extension_uninstall_dialog.cc @@ -12,13 +12,13 @@ #include "chrome/browser/extensions/image_loader.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" #include "extensions/common/extension_resource.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc index 45deef9..2510e45 100644 --- a/chrome/browser/extensions/extension_web_ui.cc +++ b/chrome/browser/extensions/extension_web_ui.cc @@ -21,7 +21,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/url_constants.h" #include "components/user_prefs/pref_registry_syncable.h" #include "content/public/browser/navigation_controller.h" @@ -33,6 +32,7 @@ #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" #include "extensions/common/extension_resource.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/manifest_handlers/incognito_info.h" #include "net/base/file_stream.h" #include "third_party/skia/include/core/SkBitmap.h" diff --git a/chrome/browser/extensions/image_loader_unittest.cc b/chrome/browser/extensions/image_loader_unittest.cc index 07a8317..ffede70 100644 --- a/chrome/browser/extensions/image_loader_unittest.cc +++ b/chrome/browser/extensions/image_loader_unittest.cc @@ -9,7 +9,6 @@ #include "base/path_service.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/notification_service.h" #include "content/public/test/test_browser_thread.h" #include "extensions/common/constants.h" @@ -17,6 +16,7 @@ #include "extensions/common/extension_icon_set.h" #include "extensions/common/extension_resource.h" #include "extensions/common/manifest.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/component_extension_resources.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkBitmap.h" diff --git a/chrome/browser/extensions/sandboxed_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc index c595e92..ddc701e 100644 --- a/chrome/browser/extensions/sandboxed_unpacker.cc +++ b/chrome/browser/extensions/sandboxed_unpacker.cc @@ -25,7 +25,6 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_utility_messages.h" #include "chrome/common/extensions/extension_file_util.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/utility_process_host.h" #include "content/public/common/common_param_traits.h" @@ -36,6 +35,7 @@ #include "extensions/common/extension_l10n_util.h" #include "extensions/common/id_util.h" #include "extensions/common/manifest_constants.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/generated_resources.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc index 39d259b..b18d34a 100644 --- a/chrome/browser/extensions/tab_helper.cc +++ b/chrome/browser/extensions/tab_helper.cc @@ -39,7 +39,6 @@ #include "chrome/common/extensions/chrome_extension_messages.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/render_messages.h" #include "chrome/common/url_constants.h" #include "content/public/browser/invalidate_type.h" @@ -64,6 +63,7 @@ #include "extensions/common/extension_resource.h" #include "extensions/common/extension_urls.h" #include "extensions/common/feature_switch.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #if defined(OS_CHROMEOS) #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" diff --git a/chrome/browser/ui/app_list/extension_app_item.cc b/chrome/browser/ui/app_list/extension_app_item.cc index cb2ca65..530af6e 100644 --- a/chrome/browser/ui/app_list/extension_app_item.cc +++ b/chrome/browser/ui/app_list/extension_app_item.cc @@ -18,7 +18,6 @@ #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/extensions/manifest_url_handler.h" #include "content/public/browser/user_metrics.h" #include "extensions/browser/app_sorting.h" @@ -26,6 +25,7 @@ #include "extensions/browser/extension_system.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/theme_resources.h" #include "sync/api/string_ordinal.h" #include "ui/base/resource/resource_bundle.h" diff --git a/chrome/browser/ui/app_list/search/app_result.cc b/chrome/browser/ui/app_list/search/app_result.cc index 6f96f6e..7b4a190 100644 --- a/chrome/browser/ui/app_list/search/app_result.cc +++ b/chrome/browser/ui/app_list/search/app_result.cc @@ -15,13 +15,13 @@ #include "chrome/browser/ui/app_list/search/tokenized_string_match.h" #include "chrome/browser/ui/extensions/extension_enable_flow.h" #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/user_metrics.h" #include "extensions/browser/extension_system.h" #include "extensions/browser/extension_system_provider.h" #include "extensions/browser/extensions_browser_client.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/image/image_skia_operations.h" diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc index 56e1689..bdfb818 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc @@ -63,7 +63,6 @@ #include "chrome/browser/web_applications/web_app.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/public/browser/navigation_entry.h" @@ -74,6 +73,7 @@ #include "extensions/browser/extension_system.h" #include "extensions/common/extension.h" #include "extensions/common/extension_resource.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/url_pattern.h" #include "grit/ash_resources.h" #include "grit/chromium_strings.h" diff --git a/chrome/browser/ui/cocoa/infobars/extension_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/extension_infobar_controller.mm index 0790e26..34b5feb 100644 --- a/chrome/browser/ui/cocoa/infobars/extension_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/extension_infobar_controller.mm @@ -16,13 +16,13 @@ #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu_controller.h" #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" #import "chrome/browser/ui/cocoa/menu_button.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" #include "extensions/common/extension_resource.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/theme_resources.h" #include "skia/ext/skia_utils_mac.h" #include "ui/base/resource/resource_bundle.h" diff --git a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm index 1ce936e..f0af376 100644 --- a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm +++ b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm @@ -23,9 +23,9 @@ #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" #include "chrome/browser/ui/omnibox/location_bar_util.h" #include "chrome/browser/ui/webui/extensions/extension_info_ui.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/web_contents.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "skia/ext/skia_utils_mac.h" #include "ui/gfx/canvas_skia_paint.h" #include "ui/gfx/image/image.h" @@ -75,7 +75,7 @@ PageActionDecoration::~PageActionDecoration() {} // Always |kPageActionIconMaxSize| wide. |ImageDecoration| draws the // image centered. CGFloat PageActionDecoration::GetWidthForSpace(CGFloat width) { - return extensions::IconsInfo::kPageActionIconMaxSize; + return ExtensionAction::kPageActionIconMaxSize; } bool PageActionDecoration::AcceptsMousePress() { @@ -153,8 +153,8 @@ void PageActionDecoration::UpdateVisibility(WebContents* contents, SetImage(icon.ToNSImage()); } else if (!GetImage()) { const NSSize default_size = NSMakeSize( - extensions::IconsInfo::kPageActionIconMaxSize, - extensions::IconsInfo::kPageActionIconMaxSize); + ExtensionAction::kPageActionIconMaxSize, + ExtensionAction::kPageActionIconMaxSize); SetImage([[[NSImage alloc] initWithSize:default_size] autorelease]); } } @@ -188,7 +188,7 @@ NSPoint PageActionDecoration::GetBubblePointInFrame(NSRect frame) { // easier (the middle of the centered image is the middle of the // frame). const CGFloat delta_height = - NSHeight(frame) - extensions::IconsInfo::kPageActionIconMaxSize; + NSHeight(frame) - ExtensionAction::kPageActionIconMaxSize; const CGFloat bottom_inset = std::ceil(delta_height / 2.0); // Return a point just below the bottom of the maximal drawing area. diff --git a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc index 736c36f..0af7280 100644 --- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc @@ -19,11 +19,11 @@ #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" #include "chrome/browser/web_applications/web_app.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "extensions/common/extension.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" diff --git a/chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc b/chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc index e7ee643..260e487 100644 --- a/chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc +++ b/chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc @@ -14,13 +14,13 @@ #include "chrome/browser/ui/gtk/gtk_chrome_button.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/browser/ui/gtk/infobars/infobar_container_gtk.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host_view.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" #include "extensions/common/extension_resource.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/theme_resources.h" #include "ui/base/gtk/gtk_signal_registrar.h" #include "ui/base/resource/resource_bundle.h" diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc index e8fa487..a27280d 100644 --- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc @@ -72,13 +72,13 @@ #include "chrome/browser/ui/zoom/zoom_controller.h" #include "chrome/common/badge_util.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/pref_names.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/web_contents.h" #include "extensions/common/extension.h" #include "extensions/common/feature_switch.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "net/base/net_util.h" @@ -1721,8 +1721,8 @@ LocationBarViewGtk::PageActionViewGtk::PageActionViewGtk( preview_enabled_(false) { event_box_.Own(gtk_event_box_new()); gtk_widget_set_size_request(event_box_.get(), - extensions::IconsInfo::kPageActionIconMaxSize, - extensions::IconsInfo::kPageActionIconMaxSize); + ExtensionAction::kPageActionIconMaxSize, + ExtensionAction::kPageActionIconMaxSize); // Make the event box not visible so it does not paint a background. gtk_event_box_set_visible_window(GTK_EVENT_BOX(event_box_.get()), FALSE); diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc index c151739..c49a5c2 100644 --- a/chrome/browser/ui/panels/panel.cc +++ b/chrome/browser/ui/panels/panel.cc @@ -28,7 +28,6 @@ #include "chrome/browser/ui/panels/panel_manager.h" #include "chrome/browser/ui/panels/stacked_panel_collection.h" #include "chrome/browser/web_applications/web_app.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" @@ -37,6 +36,7 @@ #include "content/public/browser/web_contents.h" #include "extensions/browser/extension_system.h" #include "extensions/common/extension.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "ui/gfx/image/image.h" #include "ui/gfx/rect.h" diff --git a/chrome/browser/ui/toolbar/origin_chip_info.cc b/chrome/browser/ui/toolbar/origin_chip_info.cc index c675fe5..7506cd3 100644 --- a/chrome/browser/ui/toolbar/origin_chip_info.cc +++ b/chrome/browser/ui/toolbar/origin_chip_info.cc @@ -14,12 +14,12 @@ #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" #include "chrome/browser/ui/toolbar/toolbar_model.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/public/browser/web_contents.h" #include "extensions/browser/extension_system.h" #include "extensions/common/constants.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/chromium_strings.h" #include "grit/component_strings.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_tab.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_tab.cc index bbb038c..b8706e3 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_tab.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_tab.cc @@ -16,11 +16,11 @@ #include "chrome/browser/ui/browser_navigator.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/extensions/manifest_url_handler.h" #include "extensions/browser/extension_system.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/generated_resources.h" #include "net/base/url_util.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/ui/views/infobars/extension_infobar.cc b/chrome/browser/ui/views/infobars/extension_infobar.cc index 25cff81..bb29708 100644 --- a/chrome/browser/ui/views/infobars/extension_infobar.cc +++ b/chrome/browser/ui/views/infobars/extension_infobar.cc @@ -10,11 +10,11 @@ #include "chrome/browser/extensions/image_loader.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/ui/views/frame/browser_view.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" #include "extensions/common/extension_resource.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/theme_resources.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/animation/slide_animation.h" diff --git a/chrome/browser/ui/views/location_bar/origin_chip_view.cc b/chrome/browser/ui/views/location_bar/origin_chip_view.cc index 07072ce..b841e95 100644 --- a/chrome/browser/ui/views/location_bar/origin_chip_view.cc +++ b/chrome/browser/ui/views/location_bar/origin_chip_view.cc @@ -24,12 +24,12 @@ #include "chrome/browser/ui/toolbar/toolbar_model.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents.h" #include "content/public/common/url_constants.h" #include "extensions/browser/extension_system.h" #include "extensions/common/constants.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/ui/views/location_bar/page_action_with_badge_view.cc b/chrome/browser/ui/views/location_bar/page_action_with_badge_view.cc index fa761fa..93a281f 100644 --- a/chrome/browser/ui/views/location_bar/page_action_with_badge_view.cc +++ b/chrome/browser/ui/views/location_bar/page_action_with_badge_view.cc @@ -4,9 +4,9 @@ #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" +#include "chrome/browser/extensions/extension_action.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "ui/accessibility/ax_view_state.h" using content::WebContents; @@ -24,8 +24,8 @@ void PageActionWithBadgeView::GetAccessibleState( } gfx::Size PageActionWithBadgeView::GetPreferredSize() { - return gfx::Size(extensions::IconsInfo::kPageActionIconMaxSize, - extensions::IconsInfo::kPageActionIconMaxSize); + return gfx::Size(ExtensionAction::kPageActionIconMaxSize, + ExtensionAction::kPageActionIconMaxSize); } void PageActionWithBadgeView::Layout() { diff --git a/chrome/browser/ui/views/toolbar/toolbar_origin_chip_view.cc b/chrome/browser/ui/views/toolbar/toolbar_origin_chip_view.cc index 7fb18d0..5a97d72 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_origin_chip_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_origin_chip_view.cc @@ -25,7 +25,6 @@ #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/toolbar/toolbar_view.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/user_metrics.h" @@ -33,6 +32,7 @@ #include "content/public/common/url_constants.h" #include "extensions/browser/extension_system.h" #include "extensions/common/constants.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/ui/webui/extensions/extension_icon_source.cc b/chrome/browser/ui/webui/extensions/extension_icon_source.cc index 224ddd3..ad54869 100644 --- a/chrome/browser/ui/webui/extensions/extension_icon_source.cc +++ b/chrome/browser/ui/webui/extensions/extension_icon_source.cc @@ -19,12 +19,12 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/url_constants.h" #include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_system.h" #include "extensions/common/extension.h" #include "extensions/common/extension_resource.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/component_extension_resources_map.h" #include "grit/theme_resources.h" #include "skia/ext/image_operations.h" diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc index c31ccb7..fe07e15 100644 --- a/chrome/browser/web_applications/web_app.cc +++ b/chrome/browser/web_applications/web_app.cc @@ -19,12 +19,12 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/theme_resources.h" #include "skia/ext/image_operations.h" #include "third_party/skia/include/core/SkBitmap.h" diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index 8d03eaa..d6608c7 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -179,8 +179,6 @@ 'common/extensions/manifest_handlers/content_scripts_handler.h', 'common/extensions/manifest_handlers/externally_connectable.cc', 'common/extensions/manifest_handlers/externally_connectable.h', - 'common/extensions/manifest_handlers/icons_handler.cc', - 'common/extensions/manifest_handlers/icons_handler.h', 'common/extensions/manifest_handlers/minimum_chrome_version_checker.cc', 'common/extensions/manifest_handlers/minimum_chrome_version_checker.h', 'common/extensions/manifest_handlers/nacl_modules_handler.cc', diff --git a/chrome/common/extensions/api/extension_action/browser_action_handler.cc b/chrome/common/extensions/api/extension_action/browser_action_handler.cc index fdbf489..35bc0a6 100644 --- a/chrome/common/extensions/api/extension_action/browser_action_handler.cc +++ b/chrome/common/extensions/api/extension_action/browser_action_handler.cc @@ -7,9 +7,9 @@ #include "base/memory/scoped_ptr.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" -#include "chrome/common/extensions/extension_file_util.h" #include "extensions/common/extension.h" #include "extensions/common/feature_switch.h" +#include "extensions/common/file_util.h" #include "extensions/common/manifest.h" #include "extensions/common/manifest_constants.h" #include "grit/generated_resources.h" @@ -46,7 +46,7 @@ bool BrowserActionHandler::Validate( std::vector<InstallWarning>* warnings) const { const ActionInfo* action = ActionInfo::GetBrowserActionInfo(extension); if (action && !action->default_icon.empty() && - !extension_file_util::ValidateExtensionIconSet( + !file_util::ValidateExtensionIconSet( action->default_icon, extension, IDS_EXTENSION_LOAD_ICON_FOR_BROWSER_ACTION_FAILED, diff --git a/chrome/common/extensions/api/extension_action/page_action_handler.cc b/chrome/common/extensions/api/extension_action/page_action_handler.cc index a9d2ea8..6c4a3b2 100644 --- a/chrome/common/extensions/api/extension_action/page_action_handler.cc +++ b/chrome/common/extensions/api/extension_action/page_action_handler.cc @@ -7,8 +7,8 @@ #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/extension_file_util.h" #include "extensions/common/extension.h" +#include "extensions/common/file_util.h" #include "extensions/common/manifest_constants.h" #include "grit/generated_resources.h" @@ -79,7 +79,7 @@ bool PageActionHandler::Validate(const Extension* extension, const extensions::ActionInfo* action = extensions::ActionInfo::GetPageActionInfo(extension); if (action && !action->default_icon.empty() && - !extension_file_util::ValidateExtensionIconSet( + !file_util::ValidateExtensionIconSet( action->default_icon, extension, IDS_EXTENSION_LOAD_ICON_FOR_PAGE_ACTION_FAILED, diff --git a/chrome/common/extensions/chrome_manifest_handlers.cc b/chrome/common/extensions/chrome_manifest_handlers.cc index 167499e..877756c 100644 --- a/chrome/common/extensions/chrome_manifest_handlers.cc +++ b/chrome/common/extensions/chrome_manifest_handlers.cc @@ -28,7 +28,6 @@ #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" #include "chrome/common/extensions/manifest_handlers/content_scripts_handler.h" #include "chrome/common/extensions/manifest_handlers/externally_connectable.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.h" #include "chrome/common/extensions/manifest_handlers/nacl_modules_handler.h" #include "chrome/common/extensions/manifest_handlers/settings_overrides_handler.h" @@ -37,6 +36,7 @@ #include "chrome/common/extensions/manifest_url_handler.h" #include "chrome/common/extensions/mime_types_handler.h" #include "extensions/common/api/sockets/sockets_manifest_handler.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/manifest_handlers/requirements_info.h" namespace extensions { diff --git a/chrome/common/extensions/extension_file_util.cc b/chrome/common/extensions/extension_file_util.cc index fa7426b..89d2e00 100644 --- a/chrome/common/extensions/extension_file_util.cc +++ b/chrome/common/extensions/extension_file_util.cc @@ -15,11 +15,9 @@ #include "base/metrics/histogram.h" #include "base/path_service.h" #include "base/strings/stringprintf.h" -#include "base/strings/utf_string_conversions.h" #include "base/threading/thread_restrictions.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/api/extension_action/action_info.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/extensions/manifest_handlers/theme_handler.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" @@ -31,6 +29,7 @@ #include "extensions/common/manifest.h" #include "extensions/common/manifest_constants.h" #include "extensions/common/manifest_handler.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/generated_resources.h" #include "net/base/file_stream.h" #include "ui/base/l10n/l10n_util.h" @@ -223,35 +222,6 @@ std::vector<base::FilePath> FindPrivateKeyFiles( return result; } -bool ValidateFilePath(const base::FilePath& path) { - int64 size = 0; - if (!base::PathExists(path) || - !base::GetFileSize(path, &size) || - size == 0) { - return false; - } - - return true; -} - -bool ValidateExtensionIconSet(const ExtensionIconSet& icon_set, - const Extension* extension, - int error_message_id, - std::string* error) { - for (ExtensionIconSet::IconMap::const_iterator iter = icon_set.map().begin(); - iter != icon_set.map().end(); - ++iter) { - const base::FilePath path = - extension->GetResource(iter->second).GetFilePath(); - if (!ValidateFilePath(path)) { - *error = l10n_util::GetStringFUTF8(error_message_id, - base::UTF8ToUTF16(iter->second)); - return false; - } - } - return true; -} - bool ValidateExtension(const Extension* extension, std::string* error, std::vector<extensions::InstallWarning>* warnings) { diff --git a/chrome/common/extensions/extension_file_util.h b/chrome/common/extensions/extension_file_util.h index 4a94687..7855135 100644 --- a/chrome/common/extensions/extension_file_util.h +++ b/chrome/common/extensions/extension_file_util.h @@ -12,8 +12,6 @@ #include "base/memory/ref_counted.h" #include "extensions/common/manifest.h" -class ExtensionIconSet; - namespace base { class DictionaryValue; class FilePath; @@ -62,16 +60,6 @@ scoped_refptr<extensions::Extension> LoadExtension( base::DictionaryValue* LoadManifest(const base::FilePath& extension_root, std::string* error); -// Returns true if the given file path exists and is not zero-length. -bool ValidateFilePath(const base::FilePath& path); - -// Returns true if the icons in the icon set exist. Oherwise, populates -// |error| with the |error_message_id| for an invalid file. -bool ValidateExtensionIconSet(const ExtensionIconSet& icon_set, - const extensions::Extension* extension, - int error_message_id, - std::string* error); - // Returns true if the given extension object is valid and consistent. // May also append a series of warning messages to |warnings|, but they // should not prevent the extension from running. diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_icons_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_icons_unittest.cc index 8338713..e827559 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_icons_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_icons_unittest.cc @@ -3,11 +3,11 @@ // found in the LICENSE file. #include "base/memory/linked_ptr.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/extension_icon_set.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "testing/gtest/include/gtest/gtest.h" namespace extensions { diff --git a/chrome/common/localized_error.cc b/chrome/common/localized_error.cc index 85845f8..0b042a9 100644 --- a/chrome/common/localized_error.cc +++ b/chrome/common/localized_error.cc @@ -11,10 +11,10 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/net/net_error_info.h" #include "extensions/common/constants.h" #include "extensions/common/extension_icon_set.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "net/base/escape.h" diff --git a/chrome/renderer/extensions/resource_request_policy.cc b/chrome/renderer/extensions/resource_request_policy.cc index cdce6f0..3766c7c 100644 --- a/chrome/renderer/extensions/resource_request_policy.cc +++ b/chrome/renderer/extensions/resource_request_policy.cc @@ -8,13 +8,13 @@ #include "base/logging.h" #include "base/strings/stringprintf.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" #include "chrome/common/extensions/manifest_url_handler.h" #include "chrome/common/url_constants.h" #include "content/public/common/page_transition_types.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/extension_set.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/manifest_handlers/web_accessible_resources_info.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/web/WebConsoleMessage.h" diff --git a/extensions/common/file_util.cc b/extensions/common/file_util.cc index 79d6792..377763f 100644 --- a/extensions/common/file_util.cc +++ b/extensions/common/file_util.cc @@ -11,8 +11,12 @@ #include "base/file_util.h" #include "base/files/file_path.h" #include "base/memory/scoped_ptr.h" +#include "base/strings/utf_string_conversions.h" #include "extensions/common/constants.h" +#include "extensions/common/extension.h" +#include "extensions/common/extension_icon_set.h" #include "extensions/common/extension_l10n_util.h" +#include "extensions/common/message_bundle.h" #include "grit/generated_resources.h" #include "net/base/escape.h" #include "ui/base/l10n/l10n_util.h" @@ -20,6 +24,21 @@ namespace extensions { namespace file_util { +namespace { + +// Returns true if the given file path exists and is not zero-length. +bool ValidateFilePath(const base::FilePath& path) { + int64 size = 0; + if (!base::PathExists(path) || + !base::GetFileSize(path, &size) || + size == 0) { + return false; + } + + return true; +} + +} // namespace base::FilePath ExtensionURLToRelativeFilePath(const GURL& url) { std::string url_path = url.path(); @@ -64,6 +83,24 @@ base::FilePath ExtensionResourceURLToFilePath(const GURL& url, return path; } +bool ValidateExtensionIconSet(const ExtensionIconSet& icon_set, + const Extension* extension, + int error_message_id, + std::string* error) { + for (ExtensionIconSet::IconMap::const_iterator iter = icon_set.map().begin(); + iter != icon_set.map().end(); + ++iter) { + const base::FilePath path = + extension->GetResource(iter->second).GetFilePath(); + if (!ValidateFilePath(path)) { + *error = l10n_util::GetStringFUTF8(error_message_id, + base::UTF8ToUTF16(iter->second)); + return false; + } + } + return true; +} + MessageBundle* LoadMessageBundle( const base::FilePath& extension_path, const std::string& default_locale, @@ -95,12 +132,12 @@ MessageBundle* LoadMessageBundle( return message_bundle; } -MessageBundle::SubstitutionMap* LoadMessageBundleSubstitutionMap( +std::map<std::string, std::string>* LoadMessageBundleSubstitutionMap( const base::FilePath& extension_path, const std::string& extension_id, const std::string& default_locale) { - MessageBundle::SubstitutionMap* returnValue = - new MessageBundle::SubstitutionMap(); + std::map<std::string, std::string>* return_value = + new std::map<std::string, std::string>(); if (!default_locale.empty()) { // Touch disk only if extension is localized. std::string error; @@ -108,15 +145,15 @@ MessageBundle::SubstitutionMap* LoadMessageBundleSubstitutionMap( LoadMessageBundle(extension_path, default_locale, &error)); if (bundle.get()) - *returnValue = *bundle->dictionary(); + *return_value = *bundle->dictionary(); } // Add @@extension_id reserved message here, so it's available to // non-localized extensions too. - returnValue->insert( + return_value->insert( std::make_pair(MessageBundle::kExtensionIdKey, extension_id)); - return returnValue; + return return_value; } } // namespace file_util diff --git a/extensions/common/file_util.h b/extensions/common/file_util.h index 3113745..770dd75 100644 --- a/extensions/common/file_util.h +++ b/extensions/common/file_util.h @@ -5,10 +5,10 @@ #ifndef EXTENSIONS_COMMON_FILE_UTIL_H_ #define EXTENSIONS_COMMON_FILE_UTIL_H_ +#include <map> #include <string> -#include "extensions/common/message_bundle.h" - +class ExtensionIconSet; class GURL; namespace base { @@ -16,6 +16,9 @@ class FilePath; } namespace extensions { +class Extension; +class MessageBundle; + namespace file_util { // Get a relative file path from a chrome-extension:// URL. @@ -26,6 +29,13 @@ base::FilePath ExtensionURLToRelativeFilePath(const GURL& url); base::FilePath ExtensionResourceURLToFilePath(const GURL& url, const base::FilePath& root); +// Returns true if the icons in the icon set exist. Oherwise, populates +// |error| with the |error_message_id| for an invalid file. +bool ValidateExtensionIconSet(const ExtensionIconSet& icon_set, + const Extension* extension, + int error_message_id, + std::string* error); + // Loads extension message catalogs and returns message bundle. // Returns NULL on error or if the extension is not localized. MessageBundle* LoadMessageBundle(const base::FilePath& extension_path, @@ -34,7 +44,7 @@ MessageBundle* LoadMessageBundle(const base::FilePath& extension_path, // Loads the extension message bundle substitution map. Contains at least // the extension_id item. -MessageBundle::SubstitutionMap* LoadMessageBundleSubstitutionMap( +std::map<std::string, std::string>* LoadMessageBundleSubstitutionMap( const base::FilePath& extension_path, const std::string& extension_id, const std::string& default_locale); diff --git a/chrome/common/extensions/manifest_handlers/icons_handler.cc b/extensions/common/manifest_handlers/icons_handler.cc index ee38952..1bddabb 100644 --- a/chrome/common/extensions/manifest_handlers/icons_handler.cc +++ b/extensions/common/manifest_handlers/icons_handler.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/extensions/manifest_handlers/icons_handler.h" +#include "extensions/common/manifest_handlers/icons_handler.h" #include "base/file_util.h" #include "base/lazy_instance.h" @@ -10,14 +10,13 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" -#include "chrome/common/extensions/extension_file_util.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" +#include "extensions/common/file_util.h" #include "extensions/common/manifest_constants.h" #include "extensions/common/manifest_handler_helpers.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" -#include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/size.h" @@ -28,9 +27,6 @@ namespace keys = manifest_keys; static base::LazyInstance<ExtensionIconSet> g_empty_icon_set = LAZY_INSTANCE_INITIALIZER; -const int IconsInfo::kPageActionIconMaxSize = 19; -const int IconsInfo::kBrowserActionIconMaxSize = 19; - // static const ExtensionIconSet& IconsInfo::GetIcons(const Extension* extension) { IconsInfo* info = static_cast<IconsInfo*>( @@ -97,11 +93,10 @@ bool IconsHandler::Parse(Extension* extension, base::string16* error) { bool IconsHandler::Validate(const Extension* extension, std::string* error, std::vector<InstallWarning>* warnings) const { - return extension_file_util::ValidateExtensionIconSet( - IconsInfo::GetIcons(extension), - extension, - IDS_EXTENSION_LOAD_ICON_FAILED, - error); + return file_util::ValidateExtensionIconSet(IconsInfo::GetIcons(extension), + extension, + IDS_EXTENSION_LOAD_ICON_FAILED, + error); } const std::vector<std::string> IconsHandler::Keys() const { diff --git a/chrome/common/extensions/manifest_handlers/icons_handler.h b/extensions/common/manifest_handlers/icons_handler.h index 9c4d42f5..10a774f 100644 --- a/chrome/common/extensions/manifest_handlers/icons_handler.h +++ b/extensions/common/manifest_handlers/icons_handler.h @@ -1,9 +1,9 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_ICONS_HANDLER_H_ -#define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_ICONS_HANDLER_H_ +#ifndef EXTENSIONS_COMMON_MANIFEST_HANDLERS_ICONS_HANDLER_H_ +#define EXTENSIONS_COMMON_MANIFEST_HANDLERS_ICONS_HANDLER_H_ #include <string> @@ -12,13 +12,15 @@ #include "extensions/common/extension_resource.h" #include "extensions/common/manifest_handler.h" +class GURL; + +namespace gfx { +class ImageSkia; +} + namespace extensions { struct IconsInfo : public Extension::ManifestData { - // Max size (both dimensions) for browser and page actions. - static const int kPageActionIconMaxSize; - static const int kBrowserActionIconMaxSize; - // The icons for the extension. ExtensionIconSet icons; @@ -57,4 +59,4 @@ class IconsHandler : public ManifestHandler { } // namespace extensions -#endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_ICONS_HANDLER_H_ +#endif // EXTENSIONS_COMMON_MANIFEST_HANDLERS_ICONS_HANDLER_H_ diff --git a/extensions/extensions.gyp b/extensions/extensions.gyp index eeca2c0..4227cc0 100644 --- a/extensions/extensions.gyp +++ b/extensions/extensions.gyp @@ -18,6 +18,9 @@ '../chrome/chrome_resources.gyp:chrome_resources', # TODO(jamescook|derat): Pull strings into extensions module. '../chrome/chrome_resources.gyp:chrome_strings', + # Need default icons in theme_resources.grd + '../chrome/chrome_resources.gyp:theme_resources', + # TODO(tfarina): This dep here is for extensions/common/constants.* # We should find a way to compile this module within extensions_common. '../chrome/common_constants.gyp:common_constants', @@ -120,6 +123,8 @@ 'common/manifest_handlers/background_info.h', 'common/manifest_handlers/csp_info.cc', 'common/manifest_handlers/csp_info.h', + 'common/manifest_handlers/icons_handler.cc', + 'common/manifest_handlers/icons_handler.h', 'common/manifest_handlers/incognito_info.cc', 'common/manifest_handlers/incognito_info.h', 'common/manifest_handlers/kiosk_mode_info.cc', |