OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/window_win.h" | 5 #include "views/window/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 "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
11 #include "app/resource_bundle.h" | 11 #include "app/resource_bundle.h" |
12 #include "app/theme_provider.h" | 12 #include "app/theme_provider.h" |
13 #include "app/win_util.h" | 13 #include "app/win_util.h" |
14 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
15 #include "base/win_util.h" | 15 #include "base/win_util.h" |
16 #include "gfx/canvas_paint.h" | 16 #include "gfx/canvas_skia_paint.h" |
17 #include "gfx/font.h" | 17 #include "gfx/font.h" |
18 #include "gfx/icon_util.h" | 18 #include "gfx/icon_util.h" |
19 #include "gfx/path.h" | 19 #include "gfx/path.h" |
20 #include "views/accessibility/view_accessibility.h" | 20 #include "views/accessibility/view_accessibility.h" |
21 #include "views/widget/root_view.h" | 21 #include "views/widget/root_view.h" |
22 #include "views/window/client_view.h" | 22 #include "views/window/client_view.h" |
23 #include "views/window/custom_frame_view.h" | 23 #include "views/window/custom_frame_view.h" |
24 #include "views/window/native_frame_view.h" | 24 #include "views/window/native_frame_view.h" |
25 #include "views/window/non_client_view.h" | 25 #include "views/window/non_client_view.h" |
26 #include "views/window/window_delegate.h" | 26 #include "views/window/window_delegate.h" |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 // The root view has a region that needs to be painted. Include it in the | 931 // The root view has a region that needs to be painted. Include it in the |
932 // region we're going to paint. | 932 // region we're going to paint. |
933 | 933 |
934 CRect old_paint_region_crect = old_paint_region.ToRECT(); | 934 CRect old_paint_region_crect = old_paint_region.ToRECT(); |
935 CRect tmp = dirty_region; | 935 CRect tmp = dirty_region; |
936 UnionRect(&dirty_region, &tmp, &old_paint_region_crect); | 936 UnionRect(&dirty_region, &tmp, &old_paint_region_crect); |
937 } | 937 } |
938 | 938 |
939 root_view->SchedulePaint(gfx::Rect(dirty_region), false); | 939 root_view->SchedulePaint(gfx::Rect(dirty_region), false); |
940 | 940 |
941 // gfx::CanvasPaints destructor does the actual painting. As such, wrap the | 941 // gfx::CanvasSkiaPaint's destructor does the actual painting. As such, wrap |
942 // following in a block to force paint to occur so that we can release the dc. | 942 // the following in a block to force paint to occur so that we can release |
| 943 // the dc. |
943 { | 944 { |
944 gfx::CanvasPaint canvas(dc, opaque(), dirty_region.left, dirty_region.top, | 945 gfx::CanvasSkiaPaint canvas(dc, opaque(), dirty_region.left, dirty_region.to
p, |
945 dirty_region.Width(), dirty_region.Height()); | 946 dirty_region.Width(), dirty_region.Height()); |
946 | 947 |
947 root_view->ProcessPaint(&canvas); | 948 root_view->ProcessPaint(canvas.AsCanvas()); |
948 } | 949 } |
949 | 950 |
950 ReleaseDC(GetNativeView(), dc); | 951 ReleaseDC(GetNativeView(), dc); |
951 } | 952 } |
952 | 953 |
953 void WindowWin::OnNCLButtonDown(UINT ht_component, const CPoint& point) { | 954 void WindowWin::OnNCLButtonDown(UINT ht_component, const CPoint& point) { |
954 // When we're using a native frame, window controls work without us | 955 // When we're using a native frame, window controls work without us |
955 // interfering. | 956 // interfering. |
956 if (!non_client_view_->UseNativeFrame()) { | 957 if (!non_client_view_->UseNativeFrame()) { |
957 switch (ht_component) { | 958 switch (ht_component) { |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1509 Window::CloseSecondaryWidget(root_view->GetWidget()); | 1510 Window::CloseSecondaryWidget(root_view->GetWidget()); |
1510 return TRUE; | 1511 return TRUE; |
1511 } | 1512 } |
1512 } // namespace | 1513 } // namespace |
1513 | 1514 |
1514 void Window::CloseAllSecondaryWindows() { | 1515 void Window::CloseAllSecondaryWindows() { |
1515 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); | 1516 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); |
1516 } | 1517 } |
1517 | 1518 |
1518 } // namespace views | 1519 } // namespace views |
OLD | NEW |