OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tabs/pinned_tab_codec.h" | 5 #include "chrome/browser/tabs/pinned_tab_codec.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/extensions/extension_tab_helper.h" | 8 #include "chrome/browser/extensions/extension_tab_helper.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 tab->url = GURL(url_string); | 82 tab->url = GURL(url_string); |
83 | 83 |
84 if (value.GetString(kAppID, &(tab->app_id))) | 84 if (value.GetString(kAppID, &(tab->app_id))) |
85 tab->is_app = true; | 85 tab->is_app = true; |
86 | 86 |
87 return true; | 87 return true; |
88 } | 88 } |
89 | 89 |
90 // static | 90 // static |
91 void PinnedTabCodec::RegisterUserPrefs(PrefService* prefs) { | 91 void PinnedTabCodec::RegisterUserPrefs(PrefService* prefs) { |
92 prefs->RegisterListPref(prefs::kPinnedTabs); | 92 prefs->RegisterListPref(prefs::kPinnedTabs, PrefService::UNSYNCABLE_PREF); |
93 } | 93 } |
94 | 94 |
95 // static | 95 // static |
96 void PinnedTabCodec::WritePinnedTabs(Profile* profile) { | 96 void PinnedTabCodec::WritePinnedTabs(Profile* profile) { |
97 PrefService* prefs = profile->GetPrefs(); | 97 PrefService* prefs = profile->GetPrefs(); |
98 if (!prefs) | 98 if (!prefs) |
99 return; | 99 return; |
100 | 100 |
101 ListValue values; | 101 ListValue values; |
102 for (BrowserList::const_iterator i = BrowserList::begin(); | 102 for (BrowserList::const_iterator i = BrowserList::begin(); |
(...skipping 23 matching lines...) Expand all Loading... |
126 for (size_t i = 0, max = pref_value->GetSize(); i < max; ++i) { | 126 for (size_t i = 0, max = pref_value->GetSize(); i < max; ++i) { |
127 DictionaryValue* values = NULL; | 127 DictionaryValue* values = NULL; |
128 if (pref_value->GetDictionary(i, &values)) { | 128 if (pref_value->GetDictionary(i, &values)) { |
129 Tab tab; | 129 Tab tab; |
130 if (DecodeTab(*values, &tab)) | 130 if (DecodeTab(*values, &tab)) |
131 results.push_back(tab); | 131 results.push_back(tab); |
132 } | 132 } |
133 } | 133 } |
134 return results; | 134 return results; |
135 } | 135 } |
OLD | NEW |