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 #include "ppapi/shared_impl/flash_clipboard_format_registry.h" | 5 #include "ppapi/shared_impl/flash_clipboard_format_registry.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include <cctype> | 9 #include <cctype> |
8 | 10 |
| 11 #include "base/macros.h" |
9 #include "base/numerics/safe_conversions.h" | 12 #include "base/numerics/safe_conversions.h" |
10 | 13 |
11 namespace ppapi { | 14 namespace ppapi { |
12 | 15 |
13 namespace { | 16 namespace { |
14 | 17 |
15 // These values are chosen arbitrarily. Flash will never exceed these but if | 18 // These values are chosen arbitrarily. Flash will never exceed these but if |
16 // the interface becomes public, we can reconsider these. | 19 // the interface becomes public, we can reconsider these. |
17 const size_t kMaxNumFormats = 10; | 20 const size_t kMaxNumFormats = 10; |
18 const size_t kMaxFormatNameLength = 50; | 21 const size_t kMaxFormatNameLength = 50; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 83 } |
81 | 84 |
82 // static | 85 // static |
83 bool FlashClipboardFormatRegistry::IsValidPredefinedFormat(uint32_t format) { | 86 bool FlashClipboardFormatRegistry::IsValidPredefinedFormat(uint32_t format) { |
84 if (format == PP_FLASH_CLIPBOARD_FORMAT_INVALID) | 87 if (format == PP_FLASH_CLIPBOARD_FORMAT_INVALID) |
85 return false; | 88 return false; |
86 return format < kFirstCustomFormat; | 89 return format < kFirstCustomFormat; |
87 } | 90 } |
88 | 91 |
89 } // namespace ppapi | 92 } // namespace ppapi |
OLD | NEW |