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

Side by Side Diff: ui/base/clipboard/clipboard_win.cc

Issue 7019013: Removal of dependencies on PlatformDevice classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Syncing merge conflicts. Created 9 years, 7 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 | « ui/base/clipboard/clipboard_mac.mm ('k') | ui/gfx/blit.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Many of these functions are based on those found in 5 // Many of these functions are based on those found in
6 // webkit/port/platform/PasteboardWin.cpp 6 // webkit/port/platform/PasteboardWin.cpp
7 7
8 #include "ui/base/clipboard/clipboard.h" 8 #include "ui/base/clipboard/clipboard.h"
9 9
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 449
450 // Get the dimensions of the bitmap. 450 // Get the dimensions of the bitmap.
451 BITMAPINFO bitmap_info = {}; 451 BITMAPINFO bitmap_info = {};
452 bitmap_info.bmiHeader.biSize = sizeof(bitmap_info.bmiHeader); 452 bitmap_info.bmiHeader.biSize = sizeof(bitmap_info.bmiHeader);
453 ::GetDIBits(source_dc, source_bitmap, 0, 0, 0, &bitmap_info, DIB_RGB_COLORS); 453 ::GetDIBits(source_dc, source_bitmap, 0, 0, 0, &bitmap_info, DIB_RGB_COLORS);
454 int width = bitmap_info.bmiHeader.biWidth; 454 int width = bitmap_info.bmiHeader.biWidth;
455 int height = bitmap_info.bmiHeader.biHeight; 455 int height = bitmap_info.bmiHeader.biHeight;
456 456
457 gfx::CanvasSkia canvas(width, height, false); 457 gfx::CanvasSkia canvas(width, height, false);
458 458
459 HDC destination_dc = canvas.beginPlatformPaint(); 459 skia::ScopedPlatformPaint scoped_platform_paint(&canvas);
460 HDC destination_dc = scoped_platform_paint.GetPlatformSurface();
460 ::BitBlt(destination_dc, 0, 0, width, height, source_dc, 0, 0, SRCCOPY); 461 ::BitBlt(destination_dc, 0, 0, width, height, source_dc, 0, 0, SRCCOPY);
461 canvas.endPlatformPaint();
462 return canvas.ExtractBitmap(); 462 return canvas.ExtractBitmap();
463 } 463 }
464 464
465 void Clipboard::ReadBookmark(string16* title, std::string* url) const { 465 void Clipboard::ReadBookmark(string16* title, std::string* url) const {
466 if (title) 466 if (title)
467 title->clear(); 467 title->clear();
468 468
469 if (url) 469 if (url)
470 url->clear(); 470 url->clear();
471 471
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", 655 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass",
656 L"ClipboardOwnerWindow", 656 L"ClipboardOwnerWindow",
657 0, 0, 0, 0, 0, 657 0, 0, 0, 0, 0,
658 HWND_MESSAGE, 658 HWND_MESSAGE,
659 0, 0, 0); 659 0, 0, 0);
660 } 660 }
661 return clipboard_owner_; 661 return clipboard_owner_;
662 } 662 }
663 663
664 } // namespace ui 664 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_mac.mm ('k') | ui/gfx/blit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698