Chromium Code Reviews| 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/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/l10n_util_win.h" | 8 #include "app/l10n_util_win.h" |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "app/view_prop.h" | 10 #include "app/view_prop.h" |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 301 NotificationType::RENDERER_PROCESS_TERMINATED, | 301 NotificationType::RENDERER_PROCESS_TERMINATED, |
| 302 NotificationService::AllSources()); | 302 NotificationService::AllSources()); |
| 303 } | 303 } |
| 304 | 304 |
| 305 RenderWidgetHostViewWin::~RenderWidgetHostViewWin() { | 305 RenderWidgetHostViewWin::~RenderWidgetHostViewWin() { |
| 306 ResetTooltip(); | 306 ResetTooltip(); |
| 307 } | 307 } |
| 308 | 308 |
| 309 void RenderWidgetHostViewWin::CreateWnd(HWND parent) { | 309 void RenderWidgetHostViewWin::CreateWnd(HWND parent) { |
| 310 Create(parent); // ATL function to create the window. | 310 Create(parent); // ATL function to create the window. |
| 311 | |
| 312 // Add a property indicating that a particular renderer is associated with | |
| 313 // this window. Used by the GPU process to validate window handles it | |
| 314 // receives from renderer processes. As this is used by a separate process we | |
| 315 // have to use ScopedProp here instead of ViewProp. | |
| 316 int renderer_id = render_widget_host_->process()->id(); | |
| 317 renderer_id_prop_.reset( | |
|
sky
2010/12/02 20:27:26
Remove renderer_id_prop_ from the header,the forwa
| |
| 318 new app::win::ScopedProp(m_hWnd, | |
| 319 chrome::kChromiumRendererIdProperty, | |
| 320 reinterpret_cast<HANDLE>(renderer_id))); | |
| 321 } | 311 } |
| 322 | 312 |
| 323 /////////////////////////////////////////////////////////////////////////////// | 313 /////////////////////////////////////////////////////////////////////////////// |
| 324 // RenderWidgetHostViewWin, RenderWidgetHostView implementation: | 314 // RenderWidgetHostViewWin, RenderWidgetHostView implementation: |
| 325 | 315 |
| 326 void RenderWidgetHostViewWin::InitAsPopup( | 316 void RenderWidgetHostViewWin::InitAsPopup( |
| 327 RenderWidgetHostView* parent_host_view, const gfx::Rect& pos) { | 317 RenderWidgetHostView* parent_host_view, const gfx::Rect& pos) { |
| 328 parent_hwnd_ = parent_host_view->GetNativeView(); | 318 parent_hwnd_ = parent_host_view->GetNativeView(); |
| 329 close_on_deactivate_ = true; | 319 close_on_deactivate_ = true; |
| 330 Create(parent_hwnd_, NULL, NULL, WS_POPUP, WS_EX_TOOLWINDOW); | 320 Create(parent_hwnd_, NULL, NULL, WS_POPUP, WS_EX_TOOLWINDOW); |
| (...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1803 } | 1793 } |
| 1804 | 1794 |
| 1805 // static | 1795 // static |
| 1806 RenderWidgetHostView* | 1796 RenderWidgetHostView* |
| 1807 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1797 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
| 1808 gfx::NativeView native_view) { | 1798 gfx::NativeView native_view) { |
| 1809 return ::IsWindow(native_view) ? | 1799 return ::IsWindow(native_view) ? |
| 1810 reinterpret_cast<RenderWidgetHostView*>( | 1800 reinterpret_cast<RenderWidgetHostView*>( |
| 1811 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; | 1801 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; |
| 1812 } | 1802 } |
| OLD | NEW |