OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 BASE_CLIPBOARD_H_ | 5 #ifndef BASE_CLIPBOARD_H_ |
6 #define BASE_CLIPBOARD_H_ | 6 #define BASE_CLIPBOARD_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 typedef std::vector<ObjectMapParam> ObjectMapParams; | 73 typedef std::vector<ObjectMapParam> ObjectMapParams; |
74 typedef std::map<int /* ObjectType */, ObjectMapParams> ObjectMap; | 74 typedef std::map<int /* ObjectType */, ObjectMapParams> ObjectMap; |
75 | 75 |
76 // Buffer designates which clipboard the action should be applied to. | 76 // Buffer designates which clipboard the action should be applied to. |
77 // Only platforms that use the X Window System support the selection | 77 // Only platforms that use the X Window System support the selection |
78 // buffer. Furthermore we currently only use a buffer other than the | 78 // buffer. Furthermore we currently only use a buffer other than the |
79 // standard buffer when reading from the clipboard so only those | 79 // standard buffer when reading from the clipboard so only those |
80 // functions accept a buffer parameter. | 80 // functions accept a buffer parameter. |
81 enum Buffer { | 81 enum Buffer { |
82 BUFFER_STANDARD, | 82 BUFFER_STANDARD, |
83 #if defined(OS_LINUX) | 83 #if defined(USE_X11) |
84 BUFFER_SELECTION, | 84 BUFFER_SELECTION, |
85 #endif | 85 #endif |
86 }; | 86 }; |
87 | 87 |
88 static bool IsValidBuffer(int32 buffer) { | 88 static bool IsValidBuffer(int32 buffer) { |
89 switch (buffer) { | 89 switch (buffer) { |
90 case BUFFER_STANDARD: | 90 case BUFFER_STANDARD: |
91 return true; | 91 return true; |
92 #if defined(OS_LINUX) | 92 #if defined(USE_X11) |
93 case BUFFER_SELECTION: | 93 case BUFFER_SELECTION: |
94 return true; | 94 return true; |
95 #endif | 95 #endif |
96 } | 96 } |
97 return false; | 97 return false; |
98 } | 98 } |
99 | 99 |
100 static Buffer FromInt(int32 buffer) { | 100 static Buffer FromInt(int32 buffer) { |
101 return static_cast<Buffer>(buffer); | 101 return static_cast<Buffer>(buffer); |
102 } | 102 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 241 |
242 TargetMap* clipboard_data_; | 242 TargetMap* clipboard_data_; |
243 GtkClipboard* clipboard_; | 243 GtkClipboard* clipboard_; |
244 GtkClipboard* primary_selection_; | 244 GtkClipboard* primary_selection_; |
245 #endif | 245 #endif |
246 | 246 |
247 DISALLOW_COPY_AND_ASSIGN(Clipboard); | 247 DISALLOW_COPY_AND_ASSIGN(Clipboard); |
248 }; | 248 }; |
249 | 249 |
250 #endif // BASE_CLIPBOARD_H_ | 250 #endif // BASE_CLIPBOARD_H_ |
OLD | NEW |