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 "chrome/browser/ui/views/tabs/native_view_photobooth_win.h" | 5 #include "chrome/browser/ui/views/tabs/native_view_photobooth_win.h" |
6 | 6 |
7 #include "content/browser/tab_contents/tab_contents.h" | 7 #include "content/browser/tab_contents/tab_contents.h" |
8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
9 #include "ui/gfx/canvas_skia.h" | 9 #include "ui/gfx/canvas_skia.h" |
10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
11 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
12 #include "ui/views/widget/widget.h" | 12 #include "views/widget/widget.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 static BOOL CALLBACK MonitorEnumProc(HMONITOR monitor, HDC monitor_dc, | 16 static BOOL CALLBACK MonitorEnumProc(HMONITOR monitor, HDC monitor_dc, |
17 RECT* monitor_rect, LPARAM data) { | 17 RECT* monitor_rect, LPARAM data) { |
18 gfx::Point* point = reinterpret_cast<gfx::Point*>(data); | 18 gfx::Point* point = reinterpret_cast<gfx::Point*>(data); |
19 if (monitor_rect->right > point->x() && monitor_rect->bottom > point->y()) { | 19 if (monitor_rect->right > point->x() && monitor_rect->bottom > point->y()) { |
20 point->set_x(monitor_rect->right); | 20 point->set_x(monitor_rect->right); |
21 point->set_y(monitor_rect->bottom); | 21 point->set_y(monitor_rect->bottom); |
22 } | 22 } |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 params.bounds = capture_bounds; | 157 params.bounds = capture_bounds; |
158 capture_window_->Init(params); | 158 capture_window_->Init(params); |
159 // If the capture window isn't visible, blitting from the TabContents' | 159 // If the capture window isn't visible, blitting from the TabContents' |
160 // HWND's DC to the capture bitmap produces blankness. | 160 // HWND's DC to the capture bitmap produces blankness. |
161 capture_window_->Show(); | 161 capture_window_->Show(); |
162 SetLayeredWindowAttributes( | 162 SetLayeredWindowAttributes( |
163 capture_window_->GetNativeView(), RGB(0xFF, 0xFF, 0xFF), 0xFF, LWA_ALPHA); | 163 capture_window_->GetNativeView(), RGB(0xFF, 0xFF, 0xFF), 0xFF, LWA_ALPHA); |
164 | 164 |
165 Replace(initial_hwnd); | 165 Replace(initial_hwnd); |
166 } | 166 } |
OLD | NEW |