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

Side by Side Diff: ui/aura/root_window_host_win.cc

Issue 10789018: aura: Add X11 host window management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keep ash switches alphabetized. Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/root_window_host_win.h" 5 #include "ui/aura/root_window_host_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 144 }
145 145
146 RootWindow* RootWindowHostWin::GetRootWindow() { 146 RootWindow* RootWindowHostWin::GetRootWindow() {
147 return root_window_; 147 return root_window_;
148 } 148 }
149 149
150 gfx::AcceleratedWidget RootWindowHostWin::GetAcceleratedWidget() { 150 gfx::AcceleratedWidget RootWindowHostWin::GetAcceleratedWidget() {
151 return hwnd(); 151 return hwnd();
152 } 152 }
153 153
154 gfx::AcceleratedWidget RootWindowHostWin::
155 GetAcceleratedWidgetUsedForEvents() {
156 return hwnd();
157 }
158
154 void RootWindowHostWin::Show() { 159 void RootWindowHostWin::Show() {
155 ShowWindow(hwnd(), SW_SHOWNORMAL); 160 ShowWindow(hwnd(), SW_SHOWNORMAL);
156 } 161 }
157 162
158 void RootWindowHostWin::ToggleFullScreen() { 163 void RootWindowHostWin::ToggleFullScreen() {
159 gfx::Rect target_rect; 164 gfx::Rect target_rect;
160 if (!fullscreen_) { 165 if (!fullscreen_) {
161 fullscreen_ = true; 166 fullscreen_ = true;
162 saved_window_style_ = GetWindowLong(hwnd(), GWL_STYLE); 167 saved_window_style_ = GetWindowLong(hwnd(), GWL_STYLE);
163 saved_window_ex_style_ = GetWindowLong(hwnd(), GWL_EXSTYLE); 168 saved_window_ex_style_ = GetWindowLong(hwnd(), GWL_EXSTYLE);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 void RootWindowHostWin::PostNativeEvent(const base::NativeEvent& native_event) { 297 void RootWindowHostWin::PostNativeEvent(const base::NativeEvent& native_event) {
293 ::PostMessage( 298 ::PostMessage(
294 hwnd(), native_event.message, native_event.wParam, native_event.lParam); 299 hwnd(), native_event.message, native_event.wParam, native_event.lParam);
295 } 300 }
296 301
297 void RootWindowHostWin::OnDeviceScaleFactorChanged( 302 void RootWindowHostWin::OnDeviceScaleFactorChanged(
298 float device_scale_factor) { 303 float device_scale_factor) {
299 NOTIMPLEMENTED(); 304 NOTIMPLEMENTED();
300 } 305 }
301 306
307 bool RootWindowHostWin::DispatchNativeEvent(
308 const base::NativeEvent& native_event) {
309 return false;
310 }
311
302 void RootWindowHostWin::OnClose() { 312 void RootWindowHostWin::OnClose() {
303 // TODO: this obviously shouldn't be here. 313 // TODO: this obviously shouldn't be here.
304 MessageLoopForUI::current()->Quit(); 314 MessageLoopForUI::current()->Quit();
305 } 315 }
306 316
307 LRESULT RootWindowHostWin::OnKeyEvent(UINT message, 317 LRESULT RootWindowHostWin::OnKeyEvent(UINT message,
308 WPARAM w_param, 318 WPARAM w_param,
309 LPARAM l_param) { 319 LPARAM l_param) {
310 MSG msg = { hwnd(), message, w_param, l_param }; 320 MSG msg = { hwnd(), message, w_param, l_param };
311 KeyEvent keyev(msg, message == WM_CHAR); 321 KeyEvent keyev(msg, message == WM_CHAR);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 354 }
345 355
346 void RootWindowHostWin::OnSize(UINT param, const CSize& size) { 356 void RootWindowHostWin::OnSize(UINT param, const CSize& size) {
347 // Minimizing resizes the window to 0x0 which causes our layout to go all 357 // Minimizing resizes the window to 0x0 which causes our layout to go all
348 // screwy, so we just ignore it. 358 // screwy, so we just ignore it.
349 if (param != SIZE_MINIMIZED) 359 if (param != SIZE_MINIMIZED)
350 root_window_->OnHostResized(gfx::Size(size.cx, size.cy)); 360 root_window_->OnHostResized(gfx::Size(size.cx, size.cy));
351 } 361 }
352 362
353 } // namespace aura 363 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698