| 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/tab_contents/tab_contents_view_win.h" | 5 #include "chrome/browser/tab_contents/tab_contents_view_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "app/gfx/chrome_canvas.h" | 9 #include "app/gfx/canvas.h" |
| 10 #include "app/os_exchange_data.h" | 10 #include "app/os_exchange_data.h" |
| 11 #include "chrome/browser/bookmarks/bookmark_drag_data.h" | 11 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
| 12 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. | 12 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/download/download_request_manager.h" | 14 #include "chrome/browser/download/download_request_manager.h" |
| 15 #include "chrome/browser/renderer_host/render_process_host.h" | 15 #include "chrome/browser/renderer_host/render_process_host.h" |
| 16 #include "chrome/browser/renderer_host/render_view_host.h" | 16 #include "chrome/browser/renderer_host/render_view_host.h" |
| 17 #include "chrome/browser/renderer_host/render_view_host_factory.h" | 17 #include "chrome/browser/renderer_host/render_view_host_factory.h" |
| 18 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" | 18 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" |
| 19 #include "chrome/browser/tab_contents/render_view_context_menu_win.h" | 19 #include "chrome/browser/tab_contents/render_view_context_menu_win.h" |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 } | 436 } |
| 437 | 437 |
| 438 void TabContentsViewWin::OnPaint(HDC junk_dc) { | 438 void TabContentsViewWin::OnPaint(HDC junk_dc) { |
| 439 if (tab_contents()->render_view_host() && | 439 if (tab_contents()->render_view_host() && |
| 440 !tab_contents()->render_view_host()->IsRenderViewLive()) { | 440 !tab_contents()->render_view_host()->IsRenderViewLive()) { |
| 441 if (!sad_tab_.get()) | 441 if (!sad_tab_.get()) |
| 442 sad_tab_.reset(new SadTabView); | 442 sad_tab_.reset(new SadTabView); |
| 443 CRect cr; | 443 CRect cr; |
| 444 GetClientRect(&cr); | 444 GetClientRect(&cr); |
| 445 sad_tab_->SetBounds(gfx::Rect(cr)); | 445 sad_tab_->SetBounds(gfx::Rect(cr)); |
| 446 ChromeCanvasPaint canvas(GetNativeView(), true); | 446 gfx::CanvasPaint canvas(GetNativeView(), true); |
| 447 sad_tab_->ProcessPaint(&canvas); | 447 sad_tab_->ProcessPaint(&canvas); |
| 448 return; | 448 return; |
| 449 } | 449 } |
| 450 | 450 |
| 451 // We need to do this to validate the dirty area so we don't end up in a | 451 // We need to do this to validate the dirty area so we don't end up in a |
| 452 // WM_PAINTstorm that causes other mysterious bugs (such as WM_TIMERs not | 452 // WM_PAINTstorm that causes other mysterious bugs (such as WM_TIMERs not |
| 453 // firing etc). It doesn't matter that we don't have any non-clipped area. | 453 // firing etc). It doesn't matter that we don't have any non-clipped area. |
| 454 CPaintDC dc(GetNativeView()); | 454 CPaintDC dc(GetNativeView()); |
| 455 SetMsgHandled(FALSE); | 455 SetMsgHandled(FALSE); |
| 456 } | 456 } |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 } | 607 } |
| 608 return false; | 608 return false; |
| 609 } | 609 } |
| 610 | 610 |
| 611 void TabContentsViewWin::WheelZoom(int distance) { | 611 void TabContentsViewWin::WheelZoom(int distance) { |
| 612 if (tab_contents()->delegate()) { | 612 if (tab_contents()->delegate()) { |
| 613 bool zoom_in = distance > 0; | 613 bool zoom_in = distance > 0; |
| 614 tab_contents()->delegate()->ContentsZoomChange(zoom_in); | 614 tab_contents()->delegate()->ContentsZoomChange(zoom_in); |
| 615 } | 615 } |
| 616 } | 616 } |
| OLD | NEW |