| 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 "ui/views/widget/native_widget_win.h" | 5 #include "ui/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 <algorithm> | 10 #include <algorithm> |
| (...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 // We should attach IMEs only when we need to input CJK strings. | 1157 // We should attach IMEs only when we need to input CJK strings. |
| 1158 ImmAssociateContextEx(hwnd(), NULL, 0); | 1158 ImmAssociateContextEx(hwnd(), NULL, 0); |
| 1159 | 1159 |
| 1160 // We need to allow the delegate to size its contents since the window may not | 1160 // We need to allow the delegate to size its contents since the window may not |
| 1161 // receive a size notification when its initial bounds are specified at window | 1161 // receive a size notification when its initial bounds are specified at window |
| 1162 // creation time. | 1162 // creation time. |
| 1163 ClientAreaSizeChanged(); | 1163 ClientAreaSizeChanged(); |
| 1164 | 1164 |
| 1165 #if defined(VIEWS_COMPOSITOR) | 1165 #if defined(VIEWS_COMPOSITOR) |
| 1166 if (View::get_use_acceleration_when_possible()) { | 1166 if (View::get_use_acceleration_when_possible()) { |
| 1167 if (ui::Compositor::compositor_factory()) { | 1167 CRect window_rect; |
| 1168 compositor_ = (*Widget::compositor_factory())(this); | 1168 GetClientRect(&window_rect); |
| 1169 } else { | 1169 compositor_ = ui::Compositor::Create(this, |
| 1170 CRect window_rect; | 1170 hwnd(), |
| 1171 GetClientRect(&window_rect); | 1171 gfx::Size(window_rect.Width(), window_rect.Height())); |
| 1172 compositor_ = ui::Compositor::Create(this, | |
| 1173 hwnd(), | |
| 1174 gfx::Size(window_rect.Width(), window_rect.Height())); | |
| 1175 } | |
| 1176 if (compositor_.get()) { | 1172 if (compositor_.get()) { |
| 1177 delegate_->AsWidget()->GetRootView()->SetPaintToLayer(true); | 1173 delegate_->AsWidget()->GetRootView()->SetPaintToLayer(true); |
| 1178 compositor_->SetRootLayer(delegate_->AsWidget()->GetRootView()->layer()); | 1174 compositor_->SetRootLayer(delegate_->AsWidget()->GetRootView()->layer()); |
| 1179 } | 1175 } |
| 1180 } | 1176 } |
| 1181 #endif | 1177 #endif |
| 1182 | 1178 |
| 1183 delegate_->OnNativeWidgetCreated(); | 1179 delegate_->OnNativeWidgetCreated(); |
| 1184 | 1180 |
| 1185 // Get access to a modifiable copy of the system menu. | 1181 // Get access to a modifiable copy of the system menu. |
| (...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2497 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2493 return (GetKeyState(VK_LBUTTON) & 0x80) || |
| 2498 (GetKeyState(VK_RBUTTON) & 0x80) || | 2494 (GetKeyState(VK_RBUTTON) & 0x80) || |
| 2499 (GetKeyState(VK_MBUTTON) & 0x80) || | 2495 (GetKeyState(VK_MBUTTON) & 0x80) || |
| 2500 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2496 (GetKeyState(VK_XBUTTON1) & 0x80) || |
| 2501 (GetKeyState(VK_XBUTTON2) & 0x80); | 2497 (GetKeyState(VK_XBUTTON2) & 0x80); |
| 2502 } | 2498 } |
| 2503 | 2499 |
| 2504 } // namespace internal | 2500 } // namespace internal |
| 2505 | 2501 |
| 2506 } // namespace views | 2502 } // namespace views |
| OLD | NEW |