OLD | NEW |
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 #ifndef CONTENT_BROWSER_RENDERER_HOST_CLIPBOARD_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_CLIPBOARD_MESSAGE_FILTER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_CLIPBOARD_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_CLIPBOARD_MESSAGE_FILTER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "content/browser/browser_message_filter.h" | 12 #include "content/browser/browser_message_filter.h" |
13 #include "ui/base/clipboard/clipboard.h" | 13 #include "ui/base/clipboard/clipboard.h" |
14 | 14 |
15 class GURL; | 15 class GURL; |
16 | 16 |
17 class ClipboardMessageFilter : public BrowserMessageFilter { | 17 class ClipboardMessageFilter : public BrowserMessageFilter { |
18 public: | 18 public: |
19 ClipboardMessageFilter(); | 19 ClipboardMessageFilter(); |
20 | 20 |
21 virtual void OverrideThreadForMessage(const IPC::Message& message, | 21 virtual void OverrideThreadForMessage(const IPC::Message& message, |
22 BrowserThread::ID* thread); | 22 BrowserThread::ID* thread); |
23 virtual bool OnMessageReceived(const IPC::Message& message, | 23 virtual bool OnMessageReceived(const IPC::Message& message, |
24 bool* message_was_ok); | 24 bool* message_was_ok); |
25 private: | 25 private: |
26 ~ClipboardMessageFilter(); | 26 virtual ~ClipboardMessageFilter(); |
27 | 27 |
28 void OnWriteObjectsAsync(const ui::Clipboard::ObjectMap& objects); | 28 void OnWriteObjectsAsync(const ui::Clipboard::ObjectMap& objects); |
29 void OnWriteObjectsSync(const ui::Clipboard::ObjectMap& objects, | 29 void OnWriteObjectsSync(const ui::Clipboard::ObjectMap& objects, |
30 base::SharedMemoryHandle bitmap_handle); | 30 base::SharedMemoryHandle bitmap_handle); |
31 | 31 |
32 void OnIsFormatAvailable(ui::Clipboard::FormatType format, | 32 void OnIsFormatAvailable(ui::Clipboard::FormatType format, |
33 ui::Clipboard::Buffer buffer, | 33 ui::Clipboard::Buffer buffer, |
34 bool* result); | 34 bool* result); |
35 void OnReadAvailableTypes(ui::Clipboard::Buffer buffer, | 35 void OnReadAvailableTypes(ui::Clipboard::Buffer buffer, |
36 std::vector<string16>* types, | 36 std::vector<string16>* types, |
(...skipping 14 matching lines...) Expand all Loading... |
51 // We have our own clipboard because we want to access the clipboard on the | 51 // We have our own clipboard because we want to access the clipboard on the |
52 // IO thread instead of forwarding (possibly synchronous) messages to the UI | 52 // IO thread instead of forwarding (possibly synchronous) messages to the UI |
53 // thread. This instance of the clipboard should be accessed only on the IO | 53 // thread. This instance of the clipboard should be accessed only on the IO |
54 // thread. | 54 // thread. |
55 static ui::Clipboard* GetClipboard(); | 55 static ui::Clipboard* GetClipboard(); |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(ClipboardMessageFilter); | 57 DISALLOW_COPY_AND_ASSIGN(ClipboardMessageFilter); |
58 }; | 58 }; |
59 | 59 |
60 #endif // CONTENT_BROWSER_RENDERER_HOST_CLIPBOARD_MESSAGE_FILTER_H_ | 60 #endif // CONTENT_BROWSER_RENDERER_HOST_CLIPBOARD_MESSAGE_FILTER_H_ |
OLD | NEW |