Commit 7df0a99f authored by Darwin Huang's avatar Darwin Huang Committed by Commit Bot

ui/base/clipboard: Simplify MacOS-specific constants.

(1) Simplify clipboard_constants code by consistently specifying
constants in clipboard_constants (as opposed to clipboard_format_type).

(2) Add comments to explain the need for separation between
clipboard_constants and clipboard_constants_mac.

No intended functional changes.

Change-Id: I8c9520341c4d90f1a071c65d22b91e91eca5d410
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1886112Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Darwin Huang <huangdarwin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710900}
parent 59d750b6
......@@ -10,13 +10,17 @@ const char kMimeTypeText[] = "text/plain";
const char kMimeTypeTextUtf8[] = "text/plain;charset=utf-8";
const char kMimeTypeURIList[] = "text/uri-list";
const char kMimeTypeMozillaURL[] = "text/x-moz-url";
// Unstandardized format for downloading files after drop events. Now only
// works in Windows, but used to also work in Linux and MacOS.
// See https://crbug.com/860557 and https://crbug.com/425170.
const char kMimeTypeDownloadURL[] = "downloadurl";
const char kMimeTypeHTML[] = "text/html";
const char kMimeTypeRTF[] = "text/rtf";
const char kMimeTypePNG[] = "image/png";
#if !defined(OS_MACOSX)
// TODO(dcheng): This name is temporary. See crbug.com/106449.
const char kMimeTypeWebCustomData[] = "chromium/x-web-custom-data";
const char kMimeTypeWebkitSmartPaste[] = "chromium/x-webkit-paste";
const char kMimeTypePepperCustomData[] = "chromium/x-pepper-custom-data";
#endif // defined(OS_MACOSX)
} // namespace ui
......@@ -20,12 +20,7 @@ class NSString;
namespace ui {
#if defined(OS_MACOSX)
COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES)
extern NSString* const kWebCustomDataPboardType;
#endif
// MIME type constants.
// Platform-Neutral MIME type constants.
COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeText[];
COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeTextUtf8[];
COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeURIList[];
......@@ -34,12 +29,27 @@ COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeMozillaURL[];
COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeHTML[];
COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypeRTF[];
COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES) extern const char kMimeTypePNG[];
#if !defined(OS_MACOSX)
COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES)
extern const char kMimeTypeWebCustomData[];
COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES)
extern const char kMimeTypeWebkitSmartPaste[];
COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES)
extern const char kMimeTypePepperCustomData[];
#else
// MacOS-specific Uniform Type Identifiers.
// Pickled data.
COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES)
extern NSString* const kWebCustomDataPboardType;
// Tells us if WebKit was the last to write to the pasteboard. There's no
// actual data associated with this type.
COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES)
extern NSString* const kWebSmartPastePboardType;
// Pepper custom data format type.
COMPONENT_EXPORT(BASE_CLIPBOARD_TYPES)
extern NSString* const kPepperCustomDataPboardType;
#endif // defined(OS_MACOSX)
} // namespace ui
......
......@@ -9,8 +9,9 @@
namespace ui {
// TODO(dcheng): This name is temporary. See crbug.com/106449.
#if !defined(USE_AURA)
NSString* const kWebCustomDataPboardType = @"org.chromium.web-custom-data";
#endif
NSString* const kWebSmartPastePboardType = @"NeXT smart paste pasteboard type";
NSString* const kPepperCustomDataPboardType =
@"org.chromium.pepper-custom-data";
} // namespace ui
......@@ -17,11 +17,13 @@
#include <objidl.h>
#endif
#if defined(OS_MACOSX)
#ifdef __OBJC__
@class NSString;
#else
class NSString;
#endif
#endif // defined(OS_MACOSX)
namespace ui {
......
......@@ -11,18 +11,6 @@
namespace ui {
namespace {
// Tells us if WebKit was the last to write to the pasteboard. There's no
// actual data associated with this type.
NSString* const kWebSmartPastePboardType = @"NeXT smart paste pasteboard type";
// Pepper custom data format type.
NSString* const kPepperCustomDataPboardType =
@"org.chromium.pepper-custom-data";
} // namespace
// ClipboardFormatType implementation.
ClipboardFormatType::ClipboardFormatType() : data_(nil) {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment