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

Unified Diff: ui/base/clipboard/scoped_clipboard_writer.h

Issue 574273002: Rewrite clipboard write IPC handling to be easier to understand. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Document Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/clipboard/clipboard_util_win.cc ('k') | ui/base/clipboard/scoped_clipboard_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/clipboard/scoped_clipboard_writer.h
diff --git a/ui/base/clipboard/scoped_clipboard_writer.h b/ui/base/clipboard/scoped_clipboard_writer.h
index ab799bd65cee9d33baed728ffd86df58dedc3ce1..ba7f1a504e15491b9a4e0bcd1ddef71778a0d6fb 100644
--- a/ui/base/clipboard/scoped_clipboard_writer.h
+++ b/ui/base/clipboard/scoped_clipboard_writer.h
@@ -14,6 +14,7 @@
#include <string>
#include "base/strings/string16.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/ui_base_export.h"
@@ -61,10 +62,12 @@ class UI_BASE_EXPORT ScopedClipboardWriter {
void WritePickledData(const Pickle& pickle,
const Clipboard::FormatType& format);
+ void WriteImage(const SkBitmap& bitmap);
+
// Removes all objects that would be written to the clipboard.
void Reset();
- protected:
+ private:
// Converts |text| to UTF-8 and adds it to the clipboard. If it's a URL, we
// also notify the clipboard of that fact.
void WriteTextOrURL(const base::string16& text, bool is_url);
@@ -74,11 +77,12 @@ class UI_BASE_EXPORT ScopedClipboardWriter {
Clipboard::ObjectMap objects_;
const ClipboardType type_;
+ SkBitmap bitmap_;
+
// We keep around the UTF-8 text of the URL in order to pass it to
// Clipboard::DidWriteURL().
std::string url_text_;
- private:
DISALLOW_COPY_AND_ASSIGN(ScopedClipboardWriter);
};
« no previous file with comments | « ui/base/clipboard/clipboard_util_win.cc ('k') | ui/base/clipboard/scoped_clipboard_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698