| 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 "chrome/browser/views/tabs/native_view_photobooth_win.h" | 5 #include "chrome/browser/views/tabs/native_view_photobooth_win.h" |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "base/gfx/point.h" | 8 #include "base/gfx/point.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents.h" | 9 #include "chrome/browser/tab_contents/tab_contents.h" |
| 10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 CRect contents_rect; | 148 CRect contents_rect; |
| 149 GetClientRect(initial_hwnd, &contents_rect); | 149 GetClientRect(initial_hwnd, &contents_rect); |
| 150 gfx::Point window_position = GetCaptureWindowPosition(); | 150 gfx::Point window_position = GetCaptureWindowPosition(); |
| 151 gfx::Rect capture_bounds(window_position.x(), window_position.y(), | 151 gfx::Rect capture_bounds(window_position.x(), window_position.y(), |
| 152 contents_rect.Width(), contents_rect.Height()); | 152 contents_rect.Width(), contents_rect.Height()); |
| 153 capture_window_ = new views::WidgetWin; | 153 capture_window_ = new views::WidgetWin; |
| 154 capture_window_->set_window_style(WS_POPUP); | 154 capture_window_->set_window_style(WS_POPUP); |
| 155 // WS_EX_TOOLWINDOW ensures the capture window doesn't produce a Taskbar | 155 // WS_EX_TOOLWINDOW ensures the capture window doesn't produce a Taskbar |
| 156 // button. | 156 // button. |
| 157 capture_window_->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW); | 157 capture_window_->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW); |
| 158 capture_window_->Init(NULL, capture_bounds); | 158 capture_window_->Init(NULL, capture_bounds, false); |
| 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 |