summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorskuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-20 23:47:44 +0000
committerskuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-20 23:47:44 +0000
commitf534d095e0f6805d420d72a3afb4f894bbc35a6c (patch)
tree18f9cdabccca81dcf0979060c3574fe413633e7d /ash
parent9d0917e146bc89732b9c2851e0676fd94997a210 (diff)
downloadchromium_src-f534d095e0f6805d420d72a3afb4f894bbc35a6c.zip
chromium_src-f534d095e0f6805d420d72a3afb4f894bbc35a6c.tar.gz
chromium_src-f534d095e0f6805d420d72a3afb4f894bbc35a6c.tar.bz2
Fixing i18n issues with the system tray menu (strings are too long for menu)
As discussed between designers and reviewers we moved the size of the menu into the locale_settings and query the value when creating the menu. The locale files for all languages need to be changed according to this: English spoken languages: 300 de, fr, bg: 370 all others: 350 BUG=156358 TEST=visual Review URL: https://chromiumcodereview.appspot.com/12630012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189472 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/system/tray/system_tray.cc9
-rw-r--r--ash/system/tray/system_tray_delegate.h3
-rw-r--r--ash/system/tray/test_system_tray_delegate.cc6
-rw-r--r--ash/system/tray/test_system_tray_delegate.h1
4 files changed, 18 insertions, 1 deletions
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc
index 6054c453..e669fd2 100644
--- a/ash/system/tray/system_tray.cc
+++ b/ash/system/tray/system_tray.cc
@@ -63,6 +63,9 @@ using views::TrayBubbleView;
namespace ash {
+// The minimum width of the system tray menu width.
+const int kMinimumSystemTrayMenuWidth = 300;
+
namespace internal {
// Class to initialize and manage the SystemTrayBubble and TrayBubbleWrapper
@@ -372,9 +375,13 @@ void SystemTray::ShowItems(const std::vector<SystemTrayItem*>& items,
if (system_bubble_.get() && creation_type == BUBBLE_USE_EXISTING) {
system_bubble_->bubble()->UpdateView(items, bubble_type);
} else {
+ // The menu width is fixed, and it is a per language setting.
+ int menu_width = std::max(kMinimumSystemTrayMenuWidth,
+ Shell::GetInstance()->system_tray_delegate()->GetSystemTrayMenuWidth());
+
TrayBubbleView::InitParams init_params(TrayBubbleView::ANCHOR_TYPE_TRAY,
GetAnchorAlignment(),
- kTrayPopupMinWidth,
+ menu_width,
kTrayPopupMaxWidth);
init_params.can_activate = can_activate;
if (detailed) {
diff --git a/ash/system/tray/system_tray_delegate.h b/ash/system/tray/system_tray_delegate.h
index 1baccf3..6c6c21f 100644
--- a/ash/system/tray/system_tray_delegate.h
+++ b/ash/system/tray/system_tray_delegate.h
@@ -334,6 +334,9 @@ class SystemTrayDelegate {
// length limit is set.
virtual base::TimeDelta GetSessionLengthLimit() = 0;
+ // Get the system tray menu size in pixels (dependent on the language).
+ virtual int GetSystemTrayMenuWidth() = 0;
+
// Creates a dummy delegate for testing.
static SystemTrayDelegate* CreateDummyDelegate();
};
diff --git a/ash/system/tray/test_system_tray_delegate.cc b/ash/system/tray/test_system_tray_delegate.cc
index bda2fbf..71f3807 100644
--- a/ash/system/tray/test_system_tray_delegate.cc
+++ b/ash/system/tray/test_system_tray_delegate.cc
@@ -335,5 +335,11 @@ base::TimeDelta TestSystemTrayDelegate::GetSessionLengthLimit() {
return base::TimeDelta();
}
+int TestSystemTrayDelegate::GetSystemTrayMenuWidth() {
+ // This is the default width for English languages.
+ return 300;
+}
+
+
} // namespace test
} // namespace ash
diff --git a/ash/system/tray/test_system_tray_delegate.h b/ash/system/tray/test_system_tray_delegate.h
index 9134aae..2a4ea24 100644
--- a/ash/system/tray/test_system_tray_delegate.h
+++ b/ash/system/tray/test_system_tray_delegate.h
@@ -103,6 +103,7 @@ class TestSystemTrayDelegate : public SystemTrayDelegate {
scoped_ptr<VolumeControlDelegate> delegate) OVERRIDE;
virtual base::Time GetSessionStartTime() OVERRIDE;
virtual base::TimeDelta GetSessionLengthLimit() OVERRIDE;
+ virtual int GetSystemTrayMenuWidth() OVERRIDE;
private:
bool wifi_enabled_;