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 "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/l10n_util_win.h" | 9 #include "app/l10n_util_win.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 // within the same link/image/etc doesn't cause the tooltip to re-appear. | 643 // within the same link/image/etc doesn't cause the tooltip to re-appear. |
644 if (!tooltip_showing_) { | 644 if (!tooltip_showing_) { |
645 if (::IsWindow(tooltip_hwnd_)) | 645 if (::IsWindow(tooltip_hwnd_)) |
646 ::SendMessage(tooltip_hwnd_, TTM_POP, 0, 0); | 646 ::SendMessage(tooltip_hwnd_, TTM_POP, 0, 0); |
647 } | 647 } |
648 } | 648 } |
649 } | 649 } |
650 | 650 |
651 BackingStore* RenderWidgetHostViewWin::AllocBackingStore( | 651 BackingStore* RenderWidgetHostViewWin::AllocBackingStore( |
652 const gfx::Size& size) { | 652 const gfx::Size& size) { |
653 return new BackingStore(size); | 653 return new BackingStore(render_widget_host_, size); |
654 } | 654 } |
655 | 655 |
656 void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) { | 656 void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) { |
657 RenderWidgetHostView::SetBackground(background); | 657 RenderWidgetHostView::SetBackground(background); |
658 Send(new ViewMsg_SetBackground(render_widget_host_->routing_id(), | 658 Send(new ViewMsg_SetBackground(render_widget_host_->routing_id(), |
659 background)); | 659 background)); |
660 } | 660 } |
661 | 661 |
662 /////////////////////////////////////////////////////////////////////////////// | 662 /////////////////////////////////////////////////////////////////////////////// |
663 // RenderWidgetHostViewWin, private: | 663 // RenderWidgetHostViewWin, private: |
(...skipping 21 matching lines...) Expand all Loading... |
685 | 685 |
686 void RenderWidgetHostViewWin::OnDestroy() { | 686 void RenderWidgetHostViewWin::OnDestroy() { |
687 ResetTooltip(); | 687 ResetTooltip(); |
688 TrackMouseLeave(false); | 688 TrackMouseLeave(false); |
689 } | 689 } |
690 | 690 |
691 void RenderWidgetHostViewWin::OnPaint(HDC dc) { | 691 void RenderWidgetHostViewWin::OnPaint(HDC dc) { |
692 DCHECK(render_widget_host_->process()->channel()); | 692 DCHECK(render_widget_host_->process()->channel()); |
693 | 693 |
694 about_to_validate_and_paint_ = true; | 694 about_to_validate_and_paint_ = true; |
695 BackingStore* backing_store = render_widget_host_->GetBackingStore(); | 695 BackingStore* backing_store = render_widget_host_->GetBackingStore(true); |
696 | 696 |
697 // We initialize |paint_dc| (and thus call BeginPaint()) after calling | 697 // We initialize |paint_dc| (and thus call BeginPaint()) after calling |
698 // GetBackingStore(), so that if it updates the invalid rect we'll catch the | 698 // GetBackingStore(), so that if it updates the invalid rect we'll catch the |
699 // changes and repaint them. | 699 // changes and repaint them. |
700 about_to_validate_and_paint_ = false; | 700 about_to_validate_and_paint_ = false; |
701 CPaintDC paint_dc(m_hWnd); | 701 CPaintDC paint_dc(m_hWnd); |
702 | 702 |
703 gfx::Rect damaged_rect(paint_dc.m_ps.rcPaint); | 703 gfx::Rect damaged_rect(paint_dc.m_ps.rcPaint); |
704 if (damaged_rect.IsEmpty()) | 704 if (damaged_rect.IsEmpty()) |
705 return; | 705 return; |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 // WM_LBUTTONDOWN. | 1313 // WM_LBUTTONDOWN. |
1314 SetFocus(); | 1314 SetFocus(); |
1315 } | 1315 } |
1316 } | 1316 } |
1317 | 1317 |
1318 void RenderWidgetHostViewWin::ShutdownHost() { | 1318 void RenderWidgetHostViewWin::ShutdownHost() { |
1319 shutdown_factory_.RevokeAll(); | 1319 shutdown_factory_.RevokeAll(); |
1320 render_widget_host_->Shutdown(); | 1320 render_widget_host_->Shutdown(); |
1321 // Do not touch any members at this point, |this| has been deleted. | 1321 // Do not touch any members at this point, |this| has been deleted. |
1322 } | 1322 } |
OLD | NEW |