OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/bookmarks/browser/bookmark_codec.h" | 5 #include "components/bookmarks/browser/bookmark_codec.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/json/json_string_value_serializer.h" | 12 #include "base/json/json_string_value_serializer.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/sys_info.h" | |
sky
2017/05/26 03:07:38
You shouldn't need this key anymore.
ssid
2017/05/30 21:39:14
Done.
| |
16 #include "base/values.h" | 17 #include "base/values.h" |
17 #include "components/bookmarks/browser/bookmark_model.h" | 18 #include "components/bookmarks/browser/bookmark_model.h" |
18 #include "components/strings/grit/components_strings.h" | 19 #include "components/strings/grit/components_strings.h" |
19 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
20 #include "url/gurl.h" | 21 #include "url/gurl.h" |
21 | 22 |
22 using base::Time; | 23 using base::Time; |
23 | 24 |
24 namespace bookmarks { | 25 namespace bookmarks { |
25 | 26 |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
426 } | 427 } |
427 | 428 |
428 return true; | 429 return true; |
429 } | 430 } |
430 | 431 |
431 void BookmarkCodec::DecodeMetaInfoHelper( | 432 void BookmarkCodec::DecodeMetaInfoHelper( |
432 const base::DictionaryValue& dict, | 433 const base::DictionaryValue& dict, |
433 const std::string& prefix, | 434 const std::string& prefix, |
434 BookmarkNode::MetaInfoMap* meta_info_map) { | 435 BookmarkNode::MetaInfoMap* meta_info_map) { |
435 for (base::DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) { | 436 for (base::DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) { |
437 bool is_excluded = false; | |
438 for (const auto& excluded : excluded_meta_info_keys_) { | |
439 if (it.key().find(excluded) != std::string::npos) | |
440 is_excluded = true; | |
441 } | |
442 if (is_excluded) | |
443 continue; | |
444 | |
436 if (it.value().IsType(base::Value::Type::DICTIONARY)) { | 445 if (it.value().IsType(base::Value::Type::DICTIONARY)) { |
437 const base::DictionaryValue* subdict; | 446 const base::DictionaryValue* subdict; |
438 it.value().GetAsDictionary(&subdict); | 447 it.value().GetAsDictionary(&subdict); |
439 DecodeMetaInfoHelper(*subdict, prefix + it.key() + ".", meta_info_map); | 448 DecodeMetaInfoHelper(*subdict, prefix + it.key() + ".", meta_info_map); |
440 } else if (it.value().IsType(base::Value::Type::STRING)) { | 449 } else if (it.value().IsType(base::Value::Type::STRING)) { |
441 it.value().GetAsString(&(*meta_info_map)[prefix + it.key()]); | 450 it.value().GetAsString(&(*meta_info_map)[prefix + it.key()]); |
442 } | 451 } |
443 } | 452 } |
444 } | 453 } |
445 | 454 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
492 base::MD5Init(&md5_context_); | 501 base::MD5Init(&md5_context_); |
493 } | 502 } |
494 | 503 |
495 void BookmarkCodec::FinalizeChecksum() { | 504 void BookmarkCodec::FinalizeChecksum() { |
496 base::MD5Digest digest; | 505 base::MD5Digest digest; |
497 base::MD5Final(&digest, &md5_context_); | 506 base::MD5Final(&digest, &md5_context_); |
498 computed_checksum_ = base::MD5DigestToBase16(digest); | 507 computed_checksum_ = base::MD5DigestToBase16(digest); |
499 } | 508 } |
500 | 509 |
501 } // namespace bookmarks | 510 } // namespace bookmarks |
OLD | NEW |