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"
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
++),
21 from_last_session(false) {}
23 TabRestoreService::Entry::Entry(Type type
)
24 : id(next_entry_id
++),
26 from_last_session(false) {}
28 TabRestoreService::Entry::~Entry() {}
30 // Tab ------------------------------------------------------------------------
32 TabRestoreService::Tab::Tab()
34 current_navigation_index(-1),
40 TabRestoreService::Tab::Tab(const TabRestoreService::Tab
& 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
),
47 extension_app_id(tab
.extension_app_id
),
48 user_agent_override(tab
.user_agent_override
) {
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
;
63 extension_app_id
= tab
.extension_app_id
;
64 user_agent_override
= tab
.user_agent_override
;
67 client_data
= tab
.client_data
->Clone();
72 // Window ---------------------------------------------------------------------
74 TabRestoreService::Window::Window() : Entry(WINDOW
), selected_tab_index(-1) {
77 TabRestoreService::Window::~Window() {
80 // TabRestoreService ----------------------------------------------------------
82 TabRestoreService::~TabRestoreService() {
85 } // namespace sessions