summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-09 00:14:39 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-09 00:14:39 +0000
commit535bd077d7323717868e50f2155b5905e9f1d309 (patch)
treef00da7b6b9dcf4f618a7071038b0589b030045b4
parentfb81b98c2e3745e39ee3efe9a0ee98d2095c43e7 (diff)
downloadchromium_src-535bd077d7323717868e50f2155b5905e9f1d309.zip
chromium_src-535bd077d7323717868e50f2155b5905e9f1d309.tar.gz
chromium_src-535bd077d7323717868e50f2155b5905e9f1d309.tar.bz2
Updates the message of the TrayDisplay notifications.
- no body text to list displays - rotation notification has the new rotation info in the text - edited a few words BUG=265915 R=oshima@chromium.org, stevenjb@chromium.org TEST=ash_unittests Review URL: https://codereview.chromium.org/21612005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216502 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/ash_strings.grd16
-rw-r--r--ash/system/chromeos/tray_display.cc21
-rw-r--r--ash/system/chromeos/tray_display_unittest.cc21
-rw-r--r--chrome/app/chromeos_strings.grdp9
-rw-r--r--chrome/browser/ui/webui/options/chromeos/display_options_handler.cc7
5 files changed, 53 insertions, 21 deletions
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd
index f43ba86..4c6d2b9 100644
--- a/ash/ash_strings.grd
+++ b/ash/ash_strings.grd
@@ -325,10 +325,10 @@ Press Ctrl+Alt+Z to disable.
Dock mode
</message>
<message name="IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED" desc="The label used in the tray to notify that the display resolution settings has changed.">
- <ph name="DISPLAY_NAME">$1</ph> has been resized to <ph name="RESOLUTION">$2</ph>
+ <ph name="DISPLAY_NAME">$1</ph> resolution was changed to <ph name="RESOLUTION">$2</ph>
</message>
<message name="IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED" desc="The label used in the tray to notify that the display rotation settings has changed.">
- <ph name="DISPLAY_NAME">$1</ph> has been rotated
+ <ph name="DISPLAY_NAME">$1</ph> was rotated to <ph name="ROTATION">$2</ph>
</message>
<message name="IDS_ASH_STATUS_TRAY_DISPLAY_SINGLE_DISPLAY" desc="The label used in the tray to show a single display's configuration">
<ph name="DISPLAY_NAME">$1</ph>: <ph name="ANNOTATION">$2</ph>
@@ -345,6 +345,18 @@ Press Ctrl+Alt+Z to disable.
<message name="IDS_ASH_STATUS_TRAY_DISPLAY_ANNOTATION_OVERSCAN" desc="Label used to describe that the system notice that this display device may have overscan area.">
overscan
</message>
+ <message name="IDS_ASH_STATUS_TRAY_DISPLAY_STANDARD_ORIENTATION" desc="The default value of display orientation option item.">
+ 0&#x00B0;
+ </message>
+ <message name="IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90" desc="The value of display orientation option item: 90-degree rotated">
+ 90&#x00B0;
+ </message>
+ <message name="IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180" desc="The value of display orientation option item: 180-degree rotated">
+ 180&#x00B0;
+ </message>
+ <message name="IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_270" desc="The value of display orientation option item: 270-degree rotated">
+ 270&#x00B0;
+ </message>
<message name="IDS_ASH_STATUS_TRAY_DRIVE_SYNCING" desc="The label in the tray to indicate onoing file sync operations.">
Syncing <ph name="count">$1<ex>3</ex></ph> file(s)
</message>
diff --git a/ash/system/chromeos/tray_display.cc b/ash/system/chromeos/tray_display.cc
index 4f4e8c1..ebafa37 100644
--- a/ash/system/chromeos/tray_display.cc
+++ b/ash/system/chromeos/tray_display.cc
@@ -195,7 +195,7 @@ void UpdateDisplayNotification(const base::string16& message) {
message_center::NOTIFICATION_TYPE_SIMPLE,
kDisplayNotificationId,
message,
- GetAllDisplayInfo(),
+ base::string16(), // body is intentionally empty, see crbug.com/265915
bundle.GetImageNamed(IDR_AURA_UBER_TRAY_DISPLAY),
base::string16(), // display_source
"", // extension_id
@@ -367,8 +367,25 @@ bool TrayDisplay::GetDisplayMessageForNotification(base::string16* message) {
return true;
}
if (iter->second.rotation() != old_iter->second.rotation()) {
+ int rotation_text_id = 0;
+ switch (iter->second.rotation()) {
+ case gfx::Display::ROTATE_0:
+ rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_STANDARD_ORIENTATION;
+ break;
+ case gfx::Display::ROTATE_90:
+ rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90;
+ break;
+ case gfx::Display::ROTATE_180:
+ rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180;
+ break;
+ case gfx::Display::ROTATE_270:
+ rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_270;
+ break;
+ }
*message = l10n_util::GetStringFUTF16(
- IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetDisplayName(iter->first));
+ IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED,
+ GetDisplayName(iter->first),
+ l10n_util::GetStringUTF16(rotation_text_id));
return true;
}
}
diff --git a/ash/system/chromeos/tray_display_unittest.cc b/ash/system/chromeos/tray_display_unittest.cc
index 8fa2949..1c5970d 100644
--- a/ash/system/chromeos/tray_display_unittest.cc
+++ b/ash/system/chromeos/tray_display_unittest.cc
@@ -326,13 +326,21 @@ TEST_F(TrayDisplayTest, DisplayNotifications) {
// rotation.
UpdateDisplay("400x400/r");
- base::string16 rotation_message = l10n_util::GetStringFUTF16(
- IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName());
- EXPECT_EQ(rotation_message, GetDisplayNotificationText());
+ EXPECT_EQ(
+ l10n_util::GetStringFUTF16(
+ IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(),
+ l10n_util::GetStringUTF16(
+ IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90)),
+ GetDisplayNotificationText());
CloseNotification();
UpdateDisplay("400x400");
- EXPECT_EQ(rotation_message, GetDisplayNotificationText());
+ EXPECT_EQ(
+ l10n_util::GetStringFUTF16(
+ IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(),
+ l10n_util::GetStringUTF16(
+ IDS_ASH_STATUS_TRAY_DISPLAY_STANDARD_ORIENTATION)),
+ GetDisplayNotificationText());
// UI-scale
CloseNotification();
@@ -395,7 +403,10 @@ TEST_F(TrayDisplayTest, DisplayNotifications) {
UpdateDisplay("400x400@1.5,200x200/r");
EXPECT_EQ(
l10n_util::GetStringFUTF16(
- IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetSecondDisplayName()),
+ IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED,
+ GetSecondDisplayName(),
+ l10n_util::GetStringUTF16(
+ IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90)),
GetDisplayNotificationText());
}
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp
index 5af0160..c96d899 100644
--- a/chrome/app/chromeos_strings.grdp
+++ b/chrome/app/chromeos_strings.grdp
@@ -986,15 +986,6 @@ Press any key to continue exploring.
<message name="IDS_OPTIONS_SETTINGS_DISPLAY_OPTIONS_STANDARD_ORIENTATION" desc="The default value of display orientation option item.">
Standard
</message>
- <message name="IDS_OPTIONS_SETTINGS_DISPLAY_OPTIONS_ORIENTATION_90" desc="The value of display orientation option item: 90-degree rotated">
- 90&#x00B0;
- </message>
- <message name="IDS_OPTIONS_SETTINGS_DISPLAY_OPTIONS_ORIENTATION_180" desc="The value of display orientation option item: 180-degree rotated">
- 180&#x00B0;
- </message>
- <message name="IDS_OPTIONS_SETTINGS_DISPLAY_OPTIONS_ORIENTATION_270" desc="The value of display orientation option item: 270-degree rotated">
- 270&#x00B0;
- </message>
<message name="IDS_OPTIONS_SETTINGS_DISPLAY_OPTIONS_START_CALIBRATING_OVERSCAN" desc="Button label to start calibrating the overscan preference.">
Adjust...
</message>
diff --git a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
index 8861b50..8714639 100644
--- a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/chromeos/display/display_preferences.h"
#include "chromeos/display/output_configurator.h"
#include "content/public/browser/web_ui.h"
+#include "grit/ash_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/display.h"
@@ -100,11 +101,11 @@ void DisplayOptionsHandler::GetLocalizedValues(
localized_strings->SetString("orientation0", l10n_util::GetStringUTF16(
IDS_OPTIONS_SETTINGS_DISPLAY_OPTIONS_STANDARD_ORIENTATION));
localized_strings->SetString("orientation90", l10n_util::GetStringUTF16(
- IDS_OPTIONS_SETTINGS_DISPLAY_OPTIONS_ORIENTATION_90));
+ IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90));
localized_strings->SetString("orientation180", l10n_util::GetStringUTF16(
- IDS_OPTIONS_SETTINGS_DISPLAY_OPTIONS_ORIENTATION_180));
+ IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180));
localized_strings->SetString("orientation270", l10n_util::GetStringUTF16(
- IDS_OPTIONS_SETTINGS_DISPLAY_OPTIONS_ORIENTATION_270));
+ IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_270));
localized_strings->SetString(
"startCalibratingOverscan", l10n_util::GetStringUTF16(
IDS_OPTIONS_SETTINGS_DISPLAY_OPTIONS_START_CALIBRATING_OVERSCAN));