Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: ash/host/ash_window_tree_host_win.cc

Issue 1390883003: aura: Unify WindowTreeHost for some platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ozone GN Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/host/ash_window_tree_host_win.cc
diff --git a/ash/host/ash_window_tree_host_win.cc b/ash/host/ash_window_tree_host_win.cc
index e69769ca6a55fe8e3f789ad0bfb5c5252ccd98e4..d716bbed169b54384c413a616d40c4f6d75dcc51 100644
--- a/ash/host/ash_window_tree_host_win.cc
+++ b/ash/host/ash_window_tree_host_win.cc
@@ -13,7 +13,7 @@
#include "ash/ime/input_method_event_handler.h"
#include "base/command_line.h"
#include "base/win/windows_version.h"
-#include "ui/aura/window_tree_host_win.h"
+#include "ui/aura/window_tree_host_platform.h"
#include "ui/events/event_processor.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/transform.h"
@@ -22,10 +22,10 @@ namespace ash {
namespace {
class AshWindowTreeHostWin : public AshWindowTreeHost,
- public aura::WindowTreeHostWin {
+ public aura::WindowTreeHostPlatform {
public:
explicit AshWindowTreeHostWin(const gfx::Rect& initial_bounds)
- : aura::WindowTreeHostWin(initial_bounds),
+ : aura::WindowTreeHostPlatform(initial_bounds),
fullscreen_(false),
saved_window_style_(0),
saved_window_ex_style_(0),
@@ -38,36 +38,31 @@ class AshWindowTreeHostWin : public AshWindowTreeHost,
// AshWindowTreeHost:
void ToggleFullScreen() override {
gfx::Rect target_rect;
+ gfx::AcceleratedWidget hwnd = hwnd;
if (!fullscreen_) {
fullscreen_ = true;
- saved_window_style_ = GetWindowLong(hwnd(), GWL_STYLE);
- saved_window_ex_style_ = GetWindowLong(hwnd(), GWL_EXSTYLE);
- GetWindowRect(hwnd(), &saved_window_rect_);
- SetWindowLong(hwnd(),
- GWL_STYLE,
+ saved_window_style_ = GetWindowLong(hwnd, GWL_STYLE);
+ saved_window_ex_style_ = GetWindowLong(hwnd, GWL_EXSTYLE);
+ GetWindowRect(hwnd, &saved_window_rect_);
+ SetWindowLong(hwnd, GWL_STYLE,
saved_window_style_ & ~(WS_CAPTION | WS_THICKFRAME));
- SetWindowLong(
- hwnd(),
- GWL_EXSTYLE,
- saved_window_ex_style_ & ~(WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE |
- WS_EX_CLIENTEDGE | WS_EX_STATICEDGE));
+ SetWindowLong(hwnd, GWL_EXSTYLE,
+ saved_window_ex_style_ &
+ ~(WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE |
+ WS_EX_CLIENTEDGE | WS_EX_STATICEDGE));
MONITORINFO mi;
mi.cbSize = sizeof(mi);
- GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTONEAREST), &mi);
+ GetMonitorInfo(MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST), &mi);
target_rect = gfx::Rect(mi.rcMonitor);
} else {
fullscreen_ = false;
- SetWindowLong(hwnd(), GWL_STYLE, saved_window_style_);
- SetWindowLong(hwnd(), GWL_EXSTYLE, saved_window_ex_style_);
+ SetWindowLong(hwnd, GWL_STYLE, saved_window_style_);
+ SetWindowLong(hwnd, GWL_EXSTYLE, saved_window_ex_style_);
target_rect = gfx::Rect(saved_window_rect_);
}
- SetWindowPos(hwnd(),
- NULL,
- target_rect.x(),
- target_rect.y(),
- target_rect.width(),
- target_rect.height(),
+ SetWindowPos(hwnd, NULL, target_rect.x(), target_rect.y(),
+ target_rect.width(), target_rect.height(),
SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED);
}
bool ConfineCursorToRootWindow() override { return false; }

Powered by Google App Engine
This is Rietveld 408576698