| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef UI_BASE_CLIPBOARD_CLIPBOARD_WIN_H_ | 5 #ifndef UI_BASE_CLIPBOARD_CLIPBOARD_WIN_H_ |
| 6 #define UI_BASE_CLIPBOARD_CLIPBOARD_WIN_H_ | 6 #define UI_BASE_CLIPBOARD_CLIPBOARD_WIN_H_ |
| 7 | 7 |
| 8 #include "ui/base/clipboard/clipboard.h" | |
| 9 | |
| 10 #include <stddef.h> | 8 #include <stddef.h> |
| 11 #include <stdint.h> | 9 #include <stdint.h> |
| 12 | 10 |
| 11 #include <memory> |
| 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "ui/base/clipboard/clipboard.h" |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 | 17 |
| 18 class ClipboardWin : public Clipboard { | 18 class ClipboardWin : public Clipboard { |
| 19 private: | 19 private: |
| 20 friend class Clipboard; | 20 friend class Clipboard; |
| 21 | 21 |
| 22 ClipboardWin(); | 22 ClipboardWin(); |
| 23 ~ClipboardWin() override; | 23 ~ClipboardWin() override; |
| 24 | 24 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 void WriteBitmapFromHandle(HBITMAP source_hbitmap, const gfx::Size& size); | 64 void WriteBitmapFromHandle(HBITMAP source_hbitmap, const gfx::Size& size); |
| 65 | 65 |
| 66 // Safely write to system clipboard. Free |handle| on failure. | 66 // Safely write to system clipboard. Free |handle| on failure. |
| 67 void WriteToClipboard(unsigned int format, HANDLE handle); | 67 void WriteToClipboard(unsigned int format, HANDLE handle); |
| 68 | 68 |
| 69 // Return the window that should be the clipboard owner, creating it | 69 // Return the window that should be the clipboard owner, creating it |
| 70 // if neccessary. Marked const for lazily initialization by const methods. | 70 // if neccessary. Marked const for lazily initialization by const methods. |
| 71 HWND GetClipboardWindow() const; | 71 HWND GetClipboardWindow() const; |
| 72 | 72 |
| 73 // Mark this as mutable so const methods can still do lazy initialization. | 73 // Mark this as mutable so const methods can still do lazy initialization. |
| 74 mutable scoped_ptr<base::win::MessageWindow> clipboard_owner_; | 74 mutable std::unique_ptr<base::win::MessageWindow> clipboard_owner_; |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(ClipboardWin); | 76 DISALLOW_COPY_AND_ASSIGN(ClipboardWin); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 } // namespace ui | 79 } // namespace ui |
| 80 | 80 |
| 81 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_WIN_H_ | 81 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_WIN_H_ |
| OLD | NEW |