diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-31 18:04:33 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-31 18:04:33 +0000 |
commit | 8ce9e490f79236a93767ab3e153995e9c19735dd (patch) | |
tree | 08aaf3e0b68f7a3e9b84691999f719cf5fc992bb /chrome/browser/bookmarks | |
parent | 814e87b6e5236aaa38d97a9e2b2e9e6a4bae2c59 (diff) | |
download | chromium_src-8ce9e490f79236a93767ab3e153995e9c19735dd.zip chromium_src-8ce9e490f79236a93767ab3e153995e9c19735dd.tar.gz chromium_src-8ce9e490f79236a93767ab3e153995e9c19735dd.tar.bz2 |
FilePath: remove some functions that aren't really used.
And fix the one caller.
Review URL: http://codereview.chromium.org/7087009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87327 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks')
-rw-r--r-- | chrome/browser/bookmarks/bookmark_node_data.cc | 28 | ||||
-rw-r--r-- | chrome/browser/bookmarks/bookmark_node_data.h | 4 |
2 files changed, 20 insertions, 12 deletions
diff --git a/chrome/browser/bookmarks/bookmark_node_data.cc b/chrome/browser/bookmarks/bookmark_node_data.cc index ed2d38c..b24432a 100644 --- a/chrome/browser/bookmarks/bookmark_node_data.cc +++ b/chrome/browser/bookmarks/bookmark_node_data.cc @@ -198,17 +198,26 @@ bool BookmarkNodeData::ClipboardContainsBookmarks() { } #else void BookmarkNodeData::WriteToClipboard(Profile* profile) const { - bookmark_pasteboard_helper_mac::WriteToClipboard(elements, profile_path_); + bookmark_pasteboard_helper_mac::WriteToClipboard(elements, + profile_path_.value()); } bool BookmarkNodeData::ReadFromClipboard() { - return bookmark_pasteboard_helper_mac::ReadFromClipboard(elements, - &profile_path_); + // TODO(evan): bookmark_pasteboard_helper_mac should just use FilePaths. + FilePath::StringType buf; + if (!bookmark_pasteboard_helper_mac::ReadFromClipboard(elements, &buf)) + return false; + profile_path_ = FilePath(buf); + return true; } bool BookmarkNodeData::ReadFromDragClipboard() { - return bookmark_pasteboard_helper_mac::ReadFromDragClipboard(elements, - &profile_path_); + // TODO(evan): bookmark_pasteboard_helper_mac should just use FilePaths. + FilePath::StringType buf; + if (!bookmark_pasteboard_helper_mac::ReadFromDragClipboard(elements, &buf)) + return false; + profile_path_ = FilePath(buf); + return true; } bool BookmarkNodeData::ClipboardContainsBookmarks() { @@ -262,7 +271,7 @@ bool BookmarkNodeData::Read(const ui::OSExchangeData& data) { void BookmarkNodeData::WriteToPickle(Profile* profile, Pickle* pickle) const { FilePath path = profile ? profile->GetPath() : FilePath(); - FilePath::WriteStringTypeToPickle(pickle, path.value()); + path.WriteToPickle(pickle); pickle->WriteSize(elements.size()); for (size_t i = 0; i < elements.size(); ++i) @@ -272,8 +281,7 @@ void BookmarkNodeData::WriteToPickle(Profile* profile, Pickle* pickle) const { bool BookmarkNodeData::ReadFromPickle(Pickle* pickle) { void* data_iterator = NULL; size_t element_count; - if (FilePath::ReadStringTypeFromPickle(pickle, &data_iterator, - &profile_path_) && + if (profile_path_.ReadFromPickle(pickle, &data_iterator) && pickle->ReadSize(&data_iterator, &element_count)) { std::vector<Element> tmp_elements; tmp_elements.resize(element_count); @@ -321,10 +329,10 @@ void BookmarkNodeData::SetOriginatingProfile(Profile* profile) { DCHECK(profile_path_.empty()); if (profile) - profile_path_ = profile->GetPath().value(); + profile_path_ = profile->GetPath(); } bool BookmarkNodeData::IsFromProfile(Profile* profile) const { // An empty path means the data is not associated with any profile. - return !profile_path_.empty() && profile_path_ == profile->GetPath().value(); + return !profile_path_.empty() && profile_path_ == profile->GetPath(); } diff --git a/chrome/browser/bookmarks/bookmark_node_data.h b/chrome/browser/bookmarks/bookmark_node_data.h index adde83c..9519bb4 100644 --- a/chrome/browser/bookmarks/bookmark_node_data.h +++ b/chrome/browser/bookmarks/bookmark_node_data.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -160,7 +160,7 @@ struct BookmarkNodeData { private: // Path of the profile we originated from. - FilePath::StringType profile_path_; + FilePath profile_path_; }; #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_ |