| 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 | 8 |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/system_monitor/system_monitor.h" | 10 #include "base/system_monitor/system_monitor.h" |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 invalid_rect_.y(), | 1112 invalid_rect_.y(), |
| 1113 invalid_rect_.width(), | 1113 invalid_rect_.width(), |
| 1114 invalid_rect_.height()); | 1114 invalid_rect_.height()); |
| 1115 GetWidget()->GetRootView()->Paint(layered_window_contents_.get()); | 1115 GetWidget()->GetRootView()->Paint(layered_window_contents_.get()); |
| 1116 layered_window_contents_->restore(); | 1116 layered_window_contents_->restore(); |
| 1117 | 1117 |
| 1118 RECT wr; | 1118 RECT wr; |
| 1119 GetWindowRect(&wr); | 1119 GetWindowRect(&wr); |
| 1120 SIZE size = {wr.right - wr.left, wr.bottom - wr.top}; | 1120 SIZE size = {wr.right - wr.left, wr.bottom - wr.top}; |
| 1121 POINT position = {wr.left, wr.top}; | 1121 POINT position = {wr.left, wr.top}; |
| 1122 HDC dib_dc = layered_window_contents_->beginPlatformPaint(); | 1122 HDC dib_dc = skia::BeginPlatformPaint(layered_window_contents_.get()); |
| 1123 POINT zero = {0, 0}; | 1123 POINT zero = {0, 0}; |
| 1124 BLENDFUNCTION blend = {AC_SRC_OVER, 0, layered_alpha_, AC_SRC_ALPHA}; | 1124 BLENDFUNCTION blend = {AC_SRC_OVER, 0, layered_alpha_, AC_SRC_ALPHA}; |
| 1125 UpdateLayeredWindow(hwnd(), NULL, &position, &size, dib_dc, &zero, | 1125 UpdateLayeredWindow(hwnd(), NULL, &position, &size, dib_dc, &zero, |
| 1126 RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA); | 1126 RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA); |
| 1127 invalid_rect_.SetRect(0, 0, 0, 0); | 1127 invalid_rect_.SetRect(0, 0, 0, 0); |
| 1128 layered_window_contents_->endPlatformPaint(); | 1128 skia::EndPlatformPaint(layered_window_contents_.get()); |
| 1129 } | 1129 } |
| 1130 | 1130 |
| 1131 void NativeWidgetWin::ClientAreaSizeChanged() { | 1131 void NativeWidgetWin::ClientAreaSizeChanged() { |
| 1132 RECT r; | 1132 RECT r; |
| 1133 Window* window = GetWidget()->GetContainingWindow(); | 1133 Window* window = GetWidget()->GetContainingWindow(); |
| 1134 if (IsZoomed() || (window && window->ShouldUseNativeFrame())) | 1134 if (IsZoomed() || (window && window->ShouldUseNativeFrame())) |
| 1135 GetClientRect(&r); | 1135 GetClientRect(&r); |
| 1136 else | 1136 else |
| 1137 GetWindowRect(&r); | 1137 GetWindowRect(&r); |
| 1138 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)), | 1138 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)), |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1292 | 1292 |
| 1293 // And now, notify them that they have a brand new parent. | 1293 // And now, notify them that they have a brand new parent. |
| 1294 for (NativeWidgets::iterator it = widgets.begin(); | 1294 for (NativeWidgets::iterator it = widgets.begin(); |
| 1295 it != widgets.end(); ++it) { | 1295 it != widgets.end(); ++it) { |
| 1296 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, | 1296 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, |
| 1297 new_parent); | 1297 new_parent); |
| 1298 } | 1298 } |
| 1299 } | 1299 } |
| 1300 | 1300 |
| 1301 } // namespace views | 1301 } // namespace views |
| OLD | NEW |