Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: ui/base/clipboard/clipboard_aura.cc

Issue 2047703003: Revert of Implement ui::ClipboardMus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/base/clipboard/clipboard_android.cc ('k') | ui/base/clipboard/clipboard_aurax11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/base/clipboard/clipboard_aura.h" 5 #include "ui/base/clipboard/clipboard_aura.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <list> 10 #include <list>
11 #include <memory> 11 #include <memory>
12 12
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/stl_util.h" 16 #include "base/stl_util.h"
17 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
18 #include "third_party/skia/include/core/SkBitmap.h" 18 #include "third_party/skia/include/core/SkBitmap.h"
19 #include "ui/base/clipboard/custom_data_helper.h" 19 #include "ui/base/clipboard/custom_data_helper.h"
20 #include "ui/gfx/geometry/size.h" 20 #include "ui/gfx/geometry/size.h"
21 21
22 namespace ui { 22 namespace ui {
23 23
24 namespace { 24 namespace {
25 const char kMimeTypeFilename[] = "chromium/filename"; 25 const char kMimeTypeFilename[] = "chromium/filename";
26 const char kMimeTypeBitmap[] = "image/bmp"; 26 const char kMimeTypeBitmap[] = "image/bmp";
27 const char kMimeTypePepperCustomData[] = "chromium/x-pepper-custom-data";
28 const char kMimeTypeWebkitSmartPaste[] = "chromium/x-webkit-paste";
27 const size_t kMaxClipboardSize = 1; 29 const size_t kMaxClipboardSize = 1;
28 30
29 // Clipboard data format used by AuraClipboard. 31 // Clipboard data format used by AuraClipboard.
30 enum AuraClipboardFormat { 32 enum AuraClipboardFormat {
31 TEXT = 1 << 0, 33 TEXT = 1 << 0,
32 HTML = 1 << 1, 34 HTML = 1 << 1,
33 RTF = 1 << 2, 35 RTF = 1 << 2,
34 BOOKMARK = 1 << 3, 36 BOOKMARK = 1 << 3,
35 BITMAP = 1 << 4, 37 BITMAP = 1 << 4,
36 CUSTOM = 1 << 5, 38 CUSTOM = 1 << 5,
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeURIList)); 450 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeURIList));
449 return type; 451 return type;
450 } 452 }
451 453
452 // static 454 // static
453 const Clipboard::FormatType& Clipboard::GetUrlWFormatType() { 455 const Clipboard::FormatType& Clipboard::GetUrlWFormatType() {
454 return GetUrlFormatType(); 456 return GetUrlFormatType();
455 } 457 }
456 458
457 // static 459 // static
458 const Clipboard::FormatType& Clipboard::GetMozUrlFormatType() {
459 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeMozillaURL));
460 return type;
461 }
462
463 // static
464 const Clipboard::FormatType& Clipboard::GetPlainTextFormatType() { 460 const Clipboard::FormatType& Clipboard::GetPlainTextFormatType() {
465 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeText)); 461 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypeText));
466 return type; 462 return type;
467 } 463 }
468 464
469 // static 465 // static
470 const Clipboard::FormatType& Clipboard::GetPlainTextWFormatType() { 466 const Clipboard::FormatType& Clipboard::GetPlainTextWFormatType() {
471 return GetPlainTextFormatType(); 467 return GetPlainTextFormatType();
472 } 468 }
473 469
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 ClipboardDataBuilder::WriteBitmap(bitmap); 683 ClipboardDataBuilder::WriteBitmap(bitmap);
688 } 684 }
689 685
690 void ClipboardAura::WriteData(const FormatType& format, 686 void ClipboardAura::WriteData(const FormatType& format,
691 const char* data_data, 687 const char* data_data,
692 size_t data_len) { 688 size_t data_len) {
693 ClipboardDataBuilder::WriteData(format.ToString(), data_data, data_len); 689 ClipboardDataBuilder::WriteData(format.ToString(), data_data, data_len);
694 } 690 }
695 691
696 } // namespace ui 692 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_android.cc ('k') | ui/base/clipboard/clipboard_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698