OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 CHROME_COMMON_RENDER_MESSAGES_H_ | 5 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ |
6 #define CHROME_COMMON_RENDER_MESSAGES_H_ | 6 #define CHROME_COMMON_RENDER_MESSAGES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 #include <map> | 10 #include <map> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/clipboard.h" |
13 #include "base/gfx/native_widget_types.h" | 14 #include "base/gfx/native_widget_types.h" |
14 #include "base/ref_counted.h" | 15 #include "base/ref_counted.h" |
15 #include "base/shared_memory.h" | 16 #include "base/shared_memory.h" |
16 #include "chrome/browser/renderer_host/resource_handler.h" | 17 #include "chrome/browser/renderer_host/resource_handler.h" |
17 #include "chrome/common/common_param_traits.h" | 18 #include "chrome/common/common_param_traits.h" |
18 #include "chrome/common/css_colors.h" | 19 #include "chrome/common/css_colors.h" |
19 #include "chrome/common/extensions/update_manifest.h" | 20 #include "chrome/common/extensions/update_manifest.h" |
20 #include "chrome/common/extensions/url_pattern.h" | 21 #include "chrome/common/extensions/url_pattern.h" |
21 #include "chrome/common/filter_policy.h" | 22 #include "chrome/common/filter_policy.h" |
22 #include "chrome/common/modal_dialog_event.h" | 23 #include "chrome/common/modal_dialog_event.h" |
(...skipping 2156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 if (!ReadParam(m, iter, &spec)) | 2180 if (!ReadParam(m, iter, &spec)) |
2180 return false; | 2181 return false; |
2181 | 2182 |
2182 return p->Parse(spec); | 2183 return p->Parse(spec); |
2183 } | 2184 } |
2184 static void Log(const param_type& p, std::wstring* l) { | 2185 static void Log(const param_type& p, std::wstring* l) { |
2185 LogParam(p.GetAsString(), l); | 2186 LogParam(p.GetAsString(), l); |
2186 } | 2187 } |
2187 }; | 2188 }; |
2188 | 2189 |
| 2190 template <> |
| 2191 struct ParamTraits<Clipboard::Buffer> { |
| 2192 typedef Clipboard::Buffer param_type; |
| 2193 static void Write(Message* m, const param_type& p) { |
| 2194 m->WriteInt(p); |
| 2195 } |
| 2196 static bool Read(const Message* m, void** iter, param_type* p) { |
| 2197 int buffer; |
| 2198 if (!m->ReadInt(iter, &buffer) || !Clipboard::IsValidBuffer(buffer)) |
| 2199 return false; |
| 2200 *p = Clipboard::FromInt(buffer); |
| 2201 return true; |
| 2202 } |
| 2203 static void Log(const param_type& p, std::wstring* l) { |
| 2204 std::wstring type; |
| 2205 switch (p) { |
| 2206 case Clipboard::BUFFER_STANDARD: |
| 2207 type = L"BUFFER_STANDARD"; |
| 2208 break; |
| 2209 #if defined(OS_LINUX) |
| 2210 case Clipboard::BUFFER_SELECTION: |
| 2211 type = L"BUFFER_SELECTION"; |
| 2212 break; |
| 2213 #endif |
| 2214 default: |
| 2215 type = L"UNKNOWN"; |
| 2216 break; |
| 2217 } |
| 2218 |
| 2219 LogParam(type, l); |
| 2220 } |
| 2221 }; |
| 2222 |
2189 } // namespace IPC | 2223 } // namespace IPC |
2190 | 2224 |
2191 | 2225 |
2192 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" | 2226 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" |
2193 #include "ipc/ipc_message_macros.h" | 2227 #include "ipc/ipc_message_macros.h" |
2194 | 2228 |
2195 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ | 2229 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
OLD | NEW |