OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "app/gfx/chrome_canvas.h" | 5 #include "app/gfx/chrome_canvas.h" |
6 #include "base/gfx/point.h" | 6 #include "base/gfx/point.h" |
7 #include "chrome/browser/tab_contents/tab_contents.h" | 7 #include "chrome/browser/tab_contents/tab_contents.h" |
8 #include "chrome/browser/views/tabs/hwnd_photobooth.h" | 8 #include "chrome/browser/views/tabs/hwnd_photobooth.h" |
9 #include "skia/include/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
10 #include "views/widget/widget_win.h" | 10 #include "views/widget/widget_win.h" |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 static BOOL CALLBACK MonitorEnumProc(HMONITOR monitor, HDC monitor_dc, | 14 static BOOL CALLBACK MonitorEnumProc(HMONITOR monitor, HDC monitor_dc, |
15 RECT* monitor_rect, LPARAM data) { | 15 RECT* monitor_rect, LPARAM data) { |
16 gfx::Point* point = reinterpret_cast<gfx::Point*>(data); | 16 gfx::Point* point = reinterpret_cast<gfx::Point*>(data); |
17 if (monitor_rect->right > point->x() && monitor_rect->bottom > point->y()) { | 17 if (monitor_rect->right > point->x() && monitor_rect->bottom > point->y()) { |
18 point->set_x(monitor_rect->right); | 18 point->set_x(monitor_rect->right); |
19 point->set_y(monitor_rect->bottom); | 19 point->set_y(monitor_rect->bottom); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 capture_window_->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW); | 150 capture_window_->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW); |
151 capture_window_->Init(NULL, capture_bounds, false); | 151 capture_window_->Init(NULL, capture_bounds, false); |
152 // If the capture window isn't visible, blitting from the TabContents' | 152 // If the capture window isn't visible, blitting from the TabContents' |
153 // HWND's DC to the capture bitmap produces blankness. | 153 // HWND's DC to the capture bitmap produces blankness. |
154 capture_window_->Show(); | 154 capture_window_->Show(); |
155 SetLayeredWindowAttributes( | 155 SetLayeredWindowAttributes( |
156 capture_window_->GetNativeView(), RGB(0xFF, 0xFF, 0xFF), 0xFF, LWA_ALPHA); | 156 capture_window_->GetNativeView(), RGB(0xFF, 0xFF, 0xFF), 0xFF, LWA_ALPHA); |
157 | 157 |
158 ReplaceHWND(initial_hwnd); | 158 ReplaceHWND(initial_hwnd); |
159 } | 159 } |
OLD | NEW |