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

Unified Diff: chrome/browser/download/download_util.cc

Issue 9154: Rewrote the clipboard API to be more concurrent. Added a helper class to make... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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
Index: chrome/browser/download/download_util.cc
===================================================================
--- chrome/browser/download/download_util.cc (revision 4189)
+++ chrome/browser/download/download_util.cc (working copy)
@@ -10,6 +10,7 @@
#include "base/base_drag_source.h"
#include "base/file_util.h"
+#include "base/scoped_clipboard_writer.h"
#include "base/gfx/image_operations.h"
#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/browser_process.h"
@@ -103,24 +104,20 @@
}
void BaseContextMenu::ExecuteCommand(int id) {
- ClipboardService* clipboard = g_browser_process->clipboard_service();
- DCHECK(clipboard);
+ ScopedClipboardWriter scw(g_browser_process->clipboard_service());
switch (id) {
case SHOW_IN_FOLDER:
download_->manager()->ShowDownloadInShell(download_);
break;
case COPY_LINK:
- clipboard->Clear();
- clipboard->WriteText(download_->url());
+ scw.WriteText(download_->url());
break;
case COPY_PATH:
- clipboard->Clear();
- clipboard->WriteText(download_->full_path());
+ scw.WriteText(download_->full_path());
break;
case COPY_FILE:
// TODO(paulg): Move to OSExchangeData when implementing drag and drop?
- clipboard->Clear();
- clipboard->WriteFile(download_->full_path());
+ scw.WriteFile(download_->full_path());
break;
case OPEN_WHEN_COMPLETE:
OpenDownload(download_);
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit.cc ('k') | chrome/browser/render_view_context_menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698