parent
3b183854ff
commit
2d3c65beca
31 changed files with 200 additions and 152 deletions
|
@ -158,7 +158,7 @@ JumpListCategory::JumpListCategory() = default;
|
|||
JumpListCategory::JumpListCategory(const JumpListCategory&) = default;
|
||||
JumpListCategory::~JumpListCategory() = default;
|
||||
|
||||
JumpList::JumpList(const std::u16string& app_id) : app_id_(app_id) {
|
||||
JumpList::JumpList(const std::wstring& app_id) : app_id_(app_id) {
|
||||
destinations_.CoCreateInstance(CLSID_DestinationList);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,9 +46,9 @@ struct JumpListItem {
|
|||
// For tasks this is the path to the program executable, for file links this
|
||||
// is the full filename.
|
||||
base::FilePath path;
|
||||
std::u16string arguments;
|
||||
std::u16string title;
|
||||
std::u16string description;
|
||||
std::wstring arguments;
|
||||
std::wstring title;
|
||||
std::wstring description;
|
||||
base::FilePath working_dir;
|
||||
base::FilePath icon_path;
|
||||
int icon_index = 0;
|
||||
|
@ -73,7 +73,7 @@ struct JumpListCategory {
|
|||
};
|
||||
|
||||
Type type = Type::kTasks;
|
||||
std::u16string name;
|
||||
std::wstring name;
|
||||
std::vector<JumpListItem> items;
|
||||
|
||||
JumpListCategory();
|
||||
|
@ -88,7 +88,7 @@ class JumpList {
|
|||
// |app_id| must be the Application User Model ID of the app for which the
|
||||
// custom Jump List should be created/removed, it's usually obtained by
|
||||
// calling GetCurrentProcessExplicitAppUserModelID().
|
||||
explicit JumpList(const std::u16string& app_id);
|
||||
explicit JumpList(const std::wstring& app_id);
|
||||
~JumpList();
|
||||
|
||||
// Starts a new transaction, must be called before appending any categories,
|
||||
|
@ -111,7 +111,7 @@ class JumpList {
|
|||
const std::vector<JumpListCategory>& categories);
|
||||
|
||||
private:
|
||||
std::u16string app_id_;
|
||||
std::wstring app_id_;
|
||||
CComPtr<ICustomDestinationList> destinations_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(JumpList);
|
||||
|
|
|
@ -141,7 +141,7 @@ void NotifyIcon::SetToolTip(const std::string& tool_tip) {
|
|||
NOTIFYICONDATA icon_data;
|
||||
InitIconData(&icon_data);
|
||||
icon_data.uFlags |= NIF_TIP;
|
||||
wcsncpy_s(icon_data.szTip, base::UTF8ToUTF16(tool_tip).c_str(), _TRUNCATE);
|
||||
wcsncpy_s(icon_data.szTip, base::UTF8ToWide(tool_tip).c_str(), _TRUNCATE);
|
||||
BOOL result = Shell_NotifyIcon(NIM_MODIFY, &icon_data);
|
||||
if (!result)
|
||||
LOG(WARNING) << "Unable to set tooltip for status tray icon";
|
||||
|
@ -151,8 +151,10 @@ void NotifyIcon::DisplayBalloon(const BalloonOptions& options) {
|
|||
NOTIFYICONDATA icon_data;
|
||||
InitIconData(&icon_data);
|
||||
icon_data.uFlags |= NIF_INFO;
|
||||
wcsncpy_s(icon_data.szInfoTitle, options.title.c_str(), _TRUNCATE);
|
||||
wcsncpy_s(icon_data.szInfo, options.content.c_str(), _TRUNCATE);
|
||||
wcsncpy_s(icon_data.szInfoTitle, base::UTF16ToWide(options.title).c_str(),
|
||||
_TRUNCATE);
|
||||
wcsncpy_s(icon_data.szInfo, base::UTF16ToWide(options.content).c_str(),
|
||||
_TRUNCATE);
|
||||
icon_data.uTimeout = 0;
|
||||
icon_data.hBalloonIcon = options.icon;
|
||||
icon_data.dwInfoFlags = ConvertIconType(options.icon_type);
|
||||
|
|
|
@ -104,7 +104,7 @@ bool TaskbarHost::SetThumbarButtons(HWND window,
|
|||
// Set tooltip.
|
||||
if (!button.tooltip.empty()) {
|
||||
thumb_button.dwMask |= THB_TOOLTIP;
|
||||
wcsncpy_s(thumb_button.szTip, base::UTF8ToUTF16(button.tooltip).c_str(),
|
||||
wcsncpy_s(thumb_button.szTip, base::UTF8ToWide(button.tooltip).c_str(),
|
||||
_TRUNCATE);
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ bool TaskbarHost::SetOverlayIcon(HWND window,
|
|||
|
||||
base::win::ScopedHICON icon(IconUtil::CreateHICONFromSkBitmap(overlay));
|
||||
return SUCCEEDED(taskbar_->SetOverlayIcon(window, icon.get(),
|
||||
base::UTF8ToUTF16(text).c_str()));
|
||||
base::UTF8ToWide(text).c_str()));
|
||||
}
|
||||
|
||||
bool TaskbarHost::SetThumbnailClip(HWND window, const gfx::Rect& region) {
|
||||
|
@ -193,8 +193,8 @@ bool TaskbarHost::SetThumbnailToolTip(HWND window, const std::string& tooltip) {
|
|||
if (!InitializeTaskbar())
|
||||
return false;
|
||||
|
||||
return SUCCEEDED(taskbar_->SetThumbnailTooltip(
|
||||
window, base::UTF8ToUTF16(tooltip).c_str()));
|
||||
return SUCCEEDED(
|
||||
taskbar_->SetThumbnailTooltip(window, base::UTF8ToWide(tooltip).c_str()));
|
||||
}
|
||||
|
||||
bool TaskbarHost::HandleThumbarButtonEvent(int button_id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue