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

Side by Side Diff: webkit/tools/test_shell/test_webview_delegate_win.cc

Issue 42626: Report the plugin position to windowed plugins as (0,0)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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
« no previous file with comments | « webkit/glue/webplugin_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // This file contains the implementation of TestWebViewDelegate, which serves 5 // This file contains the implementation of TestWebViewDelegate, which serves
6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to 6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to
7 // have initialized a MessageLoop before these methods are called. 7 // have initialized a MessageLoop before these methods are called.
8 8
9 #include "webkit/tools/test_shell/test_webview_delegate.h" 9 #include "webkit/tools/test_shell/test_webview_delegate.h"
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 const WebPluginGeometry& move) { 142 const WebPluginGeometry& move) {
143 HRGN hrgn = ::CreateRectRgn(move.clip_rect.x(), 143 HRGN hrgn = ::CreateRectRgn(move.clip_rect.x(),
144 move.clip_rect.y(), 144 move.clip_rect.y(),
145 move.clip_rect.right(), 145 move.clip_rect.right(),
146 move.clip_rect.bottom()); 146 move.clip_rect.bottom());
147 gfx::SubtractRectanglesFromRegion(hrgn, move.cutout_rects); 147 gfx::SubtractRectanglesFromRegion(hrgn, move.cutout_rects);
148 148
149 // Note: System will own the hrgn after we call SetWindowRgn, 149 // Note: System will own the hrgn after we call SetWindowRgn,
150 // so we don't need to call DeleteObject(hrgn) 150 // so we don't need to call DeleteObject(hrgn)
151 ::SetWindowRgn(move.window, hrgn, FALSE); 151 ::SetWindowRgn(move.window, hrgn, FALSE);
152 152 ::ShowWindow(move.window, move.visible ? SW_SHOW : SW_HIDE);
153 unsigned long flags = 0;
154 if (move.visible)
155 flags |= SWP_SHOWWINDOW;
156 else
157 flags |= SWP_HIDEWINDOW;
158
159 ::SetWindowPos(move.window,
160 NULL,
161 move.window_rect.x(),
162 move.window_rect.y(),
163 move.window_rect.width(),
164 move.window_rect.height(),
165 flags);
166 } 153 }
167 154
168 void TestWebViewDelegate::RunModal(WebWidget* webwidget) { 155 void TestWebViewDelegate::RunModal(WebWidget* webwidget) {
169 Show(webwidget, NEW_WINDOW); 156 Show(webwidget, NEW_WINDOW);
170 157
171 WindowList* wl = TestShell::windowList(); 158 WindowList* wl = TestShell::windowList();
172 for (WindowList::const_iterator i = wl->begin(); i != wl->end(); ++i) { 159 for (WindowList::const_iterator i = wl->begin(); i != wl->end(); ++i) {
173 if (*i != shell_->mainWnd()) 160 if (*i != shell_->mainWnd())
174 EnableWindow(*i, FALSE); 161 EnableWindow(*i, FALSE);
175 } 162 }
(...skipping 13 matching lines...) Expand all
189 176
190 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { 177 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) {
191 // The Windows test shell, pre-refactoring, ignored this. *shrug* 178 // The Windows test shell, pre-refactoring, ignored this. *shrug*
192 } 179 }
193 180
194 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { 181 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) {
195 std::wstring url_string = UTF8ToWide(url.spec()); 182 std::wstring url_string = UTF8ToWide(url.spec());
196 SendMessage(shell_->editWnd(), WM_SETTEXT, 0, 183 SendMessage(shell_->editWnd(), WM_SETTEXT, 0,
197 reinterpret_cast<LPARAM>(url_string.c_str())); 184 reinterpret_cast<LPARAM>(url_string.c_str()));
198 } 185 }
OLDNEW
« no previous file with comments | « webkit/glue/webplugin_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698