OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/widget/native_widget_win.h" | 5 #include "views/widget/native_widget_win.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 is_right_mouse_pressed_on_caption_(false), | 385 is_right_mouse_pressed_on_caption_(false), |
386 restored_enabled_(false) { | 386 restored_enabled_(false) { |
387 } | 387 } |
388 | 388 |
389 NativeWidgetWin::~NativeWidgetWin() { | 389 NativeWidgetWin::~NativeWidgetWin() { |
390 // We need to delete the input method before calling DestroyRootView(), | 390 // We need to delete the input method before calling DestroyRootView(), |
391 // because it'll set focus_manager_ to NULL. | 391 // because it'll set focus_manager_ to NULL. |
392 input_method_.reset(); | 392 input_method_.reset(); |
393 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) | 393 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) |
394 delete delegate_; | 394 delete delegate_; |
| 395 else |
| 396 CloseNow(); |
395 } | 397 } |
396 | 398 |
397 // static | 399 // static |
398 bool NativeWidgetWin::IsAeroGlassEnabled() { | 400 bool NativeWidgetWin::IsAeroGlassEnabled() { |
399 if (base::win::GetVersion() < base::win::VERSION_VISTA) | 401 if (base::win::GetVersion() < base::win::VERSION_VISTA) |
400 return false; | 402 return false; |
401 // If composition is not enabled, we behave like on XP. | 403 // If composition is not enabled, we behave like on XP. |
402 BOOL enabled = FALSE; | 404 BOOL enabled = FALSE; |
403 return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; | 405 return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; |
404 } | 406 } |
(...skipping 2127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2532 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2534 return (GetKeyState(VK_LBUTTON) & 0x80) || |
2533 (GetKeyState(VK_RBUTTON) & 0x80) || | 2535 (GetKeyState(VK_RBUTTON) & 0x80) || |
2534 (GetKeyState(VK_MBUTTON) & 0x80) || | 2536 (GetKeyState(VK_MBUTTON) & 0x80) || |
2535 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2537 (GetKeyState(VK_XBUTTON1) & 0x80) || |
2536 (GetKeyState(VK_XBUTTON2) & 0x80); | 2538 (GetKeyState(VK_XBUTTON2) & 0x80); |
2537 } | 2539 } |
2538 | 2540 |
2539 } // namespace internal | 2541 } // namespace internal |
2540 | 2542 |
2541 } // namespace views | 2543 } // namespace views |
OLD | NEW |