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

Side by Side Diff: chrome/browser/bookmarks/bookmark_node_data.cc

Issue 9232075: Have ScopedClipboardWriter and Clipboard::WriteObjects take a buffer parameter. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix build error. 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
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 "chrome/browser/bookmarks/bookmark_node_data.h" 5 #include "chrome/browser/bookmarks/bookmark_node_data.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 element.url = url; 133 element.url = url;
134 element.is_url = true; 134 element.is_url = true;
135 135
136 elements.push_back(element); 136 elements.push_back(element);
137 137
138 return true; 138 return true;
139 } 139 }
140 140
141 #if !defined(OS_MACOSX) 141 #if !defined(OS_MACOSX)
142 void BookmarkNodeData::WriteToClipboard(Profile* profile) const { 142 void BookmarkNodeData::WriteToClipboard(Profile* profile) const {
143 ui::ScopedClipboardWriter scw(g_browser_process->clipboard()); 143 ui::ScopedClipboardWriter scw(g_browser_process->clipboard(),
144 ui::Clipboard::BUFFER_STANDARD);
144 145
145 // If there is only one element and it is a URL, write the URL to the 146 // If there is only one element and it is a URL, write the URL to the
146 // clipboard. 147 // clipboard.
147 if (elements.size() == 1 && elements[0].is_url) { 148 if (elements.size() == 1 && elements[0].is_url) {
148 const string16& title = elements[0].title; 149 const string16& title = elements[0].title;
149 const std::string url = elements[0].url.spec(); 150 const std::string url = elements[0].url.spec();
150 151
151 scw.WriteBookmark(title, url); 152 scw.WriteBookmark(title, url);
152 scw.WriteHyperlink(net::EscapeForHTML(title), url); 153 scw.WriteHyperlink(net::EscapeForHTML(title), url);
153 154
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 DCHECK(profile_path_.empty()); 344 DCHECK(profile_path_.empty());
344 345
345 if (profile) 346 if (profile)
346 profile_path_ = profile->GetPath(); 347 profile_path_ = profile->GetPath();
347 } 348 }
348 349
349 bool BookmarkNodeData::IsFromProfile(Profile* profile) const { 350 bool BookmarkNodeData::IsFromProfile(Profile* profile) const {
350 // An empty path means the data is not associated with any profile. 351 // An empty path means the data is not associated with any profile.
351 return !profile_path_.empty() && profile_path_ == profile->GetPath(); 352 return !profile_path_.empty() && profile_path_ == profile->GetPath();
352 } 353 }
OLDNEW
« no previous file with comments | « ash/drag_drop/drag_drop_controller_unittest.cc ('k') | chrome/browser/bookmarks/bookmark_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698