diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-14 18:51:25 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-14 18:51:25 +0000 |
commit | c2273e84167c70eed66fa5b0fd9caa0c3728695b (patch) | |
tree | f17d452451a25bf84c40c28f8e75cfe097463ceb | |
parent | a2358df826ac582aba81cdd1c780483e41f79529 (diff) | |
download | chromium_src-c2273e84167c70eed66fa5b0fd9caa0c3728695b.zip chromium_src-c2273e84167c70eed66fa5b0fd9caa0c3728695b.tar.gz chromium_src-c2273e84167c70eed66fa5b0fd9caa0c3728695b.tar.bz2 |
Disable selection on aura. Clipboard semantics on aura must be same as windows
BUG=103490
TEST=ExtensionClipboardApiTest passes on aura
Review URL: http://codereview.chromium.org/8540031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109915 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/extension_clipboard_api.cc | 16 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_clipboard_apitest.cc | 10 | ||||
-rw-r--r-- | ui/base/clipboard/clipboard.h | 2 | ||||
-rw-r--r-- | webkit/glue/webclipboard_impl.cc | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/chrome/browser/extensions/extension_clipboard_api.cc b/chrome/browser/extensions/extension_clipboard_api.cc index 0c7ce27..1923c10 100644 --- a/chrome/browser/extensions/extension_clipboard_api.cc +++ b/chrome/browser/extensions/extension_clipboard_api.cc @@ -41,8 +41,9 @@ const char kBufferNotSupportedError[] = "Buffer is not supported."; // Converts data MIME type to data format known to ui::Clipboard. MIME type is // given as a string. Returns false iff the string could not be converted. -bool ConvertMimeTypeStringToClipboardType(const std::string& mime_type, - ui::Clipboard::FormatType* format_type) { +bool ConvertMimeTypeStringToClipboardType( + const std::string& mime_type, + ui::Clipboard::FormatType* format_type) { if (mime_type == kMimeTypePlainText) { *format_type = ui::Clipboard::GetPlainTextFormatType(); return true; @@ -57,8 +58,9 @@ bool ConvertMimeTypeStringToClipboardType(const std::string& mime_type, // Converts data MIME type to data format known to ui::Clipboard. MIME type is // given as a enum value. Returns false iff the enum value could not be // converted. -bool ConvertMimeTypeEnumToClipboardType(SupportedMimeType mime_type, - ui::Clipboard::FormatType* format_type) { +bool ConvertMimeTypeEnumToClipboardType( + SupportedMimeType mime_type, + ui::Clipboard::FormatType* format_type) { switch (mime_type) { case MIME_TYPE_TEXT: *format_type = ui::Clipboard::GetPlainTextFormatType(); @@ -90,7 +92,7 @@ bool MimeTypeEnumToString(SupportedMimeType mime_type_enum, // Converts a buffer type given as a string to buffer type known to // ui::Clipboard. Returns false iff the conversion is not possible. bool ConvertBufferTypeToClipboardType(const std::string& buffer, - ui::Clipboard::Buffer* buffer_type) { + ui::Clipboard::Buffer* buffer_type) { if (buffer == kBufferStandard) { *buffer_type = ui::Clipboard::BUFFER_STANDARD; return true; @@ -169,8 +171,8 @@ bool ReadDataClipboardFunction::RunImpl() { std::string buffer; args_->GetString(1, &buffer); -// Windows and Mac don't support selection clipboard buffer. -#if (defined(OS_WIN) || defined(OS_MACOSX)) +// Windows, Mac and Aura don't support selection clipboard buffer. +#if (defined(OS_WIN) || defined(OS_MACOSX) || defined(USE_AURA)) if (buffer != kBufferStandard) { error_ = kBufferReadNotSupportedError; return false; diff --git a/chrome/browser/extensions/extension_clipboard_apitest.cc b/chrome/browser/extensions/extension_clipboard_apitest.cc index ebcdfed..86a850f 100644 --- a/chrome/browser/extensions/extension_clipboard_apitest.cc +++ b/chrome/browser/extensions/extension_clipboard_apitest.cc @@ -16,15 +16,13 @@ class ExtensionClipboardApiTest : public ExtensionApiTest { }; IN_PROC_BROWSER_TEST_F(ExtensionClipboardApiTest, WriteAndReadTest) { -#if defined(OS_WIN) +#if defined(OS_WIN) || defined(USE_AURA) ASSERT_TRUE(RunExtensionTest("clipboard_api/extension_win")) << message_; -#else // !defined(OS_WIN) -#if defined(OS_MACOSX) +#elif defined(OS_MACOSX) ASSERT_TRUE(RunExtensionTest("clipboard_api/extension_mac")) << message_; -#else // !defined(OS_WIN) && !defined(OS_MACOSX) +#else // !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(USE_AURA) ASSERT_TRUE(RunExtensionTest("clipboard_api/extension")) << message_; -#endif // defined(OS_MACOSX) -#endif // defiend(OS_WIN) +#endif }; IN_PROC_BROWSER_TEST_F(ExtensionClipboardApiTest, NoPermission) { diff --git a/ui/base/clipboard/clipboard.h b/ui/base/clipboard/clipboard.h index bb08f9d..9b66369 100644 --- a/ui/base/clipboard/clipboard.h +++ b/ui/base/clipboard/clipboard.h @@ -95,7 +95,7 @@ class UI_EXPORT Clipboard { switch (buffer) { case BUFFER_STANDARD: return true; -#if defined(USE_X11) +#if defined(USE_X11) && !defined(USE_AURA) case BUFFER_SELECTION: return true; #endif diff --git a/webkit/glue/webclipboard_impl.cc b/webkit/glue/webclipboard_impl.cc index 03614b0..0cbecaf 100644 --- a/webkit/glue/webclipboard_impl.cc +++ b/webkit/glue/webclipboard_impl.cc @@ -227,7 +227,7 @@ bool WebClipboardImpl::ConvertBufferType(Buffer buffer, *result = ui::Clipboard::BUFFER_STANDARD; break; case BufferSelection: -#if defined(USE_X11) +#if defined(USE_X11) && !defined(USE_AURA) *result = ui::Clipboard::BUFFER_SELECTION; break; #endif |