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

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

Issue 9318003: Update WebClipboard/WebDropData glue to use new getter/setter for WebDragData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/clipboard/clipboard.h ('k') | webkit/glue/webdropdata.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 5 #include "ui/base/clipboard/clipboard.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/size.h" 9 #include "ui/gfx/size.h"
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (!bitmap_data->Map(bitmap_bytes)) { 68 if (!bitmap_data->Map(bitmap_bytes)) {
69 PLOG(ERROR) << "Failed to map bitmap memory"; 69 PLOG(ERROR) << "Failed to map bitmap memory";
70 return false; 70 return false;
71 } 71 }
72 return true; 72 return true;
73 } 73 }
74 74
75 } // namespace 75 } // namespace
76 76
77 const char Clipboard::kMimeTypeText[] = "text/plain"; 77 const char Clipboard::kMimeTypeText[] = "text/plain";
78 const char Clipboard::kMimeTypeURIList[] = "text/uri-list";
79 const char Clipboard::kMimeTypeDownloadURL[] = "downloadurl";
78 const char Clipboard::kMimeTypeHTML[] = "text/html"; 80 const char Clipboard::kMimeTypeHTML[] = "text/html";
79 const char Clipboard::kMimeTypePNG[] = "image/png"; 81 const char Clipboard::kMimeTypePNG[] = "image/png";
80 82
81 void Clipboard::DispatchObject(ObjectType type, const ObjectMapParams& params) { 83 void Clipboard::DispatchObject(ObjectType type, const ObjectMapParams& params) {
82 // All types apart from CBF_WEBKIT need at least 1 non-empty param. 84 // All types apart from CBF_WEBKIT need at least 1 non-empty param.
83 if (type != CBF_WEBKIT && (params.empty() || params[0].empty())) 85 if (type != CBF_WEBKIT && (params.empty() || params[0].empty()))
84 return; 86 return;
85 // Some other types need a non-empty 2nd param. 87 // Some other types need a non-empty 2nd param.
86 if ((type == CBF_BOOKMARK || type == CBF_BITMAP || 88 if ((type == CBF_BOOKMARK || type == CBF_BITMAP ||
87 type == CBF_SMBITMAP || type == CBF_DATA) && 89 type == CBF_SMBITMAP || type == CBF_DATA) &&
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // UI thread (see DispatchObject()). 181 // UI thread (see DispatchObject()).
180 iter->second[0].clear(); 182 iter->second[0].clear();
181 for (size_t i = 0; i < sizeof(SharedMemory*); ++i) 183 for (size_t i = 0; i < sizeof(SharedMemory*); ++i)
182 iter->second[0].push_back(reinterpret_cast<char*>(&bitmap)[i]); 184 iter->second[0].push_back(reinterpret_cast<char*>(&bitmap)[i]);
183 has_shared_bitmap = true; 185 has_shared_bitmap = true;
184 } 186 }
185 } 187 }
186 } 188 }
187 189
188 } // namespace ui 190 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard.h ('k') | webkit/glue/webdropdata.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698