OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/android/bookmarks/partner_bookmarks_shim.h" | 5 #include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h" |
6 | 6 |
7 #include <tuple> | 7 #include <tuple> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/prefs/pref_service.h" | |
11 #include "base/values.h" | 10 #include "base/values.h" |
12 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
14 #include "components/bookmarks/browser/bookmark_model.h" | 13 #include "components/bookmarks/browser/bookmark_model.h" |
15 #include "components/pref_registry/pref_registry_syncable.h" | 14 #include "components/pref_registry/pref_registry_syncable.h" |
| 15 #include "components/prefs/pref_service.h" |
16 #include "content/public/browser/browser_context.h" | 16 #include "content/public/browser/browser_context.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 | 18 |
19 using bookmarks::BookmarkNode; | 19 using bookmarks::BookmarkNode; |
20 using content::BrowserThread; | 20 using content::BrowserThread; |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // PartnerModelKeeper is used as a singleton to store an immutable hierarchy | 24 // PartnerModelKeeper is used as a singleton to store an immutable hierarchy |
25 // of partner bookmarks. The hierarchy is retrieved from the partner bookmarks | 25 // of partner bookmarks. The hierarchy is retrieved from the partner bookmarks |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 i != node_rename_remove_map_.end(); | 282 i != node_rename_remove_map_.end(); |
283 ++i) { | 283 ++i) { |
284 base::DictionaryValue* dict = new base::DictionaryValue(); | 284 base::DictionaryValue* dict = new base::DictionaryValue(); |
285 dict->SetString(kMappingUrl, i->first.url().spec()); | 285 dict->SetString(kMappingUrl, i->first.url().spec()); |
286 dict->SetString(kMappingProviderTitle, i->first.provider_title()); | 286 dict->SetString(kMappingProviderTitle, i->first.provider_title()); |
287 dict->SetString(kMappingTitle, i->second); | 287 dict->SetString(kMappingTitle, i->second); |
288 list.Append(dict); | 288 list.Append(dict); |
289 } | 289 } |
290 prefs_->Set(prefs::kPartnerBookmarkMappings, list); | 290 prefs_->Set(prefs::kPartnerBookmarkMappings, list); |
291 } | 291 } |
OLD | NEW |