ThumbarHost => TaskbarHost
This commit is contained in:
parent
39af10cc8d
commit
8f8c3aef87
5 changed files with 23 additions and 23 deletions
|
@ -46,7 +46,7 @@
|
||||||
#elif defined(OS_WIN)
|
#elif defined(OS_WIN)
|
||||||
#include "atom/browser/ui/views/win_frame_view.h"
|
#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/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/scoped_comptr.h"
|
||||||
#include "base/win/windows_version.h"
|
#include "base/win/windows_version.h"
|
||||||
#include "ui/base/win/shell.h"
|
#include "ui/base/win/shell.h"
|
||||||
|
@ -721,9 +721,9 @@ bool NativeWindowViews::IsVisibleOnAllWorkspaces() {
|
||||||
bool NativeWindowViews::SetThumbarButtons(
|
bool NativeWindowViews::SetThumbarButtons(
|
||||||
const std::vector<NativeWindow::ThumbarButton>& buttons) {
|
const std::vector<NativeWindow::ThumbarButton>& buttons) {
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
if (!thumbar_host_)
|
if (!taskbar_host_)
|
||||||
thumbar_host_.reset(new ThumbarHost(GetAcceleratedWidget()));
|
taskbar_host_.reset(new TaskbarHost(GetAcceleratedWidget()));
|
||||||
return thumbar_host_->SetThumbarButtons(buttons);
|
return taskbar_host_->SetThumbarButtons(buttons);
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
@ -895,8 +895,8 @@ bool NativeWindowViews::PreHandleMSG(
|
||||||
UINT message, WPARAM w_param, LPARAM l_param, LRESULT* result) {
|
UINT message, WPARAM w_param, LPARAM l_param, LRESULT* result) {
|
||||||
// Handle thumbar button click message.
|
// Handle thumbar button click message.
|
||||||
if (message == WM_COMMAND && HIWORD(w_param) == THBN_CLICKED &&
|
if (message == WM_COMMAND && HIWORD(w_param) == THBN_CLICKED &&
|
||||||
thumbar_host_)
|
taskbar_host_)
|
||||||
return thumbar_host_->HandleThumbarButtonEvent(LOWORD(w_param));
|
return taskbar_host_->HandleThumbarButtonEvent(LOWORD(w_param));
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ class WindowStateWatcher;
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
class AtomDesktopWindowTreeHostWin;
|
class AtomDesktopWindowTreeHostWin;
|
||||||
class ThumbarHost;
|
class TaskbarHost;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class NativeWindowViews : public NativeWindow,
|
class NativeWindowViews : public NativeWindow,
|
||||||
|
@ -179,8 +179,8 @@ class NativeWindowViews : public NativeWindow,
|
||||||
// Records window was whether restored from minimized state or maximized
|
// Records window was whether restored from minimized state or maximized
|
||||||
// state.
|
// state.
|
||||||
bool is_minimized_;
|
bool is_minimized_;
|
||||||
// In charge of running thumbar related APIs.
|
// In charge of running taskbar related APIs.
|
||||||
scoped_ptr<ThumbarHost> thumbar_host_;
|
scoped_ptr<TaskbarHost> taskbar_host_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Handles unhandled keyboard messages coming back from the renderer process.
|
// Handles unhandled keyboard messages coming back from the renderer process.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Use of this source code is governed by the MIT license that can be
|
// Use of this source code is governed by the MIT license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "atom/browser/ui/win/thumbar_host.h"
|
#include "atom/browser/ui/win/taskbar_host.h"
|
||||||
|
|
||||||
#include <shobjidl.h>
|
#include <shobjidl.h>
|
||||||
|
|
||||||
|
@ -58,14 +58,14 @@ bool GetThumbarButtonFlags(const std::vector<std::string>& flags,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
ThumbarHost::ThumbarHost(HWND window) : is_initialized_(false),
|
TaskbarHost::TaskbarHost(HWND window) : is_initialized_(false),
|
||||||
window_(window) {
|
window_(window) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ThumbarHost::~ThumbarHost() {
|
TaskbarHost::~TaskbarHost() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ThumbarHost::SetThumbarButtons(
|
bool TaskbarHost::SetThumbarButtons(
|
||||||
const std::vector<atom::NativeWindow::ThumbarButton>& buttons) {
|
const std::vector<atom::NativeWindow::ThumbarButton>& buttons) {
|
||||||
if (buttons.size() > kMaxButtonsCount)
|
if (buttons.size() > kMaxButtonsCount)
|
||||||
return false;
|
return false;
|
||||||
|
@ -127,7 +127,7 @@ bool ThumbarHost::SetThumbarButtons(
|
||||||
return is_success;
|
return is_success;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ThumbarHost::HandleThumbarButtonEvent(int button_id) {
|
bool TaskbarHost::HandleThumbarButtonEvent(int button_id) {
|
||||||
if (thumbar_button_clicked_callback_map_.find(button_id) !=
|
if (thumbar_button_clicked_callback_map_.find(button_id) !=
|
||||||
thumbar_button_clicked_callback_map_.end()) {
|
thumbar_button_clicked_callback_map_.end()) {
|
||||||
auto callback = thumbar_button_clicked_callback_map_[button_id];
|
auto callback = thumbar_button_clicked_callback_map_[button_id];
|
|
@ -2,8 +2,8 @@
|
||||||
// Use of this source code is governed by the MIT license that can be
|
// Use of this source code is governed by the MIT license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef ATOM_BROWSER_UI_WIN_THUMBAR_HOST_H_
|
#ifndef ATOM_BROWSER_UI_WIN_TASKBAR_HOST_H_
|
||||||
#define ATOM_BROWSER_UI_WIN_THUMBAR_HOST_H_
|
#define ATOM_BROWSER_UI_WIN_TASKBAR_HOST_H_
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
@ -14,10 +14,10 @@
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
class ThumbarHost {
|
class TaskbarHost {
|
||||||
public:
|
public:
|
||||||
explicit ThumbarHost(HWND window);
|
explicit TaskbarHost(HWND window);
|
||||||
~ThumbarHost();
|
~TaskbarHost();
|
||||||
|
|
||||||
bool SetThumbarButtons(
|
bool SetThumbarButtons(
|
||||||
const std::vector<NativeWindow::ThumbarButton>& buttons);
|
const std::vector<NativeWindow::ThumbarButton>& buttons);
|
||||||
|
@ -32,9 +32,9 @@ class ThumbarHost {
|
||||||
|
|
||||||
HWND window_;
|
HWND window_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ThumbarHost);
|
DISALLOW_COPY_AND_ASSIGN(TaskbarHost);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
||||||
#endif // ATOM_BROWSER_UI_WIN_THUMBAR_HOST_H_
|
#endif // ATOM_BROWSER_UI_WIN_TASKBAR_HOST_H_
|
|
@ -210,8 +210,8 @@
|
||||||
'atom/browser/ui/win/notify_icon_host.h',
|
'atom/browser/ui/win/notify_icon_host.h',
|
||||||
'atom/browser/ui/win/notify_icon.cc',
|
'atom/browser/ui/win/notify_icon.cc',
|
||||||
'atom/browser/ui/win/notify_icon.h',
|
'atom/browser/ui/win/notify_icon.h',
|
||||||
'atom/browser/ui/win/thumbar_host.cc',
|
'atom/browser/ui/win/taskbar_host.cc',
|
||||||
'atom/browser/ui/win/thumbar_host.h',
|
'atom/browser/ui/win/taskbar_host.h',
|
||||||
'atom/browser/ui/x/window_state_watcher.cc',
|
'atom/browser/ui/x/window_state_watcher.cc',
|
||||||
'atom/browser/ui/x/window_state_watcher.h',
|
'atom/browser/ui/x/window_state_watcher.h',
|
||||||
'atom/browser/ui/x/x_window_utils.cc',
|
'atom/browser/ui/x/x_window_utils.cc',
|
||||||
|
|
Loading…
Reference in a new issue