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/core/browser/bookmark_expanded_state_tracker.h" | 5 #include "components/bookmarks/browser/bookmark_expanded_state_tracker.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "components/bookmarks/core/browser/bookmark_model.h" | 10 #include "components/bookmarks/browser/bookmark_model.h" |
11 #include "components/bookmarks/core/browser/bookmark_utils.h" | 11 #include "components/bookmarks/browser/bookmark_utils.h" |
12 #include "components/bookmarks/core/common/bookmark_pref_names.h" | 12 #include "components/bookmarks/common/bookmark_pref_names.h" |
13 | 13 |
14 BookmarkExpandedStateTracker::BookmarkExpandedStateTracker( | 14 BookmarkExpandedStateTracker::BookmarkExpandedStateTracker( |
15 BookmarkModel* bookmark_model, | 15 BookmarkModel* bookmark_model, |
16 PrefService* pref_service) | 16 PrefService* pref_service) |
17 : bookmark_model_(bookmark_model), | 17 : bookmark_model_(bookmark_model), |
18 pref_service_(pref_service) { | 18 pref_service_(pref_service) { |
19 bookmark_model->AddObserver(this); | 19 bookmark_model->AddObserver(this); |
20 } | 20 } |
21 | 21 |
22 BookmarkExpandedStateTracker::~BookmarkExpandedStateTracker() { | 22 BookmarkExpandedStateTracker::~BookmarkExpandedStateTracker() { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 return; | 101 return; |
102 | 102 |
103 base::ListValue values; | 103 base::ListValue values; |
104 for (Nodes::const_iterator i = nodes.begin(); i != nodes.end(); ++i) { | 104 for (Nodes::const_iterator i = nodes.begin(); i != nodes.end(); ++i) { |
105 values.Set(values.GetSize(), | 105 values.Set(values.GetSize(), |
106 new base::StringValue(base::Int64ToString((*i)->id()))); | 106 new base::StringValue(base::Int64ToString((*i)->id()))); |
107 } | 107 } |
108 | 108 |
109 pref_service_->Set(prefs::kBookmarkEditorExpandedNodes, values); | 109 pref_service_->Set(prefs::kBookmarkEditorExpandedNodes, values); |
110 } | 110 } |
OLD | NEW |