Move atom_desktop_window_tree_host_win to atom/browser/ui/win directory.

This commit is contained in:
Haojian Wu 2015-08-05 13:04:21 +08:00
parent ad01a1731a
commit dfd076a3e5
3 changed files with 5 additions and 5 deletions

View file

@ -0,0 +1,44 @@
// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/ui/win/atom_desktop_window_tree_host_win.h"
#include "atom/browser/ui/win/thumbar_host.h"
namespace atom {
AtomDesktopWindowTreeHostWin::AtomDesktopWindowTreeHostWin(
views::internal::NativeWidgetDelegate* native_widget_delegate,
views::DesktopNativeWidgetAura* desktop_native_widget_aura)
: views::DesktopWindowTreeHostWin(native_widget_delegate,
desktop_native_widget_aura) {
}
AtomDesktopWindowTreeHostWin::~AtomDesktopWindowTreeHostWin() {
}
bool AtomDesktopWindowTreeHostWin::SetThumbarButtons(
HWND window,
const std::vector<ThumbarHost::ThumbarButton>& buttons) {
if (!thumbar_host_.get()) {
thumbar_host_.reset(new ThumbarHost(window));
}
return thumbar_host_->SetThumbarButtons(buttons);
}
bool AtomDesktopWindowTreeHostWin::PreHandleMSG(UINT message,
WPARAM w_param,
LPARAM l_param,
LRESULT* result) {
switch (message) {
case WM_COMMAND: {
int id = LOWORD(w_param);
if (thumbar_host_ && thumbar_host_->HandleThumbarButtonEvent(id))
return true;
}
}
return false;
}
} // namespace atom

View file

@ -0,0 +1,41 @@
// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_UI_WIN_ATOM_DESKTOP_WINDOW_TREE_HOST_WIN_H_
#define ATOM_BROWSER_UI_WIN_ATOM_DESKTOP_WINDOW_TREE_HOST_WIN_H_
#include <windows.h>
#include <vector>
#include "atom/browser/ui/win/thumbar_host.h"
#include "base/memory/scoped_ptr.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h"
namespace atom {
class AtomDesktopWindowTreeHostWin : public views::DesktopWindowTreeHostWin {
public:
AtomDesktopWindowTreeHostWin(
views::internal::NativeWidgetDelegate* native_widget_delegate,
views::DesktopNativeWidgetAura* desktop_native_widget_aura);
~AtomDesktopWindowTreeHostWin();
bool SetThumbarButtons(
HWND window,
const std::vector<ThumbarHost::ThumbarButton>& buttons);
protected:
bool PreHandleMSG(UINT message,
WPARAM w_param,
LPARAM l_param,
LRESULT* result) override;
private:
scoped_ptr<ThumbarHost> thumbar_host_;
};
} // namespace atom
#endif // ATOM_BROWSER_UI_WIN_ATOM_DESKTOP_WINDOW_TREE_HOST_WIN_H_