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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
96 void EnhancedBookmarkModel::ShutDown() { | 96 void EnhancedBookmarkModel::Shutdown() { |
97 FOR_EACH_OBSERVER(EnhancedBookmarkModelObserver, | 97 FOR_EACH_OBSERVER(EnhancedBookmarkModelObserver, |
98 observers_, | 98 observers_, |
99 EnhancedBookmarkModelShuttingDown()); | 99 EnhancedBookmarkModelShuttingDown()); |
100 weak_ptr_factory_.InvalidateWeakPtrs(); | 100 weak_ptr_factory_.InvalidateWeakPtrs(); |
101 bookmark_model_->RemoveObserver(this); | 101 bookmark_model_->RemoveObserver(this); |
102 bookmark_model_ = NULL; | 102 bookmark_model_ = NULL; |
103 } | 103 } |
104 | 104 |
105 void EnhancedBookmarkModel::AddObserver( | 105 void EnhancedBookmarkModel::AddObserver( |
106 EnhancedBookmarkModelObserver* observer) { | 106 EnhancedBookmarkModelObserver* observer) { |
(...skipping 379 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 |