Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1143)

Side by Side Diff: chrome/browser/views/tab_contents/tab_contents_view_win.cc

Issue 2862025: Canvas refactoring part 2.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/views/sad_tab_view.cc ('k') | chrome/browser/views/tabs/dragged_tab_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/views/tab_contents/tab_contents_view_win.h" 5 #include "chrome/browser/views/tab_contents/tab_contents_view_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "app/os_exchange_data.h" 9 #include "app/os_exchange_data.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
11 #include "base/keyboard_codes.h" 11 #include "base/keyboard_codes.h"
12 #include "base/time.h" 12 #include "base/time.h"
13 #include "base/win_util.h" 13 #include "base/win_util.h"
14 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. 14 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful.
15 #include "chrome/browser/browser_process.h" 15 #include "chrome/browser/browser_process.h"
16 #include "chrome/browser/download/download_request_manager.h" 16 #include "chrome/browser/download/download_request_manager.h"
17 #include "chrome/browser/renderer_host/render_process_host.h" 17 #include "chrome/browser/renderer_host/render_process_host.h"
18 #include "chrome/browser/renderer_host/render_view_host.h" 18 #include "chrome/browser/renderer_host/render_view_host.h"
19 #include "chrome/browser/renderer_host/render_view_host_factory.h" 19 #include "chrome/browser/renderer_host/render_view_host_factory.h"
20 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" 20 #include "chrome/browser/renderer_host/render_widget_host_view_win.h"
21 #include "chrome/browser/tab_contents/interstitial_page.h" 21 #include "chrome/browser/tab_contents/interstitial_page.h"
22 #include "chrome/browser/tab_contents/tab_contents.h" 22 #include "chrome/browser/tab_contents/tab_contents.h"
23 #include "chrome/browser/tab_contents/tab_contents_delegate.h" 23 #include "chrome/browser/tab_contents/tab_contents_delegate.h"
24 #include "chrome/browser/tab_contents/web_drop_target_win.h" 24 #include "chrome/browser/tab_contents/web_drop_target_win.h"
25 #include "chrome/browser/views/sad_tab_view.h" 25 #include "chrome/browser/views/sad_tab_view.h"
26 #include "chrome/browser/views/tab_contents/render_view_context_menu_views.h" 26 #include "chrome/browser/views/tab_contents/render_view_context_menu_views.h"
27 #include "chrome/browser/views/tab_contents/tab_contents_drag_win.h" 27 #include "chrome/browser/views/tab_contents/tab_contents_drag_win.h"
28 #include "gfx/canvas_paint.h" 28 #include "gfx/canvas_skia_paint.h"
29 #include "views/focus/view_storage.h" 29 #include "views/focus/view_storage.h"
30 #include "views/screen.h" 30 #include "views/screen.h"
31 #include "views/widget/root_view.h" 31 #include "views/widget/root_view.h"
32 32
33 using WebKit::WebDragOperation; 33 using WebKit::WebDragOperation;
34 using WebKit::WebDragOperationNone; 34 using WebKit::WebDragOperationNone;
35 using WebKit::WebDragOperationsMask; 35 using WebKit::WebDragOperationsMask;
36 using WebKit::WebInputEvent; 36 using WebKit::WebInputEvent;
37 37
38 // static 38 // static
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 void TabContentsViewWin::OnPaint(HDC junk_dc) { 385 void TabContentsViewWin::OnPaint(HDC junk_dc) {
386 if (tab_contents()->render_view_host() && 386 if (tab_contents()->render_view_host() &&
387 !tab_contents()->render_view_host()->IsRenderViewLive()) { 387 !tab_contents()->render_view_host()->IsRenderViewLive()) {
388 if (sad_tab_ == NULL) { 388 if (sad_tab_ == NULL) {
389 sad_tab_ = new SadTabView(tab_contents()); 389 sad_tab_ = new SadTabView(tab_contents());
390 SetContentsView(sad_tab_); 390 SetContentsView(sad_tab_);
391 } 391 }
392 CRect cr; 392 CRect cr;
393 GetClientRect(&cr); 393 GetClientRect(&cr);
394 sad_tab_->SetBounds(gfx::Rect(cr)); 394 sad_tab_->SetBounds(gfx::Rect(cr));
395 gfx::CanvasPaint canvas(GetNativeView(), true); 395 gfx::CanvasSkiaPaint canvas(GetNativeView(), true);
396 sad_tab_->ProcessPaint(&canvas); 396 sad_tab_->ProcessPaint(canvas.AsCanvas());
397 return; 397 return;
398 } 398 }
399 399
400 // We need to do this to validate the dirty area so we don't end up in a 400 // We need to do this to validate the dirty area so we don't end up in a
401 // WM_PAINTstorm that causes other mysterious bugs (such as WM_TIMERs not 401 // WM_PAINTstorm that causes other mysterious bugs (such as WM_TIMERs not
402 // firing etc). It doesn't matter that we don't have any non-clipped area. 402 // firing etc). It doesn't matter that we don't have any non-clipped area.
403 CPaintDC dc(GetNativeView()); 403 CPaintDC dc(GetNativeView());
404 SetMsgHandled(FALSE); 404 SetMsgHandled(FALSE);
405 } 405 }
406 406
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 } 552 }
553 return false; 553 return false;
554 } 554 }
555 555
556 void TabContentsViewWin::WheelZoom(int distance) { 556 void TabContentsViewWin::WheelZoom(int distance) {
557 if (tab_contents()->delegate()) { 557 if (tab_contents()->delegate()) {
558 bool zoom_in = distance > 0; 558 bool zoom_in = distance > 0;
559 tab_contents()->delegate()->ContentsZoomChange(zoom_in); 559 tab_contents()->delegate()->ContentsZoomChange(zoom_in);
560 } 560 }
561 } 561 }
OLDNEW
« no previous file with comments | « chrome/browser/views/sad_tab_view.cc ('k') | chrome/browser/views/tabs/dragged_tab_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698