OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/renderer_host/render_widget_host_view_win.h" | 5 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" |
6 | 6 |
7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
8 #include "app/gfx/gdi_util.h" | 8 #include "app/gfx/gdi_util.h" |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/l10n_util_win.h" | 10 #include "app/l10n_util_win.h" |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 wcex.hIcon = 0; | 433 wcex.hIcon = 0; |
434 wcex.hCursor = 0; | 434 wcex.hCursor = 0; |
435 wcex.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_WINDOW+1); | 435 wcex.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_WINDOW+1); |
436 wcex.lpszMenuName = 0; | 436 wcex.lpszMenuName = 0; |
437 wcex.lpszClassName = kWrapperNativeWindowClassName; | 437 wcex.lpszClassName = kWrapperNativeWindowClassName; |
438 wcex.hIconSm = 0; | 438 wcex.hIconSm = 0; |
439 window_class = RegisterClassEx(&wcex); | 439 window_class = RegisterClassEx(&wcex); |
440 } | 440 } |
441 DCHECK(window_class); | 441 DCHECK(window_class); |
442 | 442 |
| 443 // TODO(apatrick): the parent window is disabled if the plugin window is |
| 444 // disabled so that mouse messages from the plugin window are passed on to the |
| 445 // browser window. This does not work for regular plugins because it prevents |
| 446 // them from receiving mouse and keyboard input. WS_DISABLED is not |
| 447 // needed when the GPU process stops using child windows for 3D rendering. |
| 448 DWORD enabled_style = ::GetWindowLong(window, GWL_STYLE) & WS_DISABLED; |
443 HWND parent = CreateWindowEx( | 449 HWND parent = CreateWindowEx( |
444 WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR, | 450 WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR, |
445 MAKEINTATOM(window_class), 0, | 451 MAKEINTATOM(window_class), 0, |
446 WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, | 452 WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | enabled_style, |
447 0, 0, 0, 0, ::GetParent(window), 0, GetModuleHandle(NULL), 0); | 453 0, 0, 0, 0, ::GetParent(window), 0, GetModuleHandle(NULL), 0); |
448 DCHECK(parent); | 454 DCHECK(parent); |
449 ::SetParent(window, parent); | 455 ::SetParent(window, parent); |
450 ChromeThread::PostTask( | 456 ChromeThread::PostTask( |
451 ChromeThread::IO, FROM_HERE, | 457 ChromeThread::IO, FROM_HERE, |
452 new NotifyPluginProcessHostTask(window, parent)); | 458 new NotifyPluginProcessHostTask(window, parent)); |
453 return parent; | 459 return parent; |
454 } | 460 } |
455 | 461 |
456 void RenderWidgetHostViewWin::Focus() { | 462 void RenderWidgetHostViewWin::Focus() { |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1503 SetFocus(); | 1509 SetFocus(); |
1504 } | 1510 } |
1505 } | 1511 } |
1506 | 1512 |
1507 void RenderWidgetHostViewWin::ShutdownHost() { | 1513 void RenderWidgetHostViewWin::ShutdownHost() { |
1508 shutdown_factory_.RevokeAll(); | 1514 shutdown_factory_.RevokeAll(); |
1509 if (render_widget_host_) | 1515 if (render_widget_host_) |
1510 render_widget_host_->Shutdown(); | 1516 render_widget_host_->Shutdown(); |
1511 // Do not touch any members at this point, |this| has been deleted. | 1517 // Do not touch any members at this point, |this| has been deleted. |
1512 } | 1518 } |
OLD | NEW |