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 content::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 virtual ~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(const ui::Clipboard::FormatType& format, | 32 void OnIsFormatAvailable(const ui::Clipboard::FormatType& format, |
(...skipping 20 matching lines...) Expand all Loading... |
53 // We have our own clipboard because we want to access the clipboard on the | 53 // We have our own clipboard because we want to access the clipboard on the |
54 // IO thread instead of forwarding (possibly synchronous) messages to the UI | 54 // IO thread instead of forwarding (possibly synchronous) messages to the UI |
55 // thread. This instance of the clipboard should be accessed only on the IO | 55 // thread. This instance of the clipboard should be accessed only on the IO |
56 // thread. | 56 // thread. |
57 static ui::Clipboard* GetClipboard(); | 57 static ui::Clipboard* GetClipboard(); |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(ClipboardMessageFilter); | 59 DISALLOW_COPY_AND_ASSIGN(ClipboardMessageFilter); |
60 }; | 60 }; |
61 | 61 |
62 #endif // CONTENT_BROWSER_RENDERER_HOST_CLIPBOARD_MESSAGE_FILTER_H_ | 62 #endif // CONTENT_BROWSER_RENDERER_HOST_CLIPBOARD_MESSAGE_FILTER_H_ |
OLD | NEW |