diff options
author | dcheng <dcheng@chromium.org> | 2014-09-17 14:23:14 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-17 21:24:02 +0000 |
commit | 3749e4e5ae82c3ad4e379d347a115fb2a8ab489b (patch) | |
tree | 94e406ac9d4d99e7d750c5a570af47decd43e460 /components | |
parent | 8722f5bdf2db7537fd9d1f7a381d208ea771d544 (diff) | |
download | chromium_src-3749e4e5ae82c3ad4e379d347a115fb2a8ab489b.zip chromium_src-3749e4e5ae82c3ad4e379d347a115fb2a8ab489b.tar.gz chromium_src-3749e4e5ae82c3ad4e379d347a115fb2a8ab489b.tar.bz2 |
Remove clipboard argument from ScopedClipboardWriter constructor.
Unfortunately, early binding to a clipboard on one thread makes it hard
to implement some cleanups in the clipboard IPC handlers for writing
data. Since all existing callers simply pass in the clipboard for the
current thread, this patch removes the constructor parameter in favor of
having ScopedClipboardWriter use it itself internally.
BUG=319285
Review URL: https://codereview.chromium.org/558913003
Cr-Commit-Position: refs/heads/master@{#295344}
Diffstat (limited to 'components')
-rw-r--r-- | components/bookmarks/browser/bookmark_node_data.cc | 3 | ||||
-rw-r--r-- | components/bookmarks/browser/bookmark_utils_unittest.cc | 7 |
2 files changed, 3 insertions, 7 deletions
diff --git a/components/bookmarks/browser/bookmark_node_data.cc b/components/bookmarks/browser/bookmark_node_data.cc index ad2ad42..8d0d143 100644 --- a/components/bookmarks/browser/bookmark_node_data.cc +++ b/components/bookmarks/browser/bookmark_node_data.cc @@ -157,8 +157,7 @@ bool BookmarkNodeData::ReadFromTuple(const GURL& url, void BookmarkNodeData::WriteToClipboard(ui::ClipboardType clipboard_type) { DCHECK(clipboard_type == ui::CLIPBOARD_TYPE_COPY_PASTE || clipboard_type == ui::CLIPBOARD_TYPE_SELECTION); - ui::ScopedClipboardWriter scw(ui::Clipboard::GetForCurrentThread(), - clipboard_type); + ui::ScopedClipboardWriter scw(clipboard_type); // If there is only one element and it is a URL, write the URL to the // clipboard. diff --git a/components/bookmarks/browser/bookmark_utils_unittest.cc b/components/bookmarks/browser/bookmark_utils_unittest.cc index 61711d2..be6aef6 100644 --- a/components/bookmarks/browser/bookmark_utils_unittest.cc +++ b/components/bookmarks/browser/bookmark_utils_unittest.cc @@ -266,8 +266,7 @@ TEST_F(BookmarkUtilsTest, PasteBookmarkFromURL) { // Write blank text to clipboard. { - ui::ScopedClipboardWriter clipboard_writer( - ui::Clipboard::GetForCurrentThread(), ui::CLIPBOARD_TYPE_COPY_PASTE); + ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_COPY_PASTE); clipboard_writer.WriteText(base::string16()); } // Now we shouldn't be able to paste from the clipboard. @@ -275,8 +274,7 @@ TEST_F(BookmarkUtilsTest, PasteBookmarkFromURL) { // Write some valid url to the clipboard. { - ui::ScopedClipboardWriter clipboard_writer( - ui::Clipboard::GetForCurrentThread(), ui::CLIPBOARD_TYPE_COPY_PASTE); + ui::ScopedClipboardWriter clipboard_writer(ui::CLIPBOARD_TYPE_COPY_PASTE); clipboard_writer.WriteText(url_text); } // Now we should be able to paste from the clipboard. @@ -308,7 +306,6 @@ TEST_F(BookmarkUtilsTest, CopyPaste) { // Write some text to the clipboard. { ui::ScopedClipboardWriter clipboard_writer( - ui::Clipboard::GetForCurrentThread(), ui::CLIPBOARD_TYPE_COPY_PASTE); clipboard_writer.WriteText(ASCIIToUTF16("foo")); } |