diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index ce56c0da3..d6f807246 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -35,6 +35,7 @@ using atom::Browser; namespace mate { +#if defined(OS_WIN) template<> struct Converter { static bool FromV8(v8::Isolate* isolate, v8::Handle val, @@ -45,11 +46,15 @@ struct Converter { if (!dict.Get("program", &(out->program)) || !dict.Get("title", &(out->title))) return false; + if (dict.Get("iconPath", &(out->icon_path)) && + !dict.Get("iconIndex", &(out->icon_index))) + return false; dict.Get("arguments", &(out->arguments)); dict.Get("description", &(out->description)); return true; } }; +#endif } // namespace mate diff --git a/atom/browser/browser.h b/atom/browser/browser.h index 69f61da84..a22680acd 100644 --- a/atom/browser/browser.h +++ b/atom/browser/browser.h @@ -91,6 +91,8 @@ class Browser : public WindowListObserver { base::string16 arguments; base::string16 title; base::string16 description; + base::FilePath icon_path; + int icon_index; }; // Add a custom task to jump list. diff --git a/atom/browser/browser_win.cc b/atom/browser/browser_win.cc index 9e4db535b..c8620f265 100644 --- a/atom/browser/browser_win.cc +++ b/atom/browser/browser_win.cc @@ -96,6 +96,11 @@ void Browser::AddUserTasks(const std::vector& tasks) { FAILED(link->SetDescription(task.description.c_str()))) return; + if (!task.icon_path.empty() && + FAILED(link->SetIconLocation(task.icon_path.value().c_str(), + task.icon_index))) + return; + CComQIPtr property_store = link; if (!base::win::SetStringValueForPropertyStore(property_store, PKEY_Title, task.title.c_str()))