| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_win.h" | 8 #include "ui/base/clipboard/clipboard_win.h" |
| 9 | 9 |
| 10 #include <shellapi.h> | 10 #include <shellapi.h> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 23 #include "base/strings/utf_offset_string_conversions.h" | 23 #include "base/strings/utf_offset_string_conversions.h" |
| 24 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
| 25 #include "base/win/message_window.h" | 25 #include "base/win/message_window.h" |
| 26 #include "base/win/scoped_gdi_object.h" | 26 #include "base/win/scoped_gdi_object.h" |
| 27 #include "base/win/scoped_hdc.h" | 27 #include "base/win/scoped_hdc.h" |
| 28 #include "third_party/skia/include/core/SkBitmap.h" | 28 #include "third_party/skia/include/core/SkBitmap.h" |
| 29 #include "ui/base/clipboard/clipboard_util_win.h" | 29 #include "ui/base/clipboard/clipboard_util_win.h" |
| 30 #include "ui/base/clipboard/custom_data_helper.h" | 30 #include "ui/base/clipboard/custom_data_helper.h" |
| 31 #include "ui/gfx/canvas.h" | 31 #include "ui/gfx/canvas.h" |
| 32 #include "ui/gfx/size.h" | 32 #include "ui/gfx/geometry/size.h" |
| 33 | 33 |
| 34 namespace ui { | 34 namespace ui { |
| 35 | 35 |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 // A scoper to impersonate the anonymous token and revert when leaving scope | 38 // A scoper to impersonate the anonymous token and revert when leaving scope |
| 39 class AnonymousImpersonator { | 39 class AnonymousImpersonator { |
| 40 public: | 40 public: |
| 41 AnonymousImpersonator() { | 41 AnonymousImpersonator() { |
| 42 must_revert_ = ::ImpersonateAnonymousToken(::GetCurrentThread()); | 42 must_revert_ = ::ImpersonateAnonymousToken(::GetCurrentThread()); |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 if (!clipboard_owner_) | 875 if (!clipboard_owner_) |
| 876 return NULL; | 876 return NULL; |
| 877 | 877 |
| 878 if (clipboard_owner_->hwnd() == NULL) | 878 if (clipboard_owner_->hwnd() == NULL) |
| 879 clipboard_owner_->Create(base::Bind(&ClipboardOwnerWndProc)); | 879 clipboard_owner_->Create(base::Bind(&ClipboardOwnerWndProc)); |
| 880 | 880 |
| 881 return clipboard_owner_->hwnd(); | 881 return clipboard_owner_->hwnd(); |
| 882 } | 882 } |
| 883 | 883 |
| 884 } // namespace ui | 884 } // namespace ui |
| OLD | NEW |