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)
|
||||
#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;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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];
|
|
@ -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>
|
||||
|
||||
|
@ -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<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_
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue