]> khamidou — GitHub mirrors - electron.git/commitdiff
ThumbarHost => TaskbarHost
authorCheng Zhao <zcbenz@gmail.com>
Thu, 6 Aug 2015 02:30:22 +0000 (10:30 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 6 Aug 2015 02:30:22 +0000 (10:30 +0800)
atom/browser/native_window_views.cc
atom/browser/native_window_views.h
atom/browser/ui/win/taskbar_host.cc [moved from atom/browser/ui/win/thumbar_host.cc with 94% similarity]
atom/browser/ui/win/taskbar_host.h [moved from atom/browser/ui/win/thumbar_host.h with 72% similarity]
filenames.gypi

index 09e10608d271b379cca5e2cd9e0b62edaff87628..c7fd0b8b3524038e54ec8b71959cc04fb123f905 100644 (file)
@@ -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<NativeWindow::ThumbarButton>& 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;
 }
index 647467548d9db62006ce358089b4a933c20e8a18..0cc79facab12d54a7a17701d8d6c40728ff78231 100644 (file)
@@ -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<ThumbarHost> thumbar_host_;
+  // In charge of running taskbar related APIs.
+  scoped_ptr<TaskbarHost> taskbar_host_;
 #endif
 
   // Handles unhandled keyboard messages coming back from the renderer process.
similarity index 94%
rename from atom/browser/ui/win/thumbar_host.cc
rename to atom/browser/ui/win/taskbar_host.cc
index af57ef4e5c6405e2978532025400b3f41a430129..6f74a7d9cb37011d5deb979ec2afc78279006ec2 100644 (file)
@@ -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 <shobjidl.h>
 
@@ -58,14 +58,14 @@ bool GetThumbarButtonFlags(const std::vector<std::string>& 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<atom::NativeWindow::ThumbarButton>& 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];
similarity index 72%
rename from atom/browser/ui/win/thumbar_host.h
rename to atom/browser/ui/win/taskbar_host.h
index d14bbaeda3054ca0611f0e4c495551d1f91192d3..e0a9dc89ff4b7a26d03e77bbaa65265e5379dff9 100644 (file)
@@ -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 <windows.h>
 
 
 namespace atom {
 
-class ThumbarHost {
+class TaskbarHost {
  public:
-  explicit ThumbarHost(HWND window);
-  ~ThumbarHost();
+  explicit TaskbarHost(HWND window);
+  ~TaskbarHost();
 
   bool SetThumbarButtons(
       const std::vector<NativeWindow::ThumbarButton>& 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_
index 40832b74f6a31d1503815c6b9acb34a7b607264a..f7b9fca5e7170872880de00fcf9b9accae394d67 100644 (file)
       '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',