diff options
author | atwilson@google.com <atwilson@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-30 17:39:51 +0000 |
---|---|---|
committer | atwilson@google.com <atwilson@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-30 17:39:51 +0000 |
commit | 87a833ed78a8b1b94f134aa55a7803d53dccb03d (patch) | |
tree | fe2e6c3276c4efa5c2acc16203b53bd1027354b1 | |
parent | 40350b13714bed9c76d8bb0991c490b2ee14fe05 (diff) | |
download | chromium_src-87a833ed78a8b1b94f134aa55a7803d53dccb03d.zip chromium_src-87a833ed78a8b1b94f134aa55a7803d53dccb03d.tar.gz chromium_src-87a833ed78a8b1b94f134aa55a7803d53dccb03d.tar.bz2 |
Windows implementation of StatusIcon::SetToolTip()
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43099 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/status_icons/status_tray_manager.cc | 3 | ||||
-rw-r--r-- | chrome/browser/views/status_icons/status_icon_win.cc | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/status_icons/status_tray_manager.cc b/chrome/browser/status_icons/status_tray_manager.cc index 39b6c85..b5465c3 100644 --- a/chrome/browser/status_icons/status_tray_manager.cc +++ b/chrome/browser/status_icons/status_tray_manager.cc @@ -4,6 +4,7 @@ #include "chrome/browser/status_icons/status_tray_manager.h" +#include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/logging.h" #include "base/string_util.h" @@ -12,6 +13,7 @@ #include "chrome/browser/browser_window.h" #include "chrome/browser/status_icons/status_tray.h" #include "grit/browser_resources.h" +#include "grit/chromium_strings.h" #include "grit/theme_resources.h" StatusTrayManager::StatusTrayManager() { @@ -34,6 +36,7 @@ void StatusTrayManager::Init(Profile* profile) { IDR_STATUS_TRAY_ICON_PRESSED); icon->SetImage(*bitmap); icon->SetPressedImage(*pressed); + icon->SetToolTip(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); icon->AddObserver(this); } #endif diff --git a/chrome/browser/views/status_icons/status_icon_win.cc b/chrome/browser/views/status_icons/status_icon_win.cc index 4ba6603..71cd593 100644 --- a/chrome/browser/views/status_icons/status_icon_win.cc +++ b/chrome/browser/views/status_icons/status_icon_win.cc @@ -48,7 +48,13 @@ void StatusIconWin::SetPressedImage(const SkBitmap& image) { } void StatusIconWin::SetToolTip(const string16& tool_tip) { - // TODO(atwilson): Implement this (http://crbug.com/38993). + // Create the icon. + NOTIFYICONDATA icon_data; + InitIconData(&icon_data); + icon_data.uFlags = NIF_TIP; + wcscpy_s(icon_data.szTip, tool_tip.c_str()); + BOOL result = Shell_NotifyIcon(NIM_MODIFY, &icon_data); + DCHECK(result); } void StatusIconWin::InitIconData(NOTIFYICONDATA* icon_data) { |