app_shell: Add version number in user agent
[chromium-blink-merge.git] / chrome / browser / ui / tabs / pinned_tab_codec.h
blob690aa901d8fd72541bd4f3ac32b579036ed92f65
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_TABS_PINNED_TAB_CODEC_H_
6 #define CHROME_BROWSER_UI_TABS_PINNED_TAB_CODEC_H_
8 #include <vector>
10 #include "chrome/browser/ui/startup/startup_tab.h"
11 #include "url/gurl.h"
13 class Profile;
15 namespace base {
16 class Value;
19 namespace user_prefs {
20 class PrefRegistrySyncable;
23 // PinnedTabCodec is used to read and write the set of pinned tabs to
24 // preferences. When Chrome exits the sets of pinned tabs are written to prefs.
25 // On startup if the user has not chosen to restore the last session the set of
26 // pinned tabs is opened.
28 // The entries are stored in preferences as a list of dictionaries, with each
29 // dictionary describing the entry.
30 class PinnedTabCodec {
31 public:
32 // Registers the preference used by this class.
33 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
35 // Resets the preferences state.
36 static void WritePinnedTabs(Profile* profile);
38 // Sets the preferences state from the specified tab list.
39 static void WritePinnedTabs(Profile* profile, const StartupTabs& tabs);
41 // Reads and returns the set of pinned tabs to restore from preferences.
42 static StartupTabs ReadPinnedTabs(Profile* profile);
43 static StartupTabs ReadPinnedTabs(const base::Value* value);
45 private:
46 PinnedTabCodec();
47 ~PinnedTabCodec();
49 DISALLOW_COPY_AND_ASSIGN(PinnedTabCodec);
52 #endif // CHROME_BROWSER_UI_TABS_PINNED_TAB_CODEC_H_