Linux: Depend on liberation-fonts package for RPMs.
[chromium-blink-merge.git] / components / sessions / core / tab_restore_service.cc
blob7fccf96c56e30a8e4f7579c62af851a08f848561
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 #include "components/sessions/core/tab_restore_service.h"
7 namespace sessions {
9 // TimeFactory-----------------------------------------------------------------
11 TabRestoreService::TimeFactory::~TimeFactory() {}
13 // Entry ----------------------------------------------------------------------
15 // ID of the next Entry.
16 static SessionID::id_type next_entry_id = 1;
18 TabRestoreService::Entry::Entry()
19 : id(next_entry_id++),
20 type(TAB),
21 from_last_session(false) {}
23 TabRestoreService::Entry::Entry(Type type)
24 : id(next_entry_id++),
25 type(type),
26 from_last_session(false) {}
28 TabRestoreService::Entry::~Entry() {}
30 // Tab ------------------------------------------------------------------------
32 TabRestoreService::Tab::Tab()
33 : Entry(TAB),
34 current_navigation_index(-1),
35 browser_id(0),
36 tabstrip_index(-1),
37 pinned(false) {
40 TabRestoreService::Tab::Tab(const TabRestoreService::Tab& tab)
41 : Entry(TAB),
42 navigations(tab.navigations),
43 current_navigation_index(tab.current_navigation_index),
44 browser_id(tab.browser_id),
45 tabstrip_index(tab.tabstrip_index),
46 pinned(tab.pinned),
47 extension_app_id(tab.extension_app_id),
48 user_agent_override(tab.user_agent_override) {
49 if (tab.client_data)
50 client_data = tab.client_data->Clone();
53 TabRestoreService::Tab::~Tab() {
56 TabRestoreService::Tab& TabRestoreService::Tab::operator=(
57 const TabRestoreService::Tab& tab) {
58 navigations = tab.navigations;
59 current_navigation_index = tab.current_navigation_index;
60 browser_id = tab.browser_id;
61 tabstrip_index = tab.tabstrip_index;
62 pinned = tab.pinned;
63 extension_app_id = tab.extension_app_id;
64 user_agent_override = tab.user_agent_override;
66 if (tab.client_data)
67 client_data = tab.client_data->Clone();
69 return *this;
72 // Window ---------------------------------------------------------------------
74 TabRestoreService::Window::Window() : Entry(WINDOW), selected_tab_index(-1) {
77 TabRestoreService::Window::~Window() {
80 // TabRestoreService ----------------------------------------------------------
82 TabRestoreService::~TabRestoreService() {
85 } // namespace sessions