Skip to content

Commit

Permalink
Revert "cros - Update appearance of resolution change notification."
Browse files Browse the repository at this point in the history
This reverts commit f57e1c3.

Reason for revert: There are ash and mash_ash failures, reverting because it's ash-related. See crbug.com/841889


Original change's description:
> cros - Update appearance of resolution change notification.
> 
> This removes the last raster asset in ash_resources.grd, so remove that
> file and the associated build target.
> 
> Bug: 840509,505953
> Change-Id: I43ec69b5b8b9fc34aa71a1b65f204447e73b133c
> Reviewed-on: https://chromium-review.googlesource.com/1050523
> Commit-Queue: Evan Stade <estade@chromium.org>
> Reviewed-by: James Cook <jamescook@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#557292}

TBR=jamescook@chromium.org,sky@chromium.org,estade@chromium.org

Change-Id: I4b0ce3e1d01b5b8e390216b379f4158380f542b2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 840509, 505953, 841889
Reviewed-on: https://chromium-review.googlesource.com/1054118
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557598}
  • Loading branch information
dmurph authored and Commit Bot committed May 10, 2018
1 parent 1a29174 commit b6370ae
Show file tree
Hide file tree
Showing 23 changed files with 80 additions and 20 deletions.
7 changes: 7 additions & 0 deletions ash/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -2239,6 +2243,7 @@ repack("ash_service_resources") {
]
deps = [
"//ash/components/resources",
"//ash/resources",
"//ash/strings",
"//ui/chromeos/resources",
"//ui/chromeos/strings",
Expand All @@ -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",
Expand Down
30 changes: 13 additions & 17 deletions ash/display/resolution_notification_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@

#include <utility>

#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"
#include "ash/system/screen_layout_observer.h"
#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"
Expand Down Expand Up @@ -220,22 +221,17 @@ void ResolutionNotificationController::CreateOrUpdateNotification(
base::UTF8ToUTF16(
change_info_->current_resolution.size().ToString()));

std::unique_ptr<Notification> 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<message_center::ThunkNotificationDelegate>(
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<Notification>(
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<message_center::ThunkNotificationDelegate>(
weak_factory_.GetWeakPtr()));
notification->SetSystemPriority();
message_center->AddNotification(std::move(notification));
}

Expand Down
11 changes: 11 additions & 0 deletions ash/resources/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand All @@ -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",
Expand All @@ -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",
Expand Down
19 changes: 19 additions & 0 deletions ash/resources/ash_resources.grd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<grit latest_public_release="0" current_release="1" output_all_resource_defines="false">
<outputs>
<output filename="grit/ash_resources.h" type="rc_header" context="default_100_percent">
<emit emit_type='prepend'></emit>
</output>
<output filename="ash_resources_100_percent.pak" type="data_package" context="default_100_percent" />
<output filename="ash_resources_200_percent.pak" type="data_package" context="default_200_percent" />
</outputs>
<release seq="1">
<structures fallback_to_low_resolution="true">
<!-- KEEP THESE IN ALPHABETICAL ORDER! DO NOT ADD TO RANDOM PLACES JUST
BECAUSE YOUR RESOURCES ARE FUNCTIONALLY RELATED OR FALL UNDER THE
SAME CONDITIONALS. -->

<structure type="chrome_scaled_image" name="IDR_AURA_NOTIFICATION_DISPLAY" file="cros/notification/display_notification_icon.png" />
</structures>
</release>
</grit>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ash/system/bluetooth/bluetooth_notification_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <memory>
#include <utility>

#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"
Expand Down
1 change: 1 addition & 0 deletions ash/system/locale/locale_notification_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <utility>

#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"
Expand Down
1 change: 1 addition & 0 deletions ash/system/power/battery_notification.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions ash/system/power/dual_role_notification.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <set>

#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"
Expand Down
1 change: 1 addition & 0 deletions ash/system/power/peripheral_battery_notifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <vector>

#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"
Expand Down
2 changes: 1 addition & 1 deletion ash/system/power/tray_power.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions ash/system/screen_layout_observer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ash/system/screen_security/screen_capture_tray_item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions ash/system/screen_security/screen_share_tray_item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <utility>

#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"
Expand Down
2 changes: 2 additions & 0 deletions chrome/browser/chromeos/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -2179,6 +2180,7 @@ source_set("unit_tests") {
":attestation_proto",
":test_support",
"//ash",
"//ash/resources",
"//base",
"//chrome/common",
"//chromeos/components/tether:test_support",
Expand Down
7 changes: 7 additions & 0 deletions chrome/browser/ui/app_list/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@

#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"
#include "chrome/browser/chromeos/crostini/crostini_util.h"
#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)
Expand Down
2 changes: 2 additions & 0 deletions chrome/chrome_paks.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
}
Expand Down
2 changes: 2 additions & 0 deletions chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
}
Expand Down Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions tools/check_grd_for_unused_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
3 changes: 3 additions & 0 deletions tools/gritsettings/resource_ids
Original file line number Diff line number Diff line change
Expand Up @@ -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],
},
Expand Down
2 changes: 1 addition & 1 deletion tools/resources/find_unused_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
Expand Down

0 comments on commit b6370ae

Please sign in to comment.