diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 19abaed55c1d58..2bdd9c580e5c8b 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn @@ -1208,6 +1208,7 @@ component("ash") { public_deps = [ "//ash/public/cpp", "//ash/public/cpp/vector_icons", + "//ash/resources", "//ash/resources/vector_icons", "//ash/strings", "//ash/wayland", @@ -1830,6 +1831,7 @@ test("ash_unittests") { "//ash/public/cpp", "//ash/public/cpp:unit_tests", "//ash/public/cpp/vector_icons", + "//ash/resources", "//ash/resources/vector_icons", "//ash/strings", "//ash/touch_hud", @@ -2128,6 +2130,7 @@ static_library("test_support_common") { "//ash/components/fast_ink", "//ash/public/cpp", "//ash/public/interfaces:test_interfaces", + "//ash/resources", "//base", "//base:i18n", "//base/test:test_support", @@ -2229,6 +2232,7 @@ repack("ash_service_resources") { output = "$root_out_dir/ash_service_resources.pak" sources = [ "$root_gen_dir/ash/components/resources/ash_components_resources_100_percent.pak", + "$root_gen_dir/ash/resources/ash_resources_100_percent.pak", "$root_gen_dir/ash/strings/ash_strings_en-US.pak", "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_100_percent.pak", "$root_gen_dir/ui/chromeos/strings/ui_chromeos_strings_en-US.pak", @@ -2239,6 +2243,7 @@ repack("ash_service_resources") { ] deps = [ "//ash/components/resources", + "//ash/resources", "//ash/strings", "//ui/chromeos/resources", "//ui/chromeos/strings", @@ -2253,12 +2258,14 @@ repack("ash_service_resources_200") { output = "$root_out_dir/ash_service_resources_200.pak" sources = [ "$root_gen_dir/ash/components/resources/ash_components_resources_200_percent.pak", + "$root_gen_dir/ash/resources/ash_resources_200_percent.pak", "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_200_percent.pak", "$root_gen_dir/ui/resources/ui_resources_200_percent.pak", "$root_gen_dir/ui/views/resources/views_resources_200_percent.pak", ] deps = [ "//ash/components/resources", + "//ash/resources", "//ui/chromeos/resources", "//ui/resources", "//ui/views/resources", diff --git a/ash/display/resolution_notification_controller.cc b/ash/display/resolution_notification_controller.cc index 7d31f4eedce941..22e7bb21473761 100644 --- a/ash/display/resolution_notification_controller.cc +++ b/ash/display/resolution_notification_controller.cc @@ -6,7 +6,7 @@ #include -#include "ash/resources/vector_icons/vector_icons.h" +#include "ash/resources/grit/ash_resources.h" #include "ash/session/session_controller.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" @@ -14,6 +14,7 @@ #include "base/strings/utf_string_conversions.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/time_format.h" +#include "ui/base/resource/resource_bundle.h" #include "ui/display/display.h" #include "ui/display/manager/display_manager.h" #include "ui/display/manager/managed_display_info.h" @@ -220,22 +221,17 @@ void ResolutionNotificationController::CreateOrUpdateNotification( base::UTF8ToUTF16( change_info_->current_resolution.size().ToString())); - std::unique_ptr notification = - Notification::CreateSystemNotification( - message_center::NOTIFICATION_TYPE_SIMPLE, kNotificationId, message, - timeout_message, gfx::Image(), - base::string16(), // display_source - GURL(), - message_center::NotifierId( - message_center::NotifierId::SYSTEM_COMPONENT, - kNotifierDisplayResolutionChange), - data, - base::MakeRefCounted( - weak_factory_.GetWeakPtr()), - kNotificationScreenIcon, - message_center::SystemNotificationWarningLevel::NORMAL); - notification->set_priority(message_center::SYSTEM_PRIORITY); - + ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); + auto notification = std::make_unique( + message_center::NOTIFICATION_TYPE_SIMPLE, kNotificationId, message, + timeout_message, bundle.GetImageNamed(IDR_AURA_NOTIFICATION_DISPLAY), + base::string16() /* display_source */, GURL(), + message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, + kNotifierDisplayResolutionChange), + data, + base::MakeRefCounted( + weak_factory_.GetWeakPtr())); + notification->SetSystemPriority(); message_center->AddNotification(std::move(notification)); } diff --git a/ash/resources/BUILD.gn b/ash/resources/BUILD.gn index 630351a9dc2f96..625e6dcd4c0d07 100644 --- a/ash/resources/BUILD.gn +++ b/ash/resources/BUILD.gn @@ -9,6 +9,15 @@ import("//ui/base/ui_features.gni") assert(is_chromeos) assert(enable_hidpi) +grit("resources") { + source = "ash_resources.grd" + outputs = [ + "grit/ash_resources.h", + "ash_resources_100_percent.pak", + "ash_resources_200_percent.pak", + ] +} + # Repacks resources needed for ash_unittests, etc. at a given scale. # TODO(msw): Use ui_test.pak instead of its pieces? (no 200% support?) template("ash_test_resources") { @@ -20,6 +29,7 @@ template("ash_test_resources") { sources = [ "$root_gen_dir/ash/components/resources/ash_components_resources_${percent}_percent.pak", "$root_gen_dir/ash/public/cpp/resources/ash_public_unscaled_resources.pak", + "$root_gen_dir/ash/resources/ash_resources_${percent}_percent.pak", "$root_gen_dir/ui/app_list/resources/app_list_resources_${percent}_percent.pak", "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_percent.pak", "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak", @@ -40,6 +50,7 @@ template("ash_test_resources") { deps = [ "//ash/components/resources", "//ash/public/cpp/resources:ash_public_unscaled_resources", + "//ash/resources", "//mojo/public/js:resources", "//ui/app_list/resources", "//ui/chromeos/resources", diff --git a/ash/resources/ash_resources.grd b/ash/resources/ash_resources.grd new file mode 100644 index 00000000000000..1edf3c94d321a2 --- /dev/null +++ b/ash/resources/ash_resources.grd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/ash/resources/default_100_percent/cros/notification/display_notification_icon.png b/ash/resources/default_100_percent/cros/notification/display_notification_icon.png new file mode 100644 index 00000000000000..e49d82a23cefff Binary files /dev/null and b/ash/resources/default_100_percent/cros/notification/display_notification_icon.png differ diff --git a/ash/resources/default_200_percent/cros/notification/display_notification_icon.png b/ash/resources/default_200_percent/cros/notification/display_notification_icon.png new file mode 100644 index 00000000000000..832e974fcc968a Binary files /dev/null and b/ash/resources/default_200_percent/cros/notification/display_notification_icon.png differ diff --git a/ash/system/bluetooth/bluetooth_notification_controller.cc b/ash/system/bluetooth/bluetooth_notification_controller.cc index c517b81b1cea94..58e6b8203c48e5 100644 --- a/ash/system/bluetooth/bluetooth_notification_controller.cc +++ b/ash/system/bluetooth/bluetooth_notification_controller.cc @@ -7,6 +7,7 @@ #include #include +#include "ash/resources/grit/ash_resources.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/strings/grit/ash_strings.h" #include "base/bind.h" diff --git a/ash/system/locale/locale_notification_controller.cc b/ash/system/locale/locale_notification_controller.cc index 8c2a573567e4dd..bb84369c86a25f 100644 --- a/ash/system/locale/locale_notification_controller.cc +++ b/ash/system/locale/locale_notification_controller.cc @@ -8,6 +8,7 @@ #include #include "ash/public/cpp/vector_icons/vector_icons.h" +#include "ash/resources/grit/ash_resources.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/tray/system_tray_notifier.h" #include "base/strings/string16.h" diff --git a/ash/system/power/battery_notification.cc b/ash/system/power/battery_notification.cc index 75d9066619e7a1..6202550fed027b 100644 --- a/ash/system/power/battery_notification.cc +++ b/ash/system/power/battery_notification.cc @@ -5,6 +5,7 @@ #include "ash/system/power/battery_notification.h" #include "ash/public/cpp/power_utils.h" +#include "ash/resources/grit/ash_resources.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/power/power_status.h" diff --git a/ash/system/power/dual_role_notification.cc b/ash/system/power/dual_role_notification.cc index a27e009f444fc8..9f6b204f1715c3 100644 --- a/ash/system/power/dual_role_notification.cc +++ b/ash/system/power/dual_role_notification.cc @@ -6,6 +6,7 @@ #include +#include "ash/resources/grit/ash_resources.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" diff --git a/ash/system/power/peripheral_battery_notifier.cc b/ash/system/power/peripheral_battery_notifier.cc index f3850e7ca201b6..f1b9023bf2296d 100644 --- a/ash/system/power/peripheral_battery_notifier.cc +++ b/ash/system/power/peripheral_battery_notifier.cc @@ -6,6 +6,7 @@ #include +#include "ash/resources/grit/ash_resources.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" diff --git a/ash/system/power/tray_power.cc b/ash/system/power/tray_power.cc index 630e6d86c874fe..df245179725d15 100644 --- a/ash/system/power/tray_power.cc +++ b/ash/system/power/tray_power.cc @@ -8,7 +8,7 @@ #include "ash/accessibility/accessibility_delegate.h" #include "ash/public/cpp/ash_switches.h" - +#include "ash/resources/grit/ash_resources.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/date/date_view.h" diff --git a/ash/system/screen_layout_observer.cc b/ash/system/screen_layout_observer.cc index 78aae213ca1ab5..b4b96a34e9bf23 100644 --- a/ash/system/screen_layout_observer.cc +++ b/ash/system/screen_layout_observer.cc @@ -11,6 +11,7 @@ #include "ash/display/screen_orientation_controller.h" #include "ash/metrics/user_metrics_action.h" #include "ash/metrics/user_metrics_recorder.h" +#include "ash/resources/grit/ash_resources.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/session/session_controller.h" #include "ash/shell.h" diff --git a/ash/system/screen_security/screen_capture_tray_item.cc b/ash/system/screen_security/screen_capture_tray_item.cc index 61616d874ee390..472194a9d4e6b7 100644 --- a/ash/system/screen_security/screen_capture_tray_item.cc +++ b/ash/system/screen_security/screen_capture_tray_item.cc @@ -9,7 +9,7 @@ #include "ash/metrics/user_metrics_action.h" #include "ash/metrics/user_metrics_recorder.h" #include "ash/public/cpp/ash_features.h" - +#include "ash/resources/grit/ash_resources.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" diff --git a/ash/system/screen_security/screen_share_tray_item.cc b/ash/system/screen_security/screen_share_tray_item.cc index eed0520c52156e..38ee08664271d7 100644 --- a/ash/system/screen_security/screen_share_tray_item.cc +++ b/ash/system/screen_security/screen_share_tray_item.cc @@ -6,6 +6,7 @@ #include +#include "ash/resources/grit/ash_resources.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 1cb4bcd002fcab..d9e30c79b52f7b 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn @@ -21,6 +21,7 @@ source_set("chromeos") { configs += [ "//build/config/compiler:wexit_time_destructors" ] public_deps = [ + "//ash/resources", "//ash/strings", "//chrome:extra_resources", "//chrome:resources", @@ -2179,6 +2180,7 @@ source_set("unit_tests") { ":attestation_proto", ":test_support", "//ash", + "//ash/resources", "//base", "//chrome/common", "//chromeos/components/tether:test_support", diff --git a/chrome/browser/ui/app_list/DEPS b/chrome/browser/ui/app_list/DEPS index 53de606bd22e19..226b2da1149c3d 100644 --- a/chrome/browser/ui/app_list/DEPS +++ b/chrome/browser/ui/app_list/DEPS @@ -6,3 +6,10 @@ include_rules = [ "+ash/public", ] + +specific_include_rules = { + # TODO(733662): Remove when app_list is migrated. + "crostini_app_model_builder\.cc": [ + "+ash/resources/grit/ash_resources.h", + ], +} diff --git a/chrome/browser/ui/app_list/crostini/crostini_app_model_builder.cc b/chrome/browser/ui/app_list/crostini/crostini_app_model_builder.cc index cd9517b0d469e1..446fb5d580c3d8 100644 --- a/chrome/browser/ui/app_list/crostini/crostini_app_model_builder.cc +++ b/chrome/browser/ui/app_list/crostini/crostini_app_model_builder.cc @@ -4,6 +4,7 @@ #include "chrome/browser/ui/app_list/crostini/crostini_app_model_builder.h" +#include "ash/resources/grit/ash_resources.h" #include "chrome/browser/chromeos/crostini/crostini_manager.h" #include "chrome/browser/chromeos/crostini/crostini_pref_names.h" #include "chrome/browser/chromeos/crostini/crostini_registry_service_factory.h" @@ -11,9 +12,11 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" #include "chrome/browser/ui/app_list/crostini/crostini_app_item.h" +#include "chrome/grit/chrome_unscaled_resources.h" #include "components/crx_file/id_util.h" #include "components/prefs/pref_change_registrar.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/resource/resource_bundle.h" CrostiniAppModelBuilder::CrostiniAppModelBuilder( AppListControllerDelegate* controller) diff --git a/chrome/chrome_paks.gni b/chrome/chrome_paks.gni index fde31eb044edf6..9c2c9cbddc5734 100644 --- a/chrome/chrome_paks.gni +++ b/chrome/chrome_paks.gni @@ -59,10 +59,12 @@ template("chrome_repack_percent") { if (is_chromeos) { sources += [ "$root_gen_dir/ash/components/resources/ash_components_resources_${percent}_percent.pak", + "$root_gen_dir/ash/resources/ash_resources_${percent}_percent.pak", "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_percent.pak", ] deps += [ "//ash/components/resources", + "//ash/resources", "//ui/chromeos/resources", ] } diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index d98989392f8bd3..f3ffd7b18f33bb 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn @@ -3251,6 +3251,7 @@ test("unit_tests") { deps += [ "//ash:test_support_with_content", "//ash/public/cpp/resources:ash_public_unscaled_resources", + "//ash/resources", "//ash/strings", ] } @@ -4883,6 +4884,7 @@ if (!is_android) { "//ash:interactive_ui_test_support", "//ash/app_list/presenter:test_support", "//ash/public/interfaces:test_interfaces", + "//ash/resources", "//chrome/browser/media/router:test_support", "//chromeos", "//mojo/edk", diff --git a/tools/check_grd_for_unused_strings.py b/tools/check_grd_for_unused_strings.py index 2defb2fc0a7238..d997db66ccb29e 100755 --- a/tools/check_grd_for_unused_strings.py +++ b/tools/check_grd_for_unused_strings.py @@ -137,6 +137,7 @@ def main(): ui_chromeos_dir = os.path.join(ui_dir, 'chromeos') grd_files = [ os.path.join(ash_base_dir, 'ash_strings.grd'), + os.path.join(ash_base_dir, 'resources', 'ash_resources.grd'), os.path.join(ash_components_dir, 'ash_components_strings.grd'), os.path.join(ash_components_dir, 'resources', 'ash_components_resources.grd'), diff --git a/tools/gritsettings/resource_ids b/tools/gritsettings/resource_ids index fc16a42e623e99..7e838ac964fc6c 100644 --- a/tools/gritsettings/resource_ids +++ b/tools/gritsettings/resource_ids @@ -293,6 +293,9 @@ "ash/public/cpp/resources/ash_public_unscaled_resources.grd": { "includes": [24260], }, + "ash/resources/ash_resources.grd": { + "structures": [24280], + }, "ash/shell/ash_shell_resources.grd": { "includes": [24290], }, diff --git a/tools/resources/find_unused_resources.py b/tools/resources/find_unused_resources.py index eab5ba3c6a1dcf..d6e52c866ed2ba 100755 --- a/tools/resources/find_unused_resources.py +++ b/tools/resources/find_unused_resources.py @@ -12,7 +12,7 @@ Example: cd /work/chrome/src - tools/resources/find_unused_resouces.py chrome/browser/browser_resources.grd + tools/resources/find_unused_resouces.py ash/resources/ash_resources.grd """ __author__ = 'jamescook@chromium.org (James Cook)'