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 #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/common/clipboard_format.h" | 12 #include "content/common/clipboard_format.h" |
13 #include "content/public/browser/browser_message_filter.h" | 13 #include "content/public/browser/browser_message_filter.h" |
14 #include "ui/base/clipboard/clipboard.h" | 14 #include "ui/base/clipboard/clipboard.h" |
15 | 15 |
16 class GURL; | 16 class GURL; |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class ClipboardMessageFilter : public BrowserMessageFilter { | 20 class ClipboardMessageFilter : public BrowserMessageFilter { |
21 public: | 21 public: |
22 ClipboardMessageFilter(); | 22 ClipboardMessageFilter(); |
23 | 23 |
24 virtual void OverrideThreadForMessage( | 24 virtual void OverrideThreadForMessage( |
25 const IPC::Message& message, | 25 const IPC::Message& message, |
26 BrowserThread::ID* thread) OVERRIDE; | 26 BrowserThread::ID* thread) OVERRIDE; |
27 virtual bool OnMessageReceived(const IPC::Message& message, | 27 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
28 bool* message_was_ok) OVERRIDE; | |
29 private: | 28 private: |
30 virtual ~ClipboardMessageFilter(); | 29 virtual ~ClipboardMessageFilter(); |
31 | 30 |
32 void OnWriteObjectsAsync(const ui::Clipboard::ObjectMap& objects); | 31 void OnWriteObjectsAsync(const ui::Clipboard::ObjectMap& objects); |
33 void OnWriteObjectsSync(const ui::Clipboard::ObjectMap& objects, | 32 void OnWriteObjectsSync(const ui::Clipboard::ObjectMap& objects, |
34 base::SharedMemoryHandle bitmap_handle); | 33 base::SharedMemoryHandle bitmap_handle); |
35 static void WriteObjectsOnUIThread(const ui::Clipboard::ObjectMap* objects); | 34 static void WriteObjectsOnUIThread(const ui::Clipboard::ObjectMap* objects); |
36 | 35 |
37 void OnGetSequenceNumber(const ui::ClipboardType type, | 36 void OnGetSequenceNumber(const ui::ClipboardType type, |
38 uint64* sequence_number); | 37 uint64* sequence_number); |
(...skipping 28 matching lines...) Expand all Loading... |
67 // thread. This instance of the clipboard should be accessed only on the IO | 66 // thread. This instance of the clipboard should be accessed only on the IO |
68 // thread. | 67 // thread. |
69 static ui::Clipboard* GetClipboard(); | 68 static ui::Clipboard* GetClipboard(); |
70 | 69 |
71 DISALLOW_COPY_AND_ASSIGN(ClipboardMessageFilter); | 70 DISALLOW_COPY_AND_ASSIGN(ClipboardMessageFilter); |
72 }; | 71 }; |
73 | 72 |
74 } // namespace content | 73 } // namespace content |
75 | 74 |
76 #endif // CONTENT_BROWSER_RENDERER_HOST_CLIPBOARD_MESSAGE_FILTER_H_ | 75 #endif // CONTENT_BROWSER_RENDERER_HOST_CLIPBOARD_MESSAGE_FILTER_H_ |
OLD | NEW |