Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: chrome/browser/ui/views/tabs/native_view_photobooth_win.cc

Issue 6881107: Rework the way Widget::Init works: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // This function sets up the off-screen capture window, and attaches the 144 // This function sets up the off-screen capture window, and attaches the
145 // associated HWND to it. Note that the details are important here, see below 145 // associated HWND to it. Note that the details are important here, see below
146 // for further comments. 146 // for further comments.
147 // 147 //
148 RECT contents_rect; 148 RECT 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.right - contents_rect.left, 152 contents_rect.right - contents_rect.left,
153 contents_rect.bottom - contents_rect.top); 153 contents_rect.bottom - contents_rect.top);
154 capture_window_ = views::Widget::CreateWidget();
154 views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); 155 views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP);
155 params.transparent = true; 156 params.transparent = true;
156 capture_window_ = views::Widget::CreateWidget(params); 157 params.bounds = capture_bounds;
158 capture_window_->Init(params);
157 // If the capture window isn't visible, blitting from the TabContents' 159 // If the capture window isn't visible, blitting from the TabContents'
158 // HWND's DC to the capture bitmap produces blankness. 160 // HWND's DC to the capture bitmap produces blankness.
159 capture_window_->Init(NULL, capture_bounds);
160 capture_window_->Show(); 161 capture_window_->Show();
161 SetLayeredWindowAttributes( 162 SetLayeredWindowAttributes(
162 capture_window_->GetNativeView(), RGB(0xFF, 0xFF, 0xFF), 0xFF, LWA_ALPHA); 163 capture_window_->GetNativeView(), RGB(0xFF, 0xFF, 0xFF), 0xFF, LWA_ALPHA);
163 164
164 Replace(initial_hwnd); 165 Replace(initial_hwnd);
165 } 166 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/dragged_tab_view.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698