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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit.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
« no previous file with comments | « base/scoped_clipboard_writer.cc ('k') | chrome/browser/download/download_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_edit.cc
===================================================================
--- chrome/browser/autocomplete/autocomplete_edit.cc (revision 4189)
+++ chrome/browser/autocomplete/autocomplete_edit.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/gfx/skia_utils.h"
#include "base/iat_patch.h"
#include "base/ref_counted.h"
+#include "base/scoped_clipboard_writer.h"
#include "base/string_util.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/autocomplete/autocomplete_popup.h"
@@ -1385,9 +1386,8 @@
if (text.empty())
return;
- ClipboardService* clipboard = g_browser_process->clipboard_service();
- clipboard->Clear();
- clipboard->WriteText(text);
+ ScopedClipboardWriter scw(g_browser_process->clipboard_service());
+ scw.WriteText(text);
// Check if the user is copying the whole address bar. If they are, we
// assume they are trying to copy a URL and write this to the clipboard as a
@@ -1401,7 +1401,7 @@
// which will screw up our calculation of the desired_tld.
GURL url;
if (model_->GetURLForText(text, &url))
- clipboard->WriteHyperlink(text, url.spec());
+ scw.WriteHyperlink(text, url.spec());
}
void AutocompleteEditView::OnCut() {
« no previous file with comments | « base/scoped_clipboard_writer.cc ('k') | chrome/browser/download/download_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698