| 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/enhanced_bookmarks/enhanced_bookmark_model.h" | 5 #include "components/enhanced_bookmarks/enhanced_bookmark_model.h" |
| 6 | 6 |
| 7 #include <iomanip> | 7 #include <iomanip> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 return random_id.str(); | 74 return random_id.str(); |
| 75 } | 75 } |
| 76 } // namespace | 76 } // namespace |
| 77 | 77 |
| 78 namespace enhanced_bookmarks { | 78 namespace enhanced_bookmarks { |
| 79 | 79 |
| 80 EnhancedBookmarkModel::EnhancedBookmarkModel(BookmarkModel* bookmark_model, | 80 EnhancedBookmarkModel::EnhancedBookmarkModel(BookmarkModel* bookmark_model, |
| 81 const std::string& version) | 81 const std::string& version) |
| 82 : bookmark_model_(bookmark_model), | 82 : bookmark_model_(bookmark_model), |
| 83 loaded_(false), | 83 loaded_(false), |
| 84 weak_ptr_factory_(this), | 84 version_(version), |
| 85 version_(version) { | 85 weak_ptr_factory_(this) { |
| 86 bookmark_model_->AddObserver(this); | 86 bookmark_model_->AddObserver(this); |
| 87 if (bookmark_model_->loaded()) { | 87 if (bookmark_model_->loaded()) { |
| 88 InitializeIdMap(); | 88 InitializeIdMap(); |
| 89 loaded_ = true; | 89 loaded_ = true; |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| 93 EnhancedBookmarkModel::~EnhancedBookmarkModel() { | 93 EnhancedBookmarkModel::~EnhancedBookmarkModel() { |
| 94 } | 94 } |
| 95 | 95 |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 if (!result) | 486 if (!result) |
| 487 return false; | 487 return false; |
| 488 | 488 |
| 489 std::string encoded; | 489 std::string encoded; |
| 490 base::Base64Encode(output, &encoded); | 490 base::Base64Encode(output, &encoded); |
| 491 bookmark_model_->SetNodeMetaInfo(node, kImageDataKey, encoded); | 491 bookmark_model_->SetNodeMetaInfo(node, kImageDataKey, encoded); |
| 492 return true; | 492 return true; |
| 493 } | 493 } |
| 494 | 494 |
| 495 } // namespace enhanced_bookmarks | 495 } // namespace enhanced_bookmarks |
| OLD | NEW |