return window->taskbar_host().SetThumbnailClip(
window_->GetAcceleratedWidget(), region);
}
+
+bool Window::SetThumbnailToolTip(const std::string& tooltip) {
+ auto window = static_cast<NativeWindowViews*>(window_.get());
+ return window->taskbar_host().SetThumbnailToolTip(
+ window_->GetAcceleratedWidget(), tooltip);
+}
#endif
#if defined(TOOLKIT_VIEWS)
.SetMethod("unhookWindowMessage", &Window::UnhookWindowMessage)
.SetMethod("unhookAllWindowMessages", &Window::UnhookAllWindowMessages)
.SetMethod("setThumbnailClip", &Window::SetThumbnailClip)
+ .SetMethod("setThumbnailToolTip", &Window::SetThumbnailToolTip)
#endif
#if defined(TOOLKIT_VIEWS)
.SetMethod("setIcon", &Window::SetIcon)
void UnhookWindowMessage(UINT message);
void UnhookAllWindowMessages();
bool SetThumbnailClip(const gfx::Rect& region);
+ bool SetThumbnailToolTip(const std::string& tooltip);
#endif
#if defined(TOOLKIT_VIEWS)
}
}
+bool TaskbarHost::SetThumbnailToolTip(
+ HWND window, const std::string& tooltip) {
+ if (!InitializeTaskbar())
+ return false;
+
+ return SUCCEEDED(taskbar_->SetThumbnailTooltip(
+ window, base::UTF8ToUTF16(tooltip).c_str()));
+}
+
bool TaskbarHost::HandleThumbarButtonEvent(int button_id) {
if (ContainsKey(callback_map_, button_id)) {
auto callback = callback_map_[button_id];
HWND window, const gfx::Image& overlay, const std::string& text);
// Set the region of the window to show as a thumbnail in taskbar.
- bool TaskbarHost::SetThumbnailClip(HWND window, const gfx::Rect& region);
+ bool SetThumbnailClip(HWND window, const gfx::Rect& region);
+
+ // Set the tooltip for the thumbnail in taskbar.
+ bool SetThumbnailToolTip(HWND window, const std::string& tooltip);
// Called by the window that there is a button in thumbar clicked.
bool HandleThumbarButtonEvent(int button_id);
the entire window by specifying an empty region:
`{x: 0, y: 0, width: 0, height: 0}`.
+#### `win.setThumbnailToolTip(toolTip)` _Windows_
+
+* `toolTip` String
+
+Sets the toolTip that is displayed when hovering over the window thumbnail
+in the taskbar.
+
#### `win.showDefinitionForSelection()` _macOS_
Same as `webContents.showDefinitionForSelection()`.