From 8f8c3aef878f54698b847bd0d4a551a686582539 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 6 Aug 2015 10:30:22 +0800 Subject: [PATCH] ThumbarHost => TaskbarHost --- atom/browser/native_window_views.cc | 12 ++++++------ atom/browser/native_window_views.h | 6 +++--- .../ui/win/{thumbar_host.cc => taskbar_host.cc} | 10 +++++----- .../ui/win/{thumbar_host.h => taskbar_host.h} | 14 +++++++------- filenames.gypi | 4 ++-- 5 files changed, 23 insertions(+), 23 deletions(-) rename atom/browser/ui/win/{thumbar_host.cc => taskbar_host.cc} (94%) rename atom/browser/ui/win/{thumbar_host.h => taskbar_host.h} (72%) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 09e10608d27..c7fd0b8b352 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -46,7 +46,7 @@ #elif defined(OS_WIN) #include "atom/browser/ui/views/win_frame_view.h" #include "atom/browser/ui/win/atom_desktop_window_tree_host_win.h" -#include "atom/browser/ui/win/thumbar_host.h" +#include "atom/browser/ui/win/taskbar_host.h" #include "base/win/scoped_comptr.h" #include "base/win/windows_version.h" #include "ui/base/win/shell.h" @@ -721,9 +721,9 @@ bool NativeWindowViews::IsVisibleOnAllWorkspaces() { bool NativeWindowViews::SetThumbarButtons( const std::vector& buttons) { #if defined(OS_WIN) - if (!thumbar_host_) - thumbar_host_.reset(new ThumbarHost(GetAcceleratedWidget())); - return thumbar_host_->SetThumbarButtons(buttons); + if (!taskbar_host_) + taskbar_host_.reset(new TaskbarHost(GetAcceleratedWidget())); + return taskbar_host_->SetThumbarButtons(buttons); #else return false; #endif @@ -895,8 +895,8 @@ bool NativeWindowViews::PreHandleMSG( UINT message, WPARAM w_param, LPARAM l_param, LRESULT* result) { // Handle thumbar button click message. if (message == WM_COMMAND && HIWORD(w_param) == THBN_CLICKED && - thumbar_host_) - return thumbar_host_->HandleThumbarButtonEvent(LOWORD(w_param)); + taskbar_host_) + return taskbar_host_->HandleThumbarButtonEvent(LOWORD(w_param)); else return false; } diff --git a/atom/browser/native_window_views.h b/atom/browser/native_window_views.h index 647467548d9..0cc79facab1 100644 --- a/atom/browser/native_window_views.h +++ b/atom/browser/native_window_views.h @@ -30,7 +30,7 @@ class WindowStateWatcher; #if defined(OS_WIN) class AtomDesktopWindowTreeHostWin; -class ThumbarHost; +class TaskbarHost; #endif class NativeWindowViews : public NativeWindow, @@ -179,8 +179,8 @@ class NativeWindowViews : public NativeWindow, // Records window was whether restored from minimized state or maximized // state. bool is_minimized_; - // In charge of running thumbar related APIs. - scoped_ptr thumbar_host_; + // In charge of running taskbar related APIs. + scoped_ptr taskbar_host_; #endif // Handles unhandled keyboard messages coming back from the renderer process. diff --git a/atom/browser/ui/win/thumbar_host.cc b/atom/browser/ui/win/taskbar_host.cc similarity index 94% rename from atom/browser/ui/win/thumbar_host.cc rename to atom/browser/ui/win/taskbar_host.cc index af57ef4e5c6..6f74a7d9cb3 100644 --- a/atom/browser/ui/win/thumbar_host.cc +++ b/atom/browser/ui/win/taskbar_host.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "atom/browser/ui/win/thumbar_host.h" +#include "atom/browser/ui/win/taskbar_host.h" #include @@ -58,14 +58,14 @@ bool GetThumbarButtonFlags(const std::vector& flags, } // namespace -ThumbarHost::ThumbarHost(HWND window) : is_initialized_(false), +TaskbarHost::TaskbarHost(HWND window) : is_initialized_(false), window_(window) { } -ThumbarHost::~ThumbarHost() { +TaskbarHost::~TaskbarHost() { } -bool ThumbarHost::SetThumbarButtons( +bool TaskbarHost::SetThumbarButtons( const std::vector& buttons) { if (buttons.size() > kMaxButtonsCount) return false; @@ -127,7 +127,7 @@ bool ThumbarHost::SetThumbarButtons( return is_success; } -bool ThumbarHost::HandleThumbarButtonEvent(int button_id) { +bool TaskbarHost::HandleThumbarButtonEvent(int button_id) { if (thumbar_button_clicked_callback_map_.find(button_id) != thumbar_button_clicked_callback_map_.end()) { auto callback = thumbar_button_clicked_callback_map_[button_id]; diff --git a/atom/browser/ui/win/thumbar_host.h b/atom/browser/ui/win/taskbar_host.h similarity index 72% rename from atom/browser/ui/win/thumbar_host.h rename to atom/browser/ui/win/taskbar_host.h index d14bbaeda30..e0a9dc89ff4 100644 --- a/atom/browser/ui/win/thumbar_host.h +++ b/atom/browser/ui/win/taskbar_host.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef ATOM_BROWSER_UI_WIN_THUMBAR_HOST_H_ -#define ATOM_BROWSER_UI_WIN_THUMBAR_HOST_H_ +#ifndef ATOM_BROWSER_UI_WIN_TASKBAR_HOST_H_ +#define ATOM_BROWSER_UI_WIN_TASKBAR_HOST_H_ #include @@ -14,10 +14,10 @@ namespace atom { -class ThumbarHost { +class TaskbarHost { public: - explicit ThumbarHost(HWND window); - ~ThumbarHost(); + explicit TaskbarHost(HWND window); + ~TaskbarHost(); bool SetThumbarButtons( const std::vector& buttons); @@ -32,9 +32,9 @@ class ThumbarHost { HWND window_; - DISALLOW_COPY_AND_ASSIGN(ThumbarHost); + DISALLOW_COPY_AND_ASSIGN(TaskbarHost); }; } // namespace atom -#endif // ATOM_BROWSER_UI_WIN_THUMBAR_HOST_H_ +#endif // ATOM_BROWSER_UI_WIN_TASKBAR_HOST_H_ diff --git a/filenames.gypi b/filenames.gypi index 40832b74f6a..f7b9fca5e71 100644 --- a/filenames.gypi +++ b/filenames.gypi @@ -210,8 +210,8 @@ 'atom/browser/ui/win/notify_icon_host.h', 'atom/browser/ui/win/notify_icon.cc', 'atom/browser/ui/win/notify_icon.h', - 'atom/browser/ui/win/thumbar_host.cc', - 'atom/browser/ui/win/thumbar_host.h', + 'atom/browser/ui/win/taskbar_host.cc', + 'atom/browser/ui/win/taskbar_host.h', 'atom/browser/ui/x/window_state_watcher.cc', 'atom/browser/ui/x/window_state_watcher.h', 'atom/browser/ui/x/x_window_utils.cc',