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

Side by Side Diff: chrome/browser/ui/tabs/pinned_tab_codec.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 8 years 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 | Annotate | Revision Log
OLDNEW
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/ui/tabs/pinned_tab_codec.h" 5 #include "chrome/browser/ui/tabs/pinned_tab_codec.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/extensions/tab_helper.h" 8 #include "chrome/browser/extensions/tab_helper.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/prefs/scoped_user_pref_update.h" 10 #include "chrome/browser/prefs/scoped_user_pref_update.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return false; 90 return false;
91 tab->url = GURL(url_string); 91 tab->url = GURL(url_string);
92 92
93 if (value.GetString(kAppID, &(tab->app_id))) 93 if (value.GetString(kAppID, &(tab->app_id)))
94 tab->is_app = true; 94 tab->is_app = true;
95 95
96 return true; 96 return true;
97 } 97 }
98 98
99 // static 99 // static
100 void PinnedTabCodec::RegisterUserPrefs(PrefService* prefs) { 100 void PinnedTabCodec::RegisterUserPrefs(PrefServiceSyncable* prefs) {
101 prefs->RegisterListPref(prefs::kPinnedTabs, PrefService::UNSYNCABLE_PREF); 101 prefs->RegisterListPref(prefs::kPinnedTabs,
102 PrefServiceSyncable::UNSYNCABLE_PREF);
102 } 103 }
103 104
104 // static 105 // static
105 void PinnedTabCodec::WritePinnedTabs(Profile* profile) { 106 void PinnedTabCodec::WritePinnedTabs(Profile* profile) {
106 PrefService* prefs = profile->GetPrefs(); 107 PrefService* prefs = profile->GetPrefs();
107 if (!prefs) 108 if (!prefs)
108 return; 109 return;
109 110
110 ListValue values; 111 ListValue values;
111 for (BrowserList::const_iterator i = BrowserList::begin(); 112 for (BrowserList::const_iterator i = BrowserList::begin();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 for (size_t i = 0, max = tabs_list->GetSize(); i < max; ++i) { 153 for (size_t i = 0, max = tabs_list->GetSize(); i < max; ++i) {
153 const base::DictionaryValue* tab_values = NULL; 154 const base::DictionaryValue* tab_values = NULL;
154 if (tabs_list->GetDictionary(i, &tab_values)) { 155 if (tabs_list->GetDictionary(i, &tab_values)) {
155 StartupTab tab; 156 StartupTab tab;
156 if (DecodeTab(*tab_values, &tab)) 157 if (DecodeTab(*tab_values, &tab))
157 results.push_back(tab); 158 results.push_back(tab);
158 } 159 }
159 } 160 }
160 return results; 161 return results;
161 } 162 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/pinned_tab_codec.h ('k') | chrome/browser/ui/tabs/tab_strip_layout_type_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698