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); | |
400 return 0; | 399 return 0; |
401 } | 400 } |
402 | 401 |
403 void RenderWidgetHostViewWin::OnActivate(UINT action, BOOL minimized, | 402 void RenderWidgetHostViewWin::OnActivate(UINT action, BOOL minimized, |
404 HWND window) { | 403 HWND window) { |
405 // If the container is a popup, clicking elsewhere on screen should close the | 404 // If the container is a popup, clicking elsewhere on screen should close the |
406 // popup. | 405 // popup. |
407 if (close_on_deactivate_ && action == WA_INACTIVE) { | 406 if (close_on_deactivate_ && action == WA_INACTIVE) { |
408 // Send a windows message so that any derived classes | 407 // Send a windows message so that any derived classes |
409 // will get a change to override the default handling | 408 // will get a change to override the default handling |
410 SendMessage(WM_CANCELMODE); | 409 SendMessage(WM_CANCELMODE); |
411 } | 410 } |
412 } | 411 } |
413 | 412 |
414 void RenderWidgetHostViewWin::OnDestroy() { | 413 void RenderWidgetHostViewWin::OnDestroy() { |
415 ResetTooltip(); | 414 ResetTooltip(); |
416 TrackMouseLeave(false); | 415 TrackMouseLeave(false); |
417 TRACK_HWND_DESTRUCTION(m_hWnd); | |
418 } | 416 } |
419 | 417 |
420 void RenderWidgetHostViewWin::OnPaint(HDC dc) { | 418 void RenderWidgetHostViewWin::OnPaint(HDC dc) { |
421 DCHECK(render_widget_host_->process()->channel()); | 419 DCHECK(render_widget_host_->process()->channel()); |
422 | 420 |
423 CPaintDC paint_dc(m_hWnd); | 421 CPaintDC paint_dc(m_hWnd); |
424 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); | 422 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); |
425 | 423 |
426 BackingStore* backing_store = render_widget_host_->GetBackingStore(); | 424 BackingStore* backing_store = render_widget_host_->GetBackingStore(); |
427 | 425 |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 // WM_LBUTTONDOWN. | 969 // WM_LBUTTONDOWN. |
972 SetFocus(); | 970 SetFocus(); |
973 } | 971 } |
974 } | 972 } |
975 | 973 |
976 void RenderWidgetHostViewWin::ShutdownHost() { | 974 void RenderWidgetHostViewWin::ShutdownHost() { |
977 shutdown_factory_.RevokeAll(); | 975 shutdown_factory_.RevokeAll(); |
978 render_widget_host_->Shutdown(); | 976 render_widget_host_->Shutdown(); |
979 // Do not touch any members at this point, |this| has been deleted. | 977 // Do not touch any members at this point, |this| has been deleted. |
980 } | 978 } |
OLD | NEW |