diff options
author | varunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-28 00:21:19 +0000 |
---|---|---|
committer | varunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-28 00:21:19 +0000 |
commit | 35982cabf2b13ce950df6ebe16c5a27c73739de1 (patch) | |
tree | 4a9f89cb97ef00daf76c0906a5b4d633c060cd1b /ash | |
parent | 5eaad14fe38fb7c9776df599f18df6cb0476b0c6 (diff) | |
download | chromium_src-35982cabf2b13ce950df6ebe16c5a27c73739de1.zip chromium_src-35982cabf2b13ce950df6ebe16c5a27c73739de1.tar.gz chromium_src-35982cabf2b13ce950df6ebe16c5a27c73739de1.tar.bz2 |
Show tooltips on ash tray network items.
BUG=136588
TEST=manual
Review URL: https://chromiumcodereview.appspot.com/10876091
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153592 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/system/bluetooth/tray_bluetooth.cc | 5 | ||||
-rw-r--r-- | ash/system/network/tray_network.cc | 11 | ||||
-rw-r--r-- | ash/tooltips/tooltip_controller.cc | 4 |
3 files changed, 17 insertions, 3 deletions
diff --git a/ash/system/bluetooth/tray_bluetooth.cc b/ash/system/bluetooth/tray_bluetooth.cc index bc8b3db..1ec3eef 100644 --- a/ash/system/bluetooth/tray_bluetooth.cc +++ b/ash/system/bluetooth/tray_bluetooth.cc @@ -13,6 +13,7 @@ #include "ash/system/tray/tray_views.h" #include "grit/ash_strings.h" #include "grit/ui_resources.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" #include "ui/views/controls/image_view.h" @@ -102,6 +103,10 @@ class BluetoothDetailedView : public TrayDetailsView, IDR_AURA_UBER_TRAY_BLUETOOTH_DISABLED_HOVER, IDS_ASH_STATUS_TRAY_BLUETOOTH); toggle_bluetooth_->SetToggled(!delegate->GetBluetoothEnabled()); + toggle_bluetooth_->SetTooltipText( + l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISABLE_BLUETOOTH)); + toggle_bluetooth_->SetToggledTooltipText( + l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ENABLE_BLUETOOTH)); footer()->AddButton(toggle_bluetooth_); } diff --git a/ash/system/network/tray_network.cc b/ash/system/network/tray_network.cc index fc23759..df357ba 100644 --- a/ash/system/network/tray_network.cc +++ b/ash/system/network/tray_network.cc @@ -19,6 +19,7 @@ #include "grit/ui_resources.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/aura/window.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" @@ -283,6 +284,10 @@ class NetworkListDetailedView : public NetworkDetailedView, IDR_AURA_UBER_TRAY_WIFI_ENABLED_HOVER, IDR_AURA_UBER_TRAY_WIFI_DISABLED_HOVER, IDS_ASH_STATUS_TRAY_WIFI); + button_wifi_->SetTooltipText( + l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISABLE_WIFI)); + button_wifi_->SetToggledTooltipText( + l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ENABLE_WIFI)); footer()->AddButton(button_wifi_); button_mobile_ = new TrayPopupHeaderButton(this, @@ -291,6 +296,10 @@ class NetworkListDetailedView : public NetworkDetailedView, IDR_AURA_UBER_TRAY_CELLULAR_ENABLED_HOVER, IDR_AURA_UBER_TRAY_CELLULAR_DISABLED_HOVER, IDS_ASH_STATUS_TRAY_CELLULAR); + button_mobile_->SetTooltipText( + l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISABLE_MOBILE)); + button_mobile_->SetToggledTooltipText( + l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ENABLE_MOBILE)); footer()->AddButton(button_mobile_); info_icon_ = new TrayPopupHeaderButton(this, @@ -299,6 +308,8 @@ class NetworkListDetailedView : public NetworkDetailedView, IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER, IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER, IDS_ASH_STATUS_TRAY_NETWORK_INFO); + info_icon_->SetTooltipText( + l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_INFO)); footer()->AddButton(info_icon_); } diff --git a/ash/tooltips/tooltip_controller.cc b/ash/tooltips/tooltip_controller.cc index ed2528f..e3ec0ea 100644 --- a/ash/tooltips/tooltip_controller.cc +++ b/ash/tooltips/tooltip_controller.cc @@ -264,9 +264,7 @@ bool TooltipController::PreHandleMouseEvent(aura::Window* target, if (tooltip_timer_.IsRunning()) tooltip_timer_.Reset(); - // We update the tooltip if it is visible, or if we force-hid it due to a - // mouse press. - if (GetTooltip()->IsVisible() || tooltip_window_at_mouse_press_) + if (GetTooltip()->IsVisible()) UpdateIfRequired(); break; case ui::ET_MOUSE_PRESSED: |