OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/status_icons/status_icon_win.h" | 5 #include "chrome/browser/ui/views/status_icons/status_icon_win.h" |
6 | 6 |
7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
9 #include "ui/gfx/icon_util.h" | 9 #include "ui/gfx/icon_util.h" |
10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 // Create the icon. | 74 // Create the icon. |
75 NOTIFYICONDATA icon_data; | 75 NOTIFYICONDATA icon_data; |
76 InitIconData(&icon_data); | 76 InitIconData(&icon_data); |
77 icon_data.uFlags = NIF_TIP; | 77 icon_data.uFlags = NIF_TIP; |
78 wcscpy_s(icon_data.szTip, tool_tip.c_str()); | 78 wcscpy_s(icon_data.szTip, tool_tip.c_str()); |
79 BOOL result = Shell_NotifyIcon(NIM_MODIFY, &icon_data); | 79 BOOL result = Shell_NotifyIcon(NIM_MODIFY, &icon_data); |
80 if (!result) | 80 if (!result) |
81 LOG(WARNING) << "Unable to set tooltip for status tray icon"; | 81 LOG(WARNING) << "Unable to set tooltip for status tray icon"; |
82 } | 82 } |
83 | 83 |
84 void StatusIconWin::DisplayBalloon(const string16& title, | 84 void StatusIconWin::DisplayBalloon(const SkBitmap& icon, |
85 const string16& title, | |
85 const string16& contents) { | 86 const string16& contents) { |
87 // TODO(leandrogracia): implement custom icons for notification balloons. | |
Andrew T Wilson (Slow)
2011/10/26 00:38:19
Is there actually anything you can do on windows?
Leandro GraciĆ” Gil
2011/10/26 00:45:11
I have a working code for that and it's provided b
| |
88 | |
86 NOTIFYICONDATA icon_data; | 89 NOTIFYICONDATA icon_data; |
87 InitIconData(&icon_data); | 90 InitIconData(&icon_data); |
88 icon_data.uFlags = NIF_INFO; | 91 icon_data.uFlags = NIF_INFO; |
89 icon_data.dwInfoFlags = NIIF_INFO; | 92 icon_data.dwInfoFlags = NIIF_INFO; |
90 wcscpy_s(icon_data.szInfoTitle, title.c_str()); | 93 wcscpy_s(icon_data.szInfoTitle, title.c_str()); |
91 wcscpy_s(icon_data.szInfo, contents.c_str()); | 94 wcscpy_s(icon_data.szInfo, contents.c_str()); |
92 icon_data.uTimeout = 0; | 95 icon_data.uTimeout = 0; |
93 BOOL result = Shell_NotifyIcon(NIM_MODIFY, &icon_data); | 96 BOOL result = Shell_NotifyIcon(NIM_MODIFY, &icon_data); |
94 if (!result) | 97 if (!result) |
95 LOG(WARNING) << "Unable to create status tray balloon."; | 98 LOG(WARNING) << "Unable to create status tray balloon."; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 context_menu_->RunContextMenuAt(gfx::Point(x, y)); | 131 context_menu_->RunContextMenuAt(gfx::Point(x, y)); |
129 } | 132 } |
130 #endif | 133 #endif |
131 } | 134 } |
132 | 135 |
133 void StatusIconWin::InitIconData(NOTIFYICONDATA* icon_data) { | 136 void StatusIconWin::InitIconData(NOTIFYICONDATA* icon_data) { |
134 icon_data->cbSize = sizeof(NOTIFYICONDATA); | 137 icon_data->cbSize = sizeof(NOTIFYICONDATA); |
135 icon_data->hWnd = window_; | 138 icon_data->hWnd = window_; |
136 icon_data->uID = icon_id_; | 139 icon_data->uID = icon_id_; |
137 } | 140 } |
OLD | NEW |