OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/bookmarks/bookmark_expanded_state_tracker.h" | 5 #include "chrome/browser/bookmarks/bookmark_expanded_state_tracker.h" |
6 | 6 |
| 7 #include "base/prefs/public/pref_service_base.h" |
7 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
8 #include "base/values.h" | 9 #include "base/values.h" |
9 #include "chrome/browser/api/prefs/pref_service_base.h" | |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
12 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
13 | 13 |
14 BookmarkExpandedStateTracker::BookmarkExpandedStateTracker( | 14 BookmarkExpandedStateTracker::BookmarkExpandedStateTracker( |
15 content::BrowserContext* browser_context, | 15 content::BrowserContext* browser_context, |
16 BookmarkModel* bookmark_model) | 16 BookmarkModel* bookmark_model) |
17 : browser_context_(browser_context), | 17 : browser_context_(browser_context), |
18 bookmark_model_(bookmark_model) { | 18 bookmark_model_(bookmark_model) { |
19 bookmark_model->AddObserver(this); | 19 bookmark_model->AddObserver(this); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 return; | 95 return; |
96 | 96 |
97 ListValue values; | 97 ListValue values; |
98 for (Nodes::const_iterator i = nodes.begin(); i != nodes.end(); ++i) { | 98 for (Nodes::const_iterator i = nodes.begin(); i != nodes.end(); ++i) { |
99 values.Set(values.GetSize(), | 99 values.Set(values.GetSize(), |
100 new StringValue(base::Int64ToString((*i)->id()))); | 100 new StringValue(base::Int64ToString((*i)->id()))); |
101 } | 101 } |
102 | 102 |
103 prefs->Set(prefs::kBookmarkEditorExpandedNodes, values); | 103 prefs->Set(prefs::kBookmarkEditorExpandedNodes, values); |
104 } | 104 } |
OLD | NEW |