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

Unified Diff: chrome/browser/bookmarks/bookmark_drag_data.cc

Issue 1029004: GTK: implement extension bookmark manager drag api.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/bookmarks/bookmark_drag_data.h ('k') | chrome/browser/bookmarks/bookmark_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_drag_data.cc
===================================================================
--- chrome/browser/bookmarks/bookmark_drag_data.cc (revision 41880)
+++ chrome/browser/bookmarks/bookmark_drag_data.cc (working copy)
@@ -89,8 +89,20 @@
BookmarkDragData::BookmarkDragData(
const std::vector<const BookmarkNode*>& nodes) {
+ ReadFromVector(nodes);
+}
+
+bool BookmarkDragData::ReadFromVector(
+ const std::vector<const BookmarkNode*>& nodes) {
+ Clear();
+
+ if (nodes.empty())
+ return false;
+
for (size_t i = 0; i < nodes.size(); ++i)
elements.push_back(Element(nodes[i]));
+
+ return true;
}
#if !defined(OS_MACOSX)
@@ -272,12 +284,14 @@
elements.clear();
}
+void BookmarkDragData::SetOriginatingProfile(Profile* profile) {
+ DCHECK(profile_path_.empty());
+
+ if (profile)
+ profile_path_ = profile->GetPath().value();
+}
+
bool BookmarkDragData::IsFromProfile(Profile* profile) const {
// An empty path means the data is not associated with any profile.
- return (!profile_path_.empty() &&
-#if defined(WCHAR_T_IS_UTF16)
- profile->GetPath().ToWStringHack() == profile_path_);
-#elif defined(WCHAR_T_IS_UTF32)
- profile->GetPath().value() == profile_path_);
-#endif
+ return !profile_path_.empty() && profile_path_ == profile->GetPath().value();
}
« no previous file with comments | « chrome/browser/bookmarks/bookmark_drag_data.h ('k') | chrome/browser/bookmarks/bookmark_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698