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/renderer_host/render_widget_host_view_win.h" | 5 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/gfx/gdi_util.h" | 8 #include "base/gfx/gdi_util.h" |
9 #include "base/gfx/rect.h" | 9 #include "base/gfx/rect.h" |
10 #include "base/histogram.h" | 10 #include "base/histogram.h" |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 } | 389 } |
390 } | 390 } |
391 | 391 |
392 /////////////////////////////////////////////////////////////////////////////// | 392 /////////////////////////////////////////////////////////////////////////////// |
393 // RenderWidgetHostViewWin, private: | 393 // RenderWidgetHostViewWin, private: |
394 | 394 |
395 LRESULT RenderWidgetHostViewWin::OnCreate(CREATESTRUCT* create_struct) { | 395 LRESULT RenderWidgetHostViewWin::OnCreate(CREATESTRUCT* create_struct) { |
396 // Call the WM_INPUTLANGCHANGE message handler to initialize the input locale | 396 // Call the WM_INPUTLANGCHANGE message handler to initialize the input locale |
397 // of a browser process. | 397 // of a browser process. |
398 OnInputLangChange(0, 0); | 398 OnInputLangChange(0, 0); |
| 399 TRACK_HWND_CREATION(m_hWnd); |
399 return 0; | 400 return 0; |
400 } | 401 } |
401 | 402 |
402 void RenderWidgetHostViewWin::OnActivate(UINT action, BOOL minimized, | 403 void RenderWidgetHostViewWin::OnActivate(UINT action, BOOL minimized, |
403 HWND window) { | 404 HWND window) { |
404 // If the container is a popup, clicking elsewhere on screen should close the | 405 // If the container is a popup, clicking elsewhere on screen should close the |
405 // popup. | 406 // popup. |
406 if (close_on_deactivate_ && action == WA_INACTIVE) { | 407 if (close_on_deactivate_ && action == WA_INACTIVE) { |
407 // Send a windows message so that any derived classes | 408 // Send a windows message so that any derived classes |
408 // will get a change to override the default handling | 409 // will get a change to override the default handling |
409 SendMessage(WM_CANCELMODE); | 410 SendMessage(WM_CANCELMODE); |
410 } | 411 } |
411 } | 412 } |
412 | 413 |
413 void RenderWidgetHostViewWin::OnDestroy() { | 414 void RenderWidgetHostViewWin::OnDestroy() { |
414 ResetTooltip(); | 415 ResetTooltip(); |
415 TrackMouseLeave(false); | 416 TrackMouseLeave(false); |
| 417 TRACK_HWND_DESTRUCTION(m_hWnd); |
416 } | 418 } |
417 | 419 |
418 void RenderWidgetHostViewWin::OnPaint(HDC dc) { | 420 void RenderWidgetHostViewWin::OnPaint(HDC dc) { |
419 DCHECK(render_widget_host_->process()->channel()); | 421 DCHECK(render_widget_host_->process()->channel()); |
420 | 422 |
421 CPaintDC paint_dc(m_hWnd); | 423 CPaintDC paint_dc(m_hWnd); |
422 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); | 424 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); |
423 | 425 |
424 BackingStore* backing_store = render_widget_host_->GetBackingStore(); | 426 BackingStore* backing_store = render_widget_host_->GetBackingStore(); |
425 | 427 |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 // WM_LBUTTONDOWN. | 971 // WM_LBUTTONDOWN. |
970 SetFocus(); | 972 SetFocus(); |
971 } | 973 } |
972 } | 974 } |
973 | 975 |
974 void RenderWidgetHostViewWin::ShutdownHost() { | 976 void RenderWidgetHostViewWin::ShutdownHost() { |
975 shutdown_factory_.RevokeAll(); | 977 shutdown_factory_.RevokeAll(); |
976 render_widget_host_->Shutdown(); | 978 render_widget_host_->Shutdown(); |
977 // Do not touch any members at this point, |this| has been deleted. | 979 // Do not touch any members at this point, |this| has been deleted. |
978 } | 980 } |
OLD | NEW |