OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_codec.h" | 5 #include "chrome/browser/bookmarks/bookmark_codec.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
10 #include "chrome/common/l10n_util.h" | 10 #include "chrome/common/l10n_util.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 if (!value.Get(kChildrenKey, &child_values)) | 169 if (!value.Get(kChildrenKey, &child_values)) |
170 return false; | 170 return false; |
171 | 171 |
172 if (child_values->GetType() != Value::TYPE_LIST) | 172 if (child_values->GetType() != Value::TYPE_LIST) |
173 return false; | 173 return false; |
174 | 174 |
175 if (!node) | 175 if (!node) |
176 node = new BookmarkNode(model, GURL()); | 176 node = new BookmarkNode(model, GURL()); |
177 node->type_ = history::StarredEntry::USER_GROUP; | 177 node->type_ = history::StarredEntry::USER_GROUP; |
178 node->date_group_modified_ = | 178 node->date_group_modified_ = |
179 Time::FromInternalValue(StringToInt64(last_modified_date)); | 179 Time::FromInternalValue(StringToInt64( |
180 WideToUTF16Hack(last_modified_date))); | |
brettw
2009/02/27 23:45:15
Don't wrap 4 spaces from random parts of the line.
| |
180 | 181 |
181 if (parent) | 182 if (parent) |
182 parent->Add(parent->GetChildCount(), node); | 183 parent->Add(parent->GetChildCount(), node); |
183 | 184 |
184 if (!DecodeChildren(model, *static_cast<ListValue*>(child_values), node)) | 185 if (!DecodeChildren(model, *static_cast<ListValue*>(child_values), node)) |
185 return false; | 186 return false; |
186 } | 187 } |
187 | 188 |
188 node->SetTitle(title); | 189 node->SetTitle(title); |
189 node->date_added_ = | 190 node->date_added_ = |
190 Time::FromInternalValue(StringToInt64(date_added_string)); | 191 Time::FromInternalValue(StringToInt64(WideToUTF16Hack( |
192 date_added_string))); | |
191 return true; | 193 return true; |
192 } | 194 } |
OLD | NEW |