summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/glue/bookmark_change_processor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/sync/glue/bookmark_change_processor.cc')
-rw-r--r--chrome/browser/sync/glue/bookmark_change_processor.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc
index 1151ec1..42764e5 100644
--- a/chrome/browser/sync/glue/bookmark_change_processor.cc
+++ b/chrome/browser/sync/glue/bookmark_change_processor.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -7,7 +7,9 @@
#include <stack>
#include <vector>
+#include "base/string16.h"
#include "base/string_util.h"
+#include "base/utf_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/favicon_service.h"
@@ -49,7 +51,7 @@ void BookmarkChangeProcessor::UpdateSyncNodeProperties(
const BookmarkNode* src, BookmarkModel* model, sync_api::WriteNode* dst) {
// Set the properties of the item.
dst->SetIsFolder(src->is_folder());
- dst->SetTitle(src->GetTitle());
+ dst->SetTitle(UTF16ToWideHack(src->GetTitle()));
if (!src->is_folder())
dst->SetURL(src->GetURL());
SetSyncNodeFavicon(src, model, dst);
@@ -395,7 +397,7 @@ void BookmarkChangeProcessor::ApplyChangesFromSyncModel(
if (!foster_parent) {
foster_parent = model->AddGroup(model->other_node(),
model->other_node()->GetChildCount(),
- std::wstring());
+ string16());
}
for (int i = dst->GetChildCount() - 1; i >= 0; --i) {
model->Move(dst->GetChild(i), foster_parent,
@@ -463,7 +465,7 @@ const BookmarkNode* BookmarkChangeProcessor::CreateOrUpdateBookmarkNode(
if (!src->GetIsFolder())
model->SetURL(dst, src->GetURL());
- model->SetTitle(dst, src->GetTitle());
+ model->SetTitle(dst, WideToUTF16Hack(src->GetTitle()));
SetBookmarkFavicon(src, dst, model->profile());
}
@@ -484,10 +486,12 @@ const BookmarkNode* BookmarkChangeProcessor::CreateBookmarkNode(
const BookmarkNode* node;
if (sync_node->GetIsFolder()) {
- node = model->AddGroup(parent, index, sync_node->GetTitle());
+ node = model->AddGroup(parent, index,
+ WideToUTF16Hack(sync_node->GetTitle()));
} else {
node = model->AddURL(parent, index,
- sync_node->GetTitle(), sync_node->GetURL());
+ WideToUTF16Hack(sync_node->GetTitle()),
+ sync_node->GetURL());
SetBookmarkFavicon(sync_node, node, model->profile());
}
return node;
@@ -516,7 +520,7 @@ bool BookmarkChangeProcessor::SetBookmarkFavicon(
FaviconService* favicon_service =
profile->GetFaviconService(Profile::EXPLICIT_ACCESS);
- history->AddPage(bookmark_node->GetURL());
+ history->AddPage(bookmark_node->GetURL(), history::SOURCE_SYNCED);
favicon_service->SetFavicon(bookmark_node->GetURL(),
fake_icon_url,
icon_bytes_vector);