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

Unified Diff: chrome/browser/sync/engine/syncapi.cc

Issue 7612015: sync: Make BaseNode::GetTitle() return std::string. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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/sync/engine/syncapi.h ('k') | chrome/browser/sync/glue/bookmark_change_processor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncapi.cc
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index ff446fe17a09fa204a13948b4b0985b04fcdb931..ea3575de8daa385065b970fffaa8a5103aacef2a 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -180,15 +180,14 @@ static void SyncAPINameToServerName(const std::wstring& sync_api_name,
// server-illegal name followed by one or more spaces, remove the trailing
// space.
static void ServerNameToSyncAPIName(const std::string& server_name,
- std::wstring* out) {
+ std::string* out) {
int length_to_copy = server_name.length();
if (IsNameServerIllegalAfterTrimming(server_name) &&
EndsWithSpace(server_name)) {
--length_to_copy;
}
- if (!UTF8ToWide(server_name.c_str(), length_to_copy, out)) {
- NOTREACHED() << "Could not convert server name from UTF8 to wide";
- }
+ if (out)
akalin 2011/08/11 00:23:02 better to CHECK(out)
tfarina 2011/08/11 00:25:41 Done.
+ *out = std::string(server_name.c_str(), length_to_copy);
}
// Compare the values of two EntitySpecifics, accounting for encryption.
@@ -369,8 +368,8 @@ bool BaseNode::GetIsFolder() const {
return GetEntry()->Get(syncable::IS_DIR);
}
-std::wstring BaseNode::GetTitle() const {
- std::wstring result;
+std::string BaseNode::GetTitle() const {
+ std::string result;
// TODO(zea): refactor bookmarks to not need this functionality.
if (syncable::BOOKMARKS == GetModelType() &&
GetEntry()->Get(syncable::SPECIFICS).has_encrypted()) {
@@ -378,7 +377,7 @@ std::wstring BaseNode::GetTitle() const {
ServerNameToSyncAPIName(GetBookmarkSpecifics().title(), &result);
} else {
ServerNameToSyncAPIName(GetEntry()->Get(syncable::NON_UNIQUE_NAME),
- &result);
+ &result);
}
return result;
}
@@ -415,8 +414,7 @@ DictionaryValue* BaseNode::GetSummaryAsValue() const {
DictionaryValue* node_info = new DictionaryValue();
node_info->SetString("id", base::Int64ToString(GetId()));
node_info->SetBoolean("isFolder", GetIsFolder());
- // TODO(akalin): Add a std::string accessor for the title.
- node_info->SetString("title", WideToUTF8(GetTitle()));
+ node_info->SetString("title", GetTitle());
node_info->Set("type", ModelTypeToValue(GetModelType()));
return node_info;
}
« no previous file with comments | « chrome/browser/sync/engine/syncapi.h ('k') | chrome/browser/sync/glue/bookmark_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698