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
parent 5eaad14f
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "ash/system/tray/tray_views.h" #include "ash/system/tray/tray_views.h"
#include "grit/ash_strings.h" #include "grit/ash_strings.h"
#include "grit/ui_resources.h" #include "grit/ui_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h" #include "ui/gfx/image/image.h"
#include "ui/views/controls/image_view.h" #include "ui/views/controls/image_view.h"
...@@ -102,6 +103,10 @@ class BluetoothDetailedView : public TrayDetailsView, ...@@ -102,6 +103,10 @@ class BluetoothDetailedView : public TrayDetailsView,
IDR_AURA_UBER_TRAY_BLUETOOTH_DISABLED_HOVER, IDR_AURA_UBER_TRAY_BLUETOOTH_DISABLED_HOVER,
IDS_ASH_STATUS_TRAY_BLUETOOTH); IDS_ASH_STATUS_TRAY_BLUETOOTH);
toggle_bluetooth_->SetToggled(!delegate->GetBluetoothEnabled()); 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_); footer()->AddButton(toggle_bluetooth_);
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "grit/ui_resources.h" #include "grit/ui_resources.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h" #include "ui/gfx/canvas.h"
#include "ui/gfx/font.h" #include "ui/gfx/font.h"
...@@ -283,6 +284,10 @@ class NetworkListDetailedView : public NetworkDetailedView, ...@@ -283,6 +284,10 @@ class NetworkListDetailedView : public NetworkDetailedView,
IDR_AURA_UBER_TRAY_WIFI_ENABLED_HOVER, IDR_AURA_UBER_TRAY_WIFI_ENABLED_HOVER,
IDR_AURA_UBER_TRAY_WIFI_DISABLED_HOVER, IDR_AURA_UBER_TRAY_WIFI_DISABLED_HOVER,
IDS_ASH_STATUS_TRAY_WIFI); 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_); footer()->AddButton(button_wifi_);
button_mobile_ = new TrayPopupHeaderButton(this, button_mobile_ = new TrayPopupHeaderButton(this,
...@@ -291,6 +296,10 @@ class NetworkListDetailedView : public NetworkDetailedView, ...@@ -291,6 +296,10 @@ class NetworkListDetailedView : public NetworkDetailedView,
IDR_AURA_UBER_TRAY_CELLULAR_ENABLED_HOVER, IDR_AURA_UBER_TRAY_CELLULAR_ENABLED_HOVER,
IDR_AURA_UBER_TRAY_CELLULAR_DISABLED_HOVER, IDR_AURA_UBER_TRAY_CELLULAR_DISABLED_HOVER,
IDS_ASH_STATUS_TRAY_CELLULAR); 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_); footer()->AddButton(button_mobile_);
info_icon_ = new TrayPopupHeaderButton(this, info_icon_ = new TrayPopupHeaderButton(this,
...@@ -299,6 +308,8 @@ class NetworkListDetailedView : public NetworkDetailedView, ...@@ -299,6 +308,8 @@ class NetworkListDetailedView : public NetworkDetailedView,
IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER, IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER,
IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER, IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER,
IDS_ASH_STATUS_TRAY_NETWORK_INFO); IDS_ASH_STATUS_TRAY_NETWORK_INFO);
info_icon_->SetTooltipText(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_INFO));
footer()->AddButton(info_icon_); footer()->AddButton(info_icon_);
} }
......
...@@ -264,9 +264,7 @@ bool TooltipController::PreHandleMouseEvent(aura::Window* target, ...@@ -264,9 +264,7 @@ bool TooltipController::PreHandleMouseEvent(aura::Window* target,
if (tooltip_timer_.IsRunning()) if (tooltip_timer_.IsRunning())
tooltip_timer_.Reset(); tooltip_timer_.Reset();
// We update the tooltip if it is visible, or if we force-hid it due to a if (GetTooltip()->IsVisible())
// mouse press.
if (GetTooltip()->IsVisible() || tooltip_window_at_mouse_press_)
UpdateIfRequired(); UpdateIfRequired();
break; break;
case ui::ET_MOUSE_PRESSED: case ui::ET_MOUSE_PRESSED:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment