Refactor code in taskbarHost

This commit is contained in:
Cheng Zhao 2015-08-06 12:44:07 +08:00
parent a28f70e85c
commit 958658513c
5 changed files with 92 additions and 88 deletions

View file

@ -438,16 +438,18 @@ void Window::SetOverlayIcon(const gfx::Image& overlay,
window_->SetOverlayIcon(overlay, description);
}
void Window::SetThumbarButtons(mate::Arguments* args) {
bool Window::SetThumbarButtons(mate::Arguments* args) {
#if defined(OS_WIN)
std::vector<TaskbarHost::ThumbarButton> buttons;
if (!args->GetNext(&buttons)) {
args->ThrowError();
return;
return false;
}
auto window = static_cast<NativeWindowViews*>(window_.get());
window->taskbar_host().SetThumbarButtons(window->GetAcceleratedWidget(),
buttons);
return window->taskbar_host().SetThumbarButtons(
window->GetAcceleratedWidget(), buttons);
#else
return false;
#endif
}

View file

@ -130,7 +130,7 @@ class Window : public mate::TrackableObject<Window>,
void SetProgressBar(double progress);
void SetOverlayIcon(const gfx::Image& overlay,
const std::string& description);
void SetThumbarButtons(mate::Arguments* args);
bool SetThumbarButtons(mate::Arguments* args);
void SetMenu(v8::Isolate* isolate, v8::Local<v8::Value> menu);
void SetAutoHideMenuBar(bool auto_hide);
bool IsMenuBarAutoHide();