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

Unified Diff: chrome/browser/tabs/pinned_tab_codec.cc

Issue 10332117: Revert 136573 - Extract StartupTabs and startup types from StartupBrowserCreator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/tabs/pinned_tab_codec.h ('k') | chrome/browser/tabs/pinned_tab_codec_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tabs/pinned_tab_codec.cc
===================================================================
--- chrome/browser/tabs/pinned_tab_codec.cc (revision 136581)
+++ chrome/browser/tabs/pinned_tab_codec.cc (working copy)
@@ -20,6 +20,8 @@
using content::NavigationEntry;
+typedef StartupBrowserCreator::LaunchWithProfile::Tab Tab;
+
// Key used in dictionaries for the app id.
static const char kAppID[] = "app_id";
@@ -37,7 +39,7 @@
}
// Adds a DictionaryValue to |values| representing |tab|.
-static void EncodeTab(const StartupTab& tab, ListValue* values) {
+static void EncodeTab(const Tab& tab, ListValue* values) {
scoped_ptr<DictionaryValue> value(new DictionaryValue);
value->SetString(kURL, tab.url.spec());
if (tab.is_app)
@@ -84,7 +86,7 @@
// Decodes the previously written values in |value| to |tab|, returning true
// on success.
-static bool DecodeTab(const DictionaryValue& value, StartupTab* tab) {
+static bool DecodeTab(const DictionaryValue& value, Tab* tab) {
tab->is_app = false;
std::string url_string;
@@ -122,8 +124,7 @@
}
// static
-void PinnedTabCodec::WritePinnedTabs(Profile* profile,
- const StartupTabs& tabs) {
+void PinnedTabCodec::WritePinnedTabs(Profile* profile, const Tabs& tabs) {
PrefService* prefs = profile->GetPrefs();
if (!prefs)
return;
@@ -131,21 +132,21 @@
ListPrefUpdate update(prefs, prefs::kPinnedTabs);
ListValue* values = update.Get();
values->Clear();
- for (StartupTabs::const_iterator i = tabs.begin(); i != tabs.end(); ++i)
+ for (Tabs::const_iterator i = tabs.begin(); i != tabs.end(); ++i)
EncodeTab(*i, values);
}
// static
-StartupTabs PinnedTabCodec::ReadPinnedTabs(Profile* profile) {
+PinnedTabCodec::Tabs PinnedTabCodec::ReadPinnedTabs(Profile* profile) {
PrefService* prefs = profile->GetPrefs();
if (!prefs)
- return StartupTabs();
+ return Tabs();
return ReadPinnedTabs(prefs->GetList(prefs::kPinnedTabs));
}
// static
-StartupTabs PinnedTabCodec::ReadPinnedTabs(const base::Value* value) {
- StartupTabs results;
+PinnedTabCodec::Tabs PinnedTabCodec::ReadPinnedTabs(const base::Value* value) {
+ Tabs results;
const base::ListValue* tabs_list = NULL;
if (!value->GetAsList(&tabs_list))
@@ -154,7 +155,7 @@
for (size_t i = 0, max = tabs_list->GetSize(); i < max; ++i) {
base::DictionaryValue* tab_values = NULL;
if (tabs_list->GetDictionary(i, &tab_values)) {
- StartupTab tab;
+ Tab tab;
if (DecodeTab(*tab_values, &tab))
results.push_back(tab);
}
« no previous file with comments | « chrome/browser/tabs/pinned_tab_codec.h ('k') | chrome/browser/tabs/pinned_tab_codec_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698