Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(675)

Side by Side Diff: components/enhanced_bookmarks/enhanced_bookmark_model.cc

Issue 641473002: Revert of Bring up of the enhanced bookmarks cluster service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@intermediary2
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 weak_ptr_factory_(this), 84 weak_ptr_factory_(this),
85 version_(version) { 85 version_(version) {
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 Shutdown();
95 } 94 }
96 95
97 void EnhancedBookmarkModel::Shutdown() { 96 void EnhancedBookmarkModel::Shutdown() {
98 if (bookmark_model_) { 97 FOR_EACH_OBSERVER(EnhancedBookmarkModelObserver,
99 FOR_EACH_OBSERVER(EnhancedBookmarkModelObserver, 98 observers_,
100 observers_, 99 EnhancedBookmarkModelShuttingDown());
101 EnhancedBookmarkModelShuttingDown()); 100 weak_ptr_factory_.InvalidateWeakPtrs();
102 weak_ptr_factory_.InvalidateWeakPtrs(); 101 bookmark_model_->RemoveObserver(this);
103 bookmark_model_->RemoveObserver(this); 102 bookmark_model_ = NULL;
104 bookmark_model_ = NULL;
105 }
106 } 103 }
107 104
108 void EnhancedBookmarkModel::AddObserver( 105 void EnhancedBookmarkModel::AddObserver(
109 EnhancedBookmarkModelObserver* observer) { 106 EnhancedBookmarkModelObserver* observer) {
110 observers_.AddObserver(observer); 107 observers_.AddObserver(observer);
111 } 108 }
112 109
113 void EnhancedBookmarkModel::RemoveObserver( 110 void EnhancedBookmarkModel::RemoveObserver(
114 EnhancedBookmarkModelObserver* observer) { 111 EnhancedBookmarkModelObserver* observer) {
115 observers_.RemoveObserver(observer); 112 observers_.RemoveObserver(observer);
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 if (!result) 486 if (!result)
490 return false; 487 return false;
491 488
492 std::string encoded; 489 std::string encoded;
493 base::Base64Encode(output, &encoded); 490 base::Base64Encode(output, &encoded);
494 bookmark_model_->SetNodeMetaInfo(node, kImageDataKey, encoded); 491 bookmark_model_->SetNodeMetaInfo(node, kImageDataKey, encoded);
495 return true; 492 return true;
496 } 493 }
497 494
498 } // namespace enhanced_bookmarks 495 } // namespace enhanced_bookmarks
OLDNEW
« no previous file with comments | « components/enhanced_bookmarks/enhanced_bookmark_model.h ('k') | components/enhanced_bookmarks/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698