| 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/window/native_window_win.h" | 5 #include "views/window/native_window_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/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| 11 #include "base/win/scoped_gdi_object.h" | 11 #include "base/win/scoped_gdi_object.h" |
| 12 #include "base/win/win_util.h" | 12 #include "base/win/win_util.h" |
| 13 #include "base/win/windows_version.h" | 13 #include "base/win/windows_version.h" |
| 14 #include "ui/base/accessibility/accessibility_types.h" | 14 #include "ui/base/accessibility/accessibility_types.h" |
| 15 #include "ui/base/keycodes/keyboard_code_conversion_win.h" | 15 #include "ui/base/keycodes/keyboard_code_conversion_win.h" |
| 16 #include "ui/base/l10n/l10n_util_win.h" | 16 #include "ui/base/l10n/l10n_util_win.h" |
| 17 #include "ui/base/theme_provider.h" | 17 #include "ui/base/theme_provider.h" |
| 18 #include "ui/base/win/hwnd_util.h" | 18 #include "ui/base/win/hwnd_util.h" |
| 19 #include "ui/gfx/canvas_skia_paint.h" | 19 #include "ui/gfx/canvas_skia_paint.h" |
| 20 #include "ui/gfx/font.h" | 20 #include "ui/gfx/font.h" |
| 21 #include "ui/gfx/icon_util.h" | 21 #include "ui/gfx/icon_util.h" |
| 22 #include "ui/gfx/path.h" | 22 #include "ui/gfx/path.h" |
| 23 #include "views/accessibility/native_view_accessibility_win.h" | 23 #include "views/accessibility/native_view_accessibility_win.h" |
| 24 #include "views/window/client_view.h" | 24 #include "views/window/client_view.h" |
| 25 #include "views/window/custom_frame_view.h" | |
| 26 #include "views/window/native_window_delegate.h" | 25 #include "views/window/native_window_delegate.h" |
| 27 #include "views/window/native_frame_view.h" | 26 #include "views/window/native_frame_view.h" |
| 28 #include "views/window/non_client_view.h" | 27 #include "views/window/non_client_view.h" |
| 29 #include "views/window/window_delegate.h" | 28 #include "views/window/window_delegate.h" |
| 30 | 29 |
| 31 namespace views { | 30 namespace views { |
| 32 namespace { | 31 namespace { |
| 33 | 32 |
| 34 static const int kDragFrameWindowAlpha = 200; | 33 static const int kDragFrameWindowAlpha = 200; |
| 35 | 34 |
| (...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 SetWindowLong(GWL_STYLE, drag_frame_saved_window_style_ & ~WS_CAPTION); | 1300 SetWindowLong(GWL_STYLE, drag_frame_saved_window_style_ & ~WS_CAPTION); |
| 1302 SetLayeredWindowAttributes(GetNativeWindow(), RGB(0xFF, 0xFF, 0xFF), | 1301 SetLayeredWindowAttributes(GetNativeWindow(), RGB(0xFF, 0xFF, 0xFF), |
| 1303 kDragFrameWindowAlpha, LWA_ALPHA); | 1302 kDragFrameWindowAlpha, LWA_ALPHA); |
| 1304 } else { | 1303 } else { |
| 1305 SetWindowLong(GWL_STYLE, drag_frame_saved_window_style_); | 1304 SetWindowLong(GWL_STYLE, drag_frame_saved_window_style_); |
| 1306 SetWindowLong(GWL_EXSTYLE, drag_frame_saved_window_ex_style_); | 1305 SetWindowLong(GWL_EXSTYLE, drag_frame_saved_window_ex_style_); |
| 1307 } | 1306 } |
| 1308 } | 1307 } |
| 1309 | 1308 |
| 1310 NonClientFrameView* NativeWindowWin::CreateFrameViewForWindow() { | 1309 NonClientFrameView* NativeWindowWin::CreateFrameViewForWindow() { |
| 1311 if (GetWindow()->ShouldUseNativeFrame()) | 1310 return GetWindow()->ShouldUseNativeFrame() ? |
| 1312 return new NativeFrameView(GetWindow()); | 1311 new NativeFrameView(GetWindow()) : NULL; |
| 1313 return new CustomFrameView(GetWindow()); | |
| 1314 } | 1312 } |
| 1315 | 1313 |
| 1316 void NativeWindowWin::UpdateFrameAfterFrameChange() { | 1314 void NativeWindowWin::UpdateFrameAfterFrameChange() { |
| 1317 // We've either gained or lost a custom window region, so reset it now. | 1315 // We've either gained or lost a custom window region, so reset it now. |
| 1318 ResetWindowRegion(true); | 1316 ResetWindowRegion(true); |
| 1319 } | 1317 } |
| 1320 | 1318 |
| 1321 gfx::NativeWindow NativeWindowWin::GetNativeWindow() const { | 1319 gfx::NativeWindow NativeWindowWin::GetNativeWindow() const { |
| 1322 return GetNativeView(); | 1320 return GetNativeView(); |
| 1323 } | 1321 } |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1466 //////////////////////////////////////////////////////////////////////////////// | 1464 //////////////////////////////////////////////////////////////////////////////// |
| 1467 // NativeWindow, public: | 1465 // NativeWindow, public: |
| 1468 | 1466 |
| 1469 // static | 1467 // static |
| 1470 NativeWindow* NativeWindow::CreateNativeWindow( | 1468 NativeWindow* NativeWindow::CreateNativeWindow( |
| 1471 internal::NativeWindowDelegate* delegate) { | 1469 internal::NativeWindowDelegate* delegate) { |
| 1472 return new NativeWindowWin(delegate); | 1470 return new NativeWindowWin(delegate); |
| 1473 } | 1471 } |
| 1474 | 1472 |
| 1475 } // namespace views | 1473 } // namespace views |
| OLD | NEW |