| OLD | NEW |
| 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/sessions/tab_restore_service.h" | 5 #include "chrome/browser/sessions/tab_restore_service.h" |
| 6 | 6 |
| 7 #include "content/public/browser/session_storage_namespace.h" | |
| 8 | |
| 9 // TimeFactory----------------------------------------------------------------- | 7 // TimeFactory----------------------------------------------------------------- |
| 10 | 8 |
| 11 TabRestoreService::TimeFactory::~TimeFactory() {} | 9 TabRestoreService::TimeFactory::~TimeFactory() {} |
| 12 | 10 |
| 13 // Entry ---------------------------------------------------------------------- | 11 // Entry ---------------------------------------------------------------------- |
| 14 | 12 |
| 15 // ID of the next Entry. | 13 // ID of the next Entry. |
| 16 static SessionID::id_type next_entry_id = 1; | 14 static SessionID::id_type next_entry_id = 1; |
| 17 | 15 |
| 18 TabRestoreService::Entry::Entry() | 16 TabRestoreService::Entry::Entry() |
| (...skipping 11 matching lines...) Expand all Loading... |
| 30 // Tab ------------------------------------------------------------------------ | 28 // Tab ------------------------------------------------------------------------ |
| 31 | 29 |
| 32 TabRestoreService::Tab::Tab() | 30 TabRestoreService::Tab::Tab() |
| 33 : Entry(TAB), | 31 : Entry(TAB), |
| 34 current_navigation_index(-1), | 32 current_navigation_index(-1), |
| 35 browser_id(0), | 33 browser_id(0), |
| 36 tabstrip_index(-1), | 34 tabstrip_index(-1), |
| 37 pinned(false) { | 35 pinned(false) { |
| 38 } | 36 } |
| 39 | 37 |
| 38 TabRestoreService::Tab::Tab(const TabRestoreService::Tab& tab) |
| 39 : Entry(TAB), |
| 40 navigations(tab.navigations), |
| 41 current_navigation_index(tab.current_navigation_index), |
| 42 browser_id(tab.browser_id), |
| 43 tabstrip_index(tab.tabstrip_index), |
| 44 pinned(tab.pinned), |
| 45 extension_app_id(tab.extension_app_id), |
| 46 user_agent_override(tab.user_agent_override) { |
| 47 if (tab.client_data) |
| 48 client_data = tab.client_data->Clone(); |
| 49 } |
| 50 |
| 40 TabRestoreService::Tab::~Tab() { | 51 TabRestoreService::Tab::~Tab() { |
| 41 } | 52 } |
| 42 | 53 |
| 54 TabRestoreService::Tab& TabRestoreService::Tab::operator=( |
| 55 const TabRestoreService::Tab& tab) { |
| 56 navigations = tab.navigations; |
| 57 current_navigation_index = tab.current_navigation_index; |
| 58 browser_id = tab.browser_id; |
| 59 tabstrip_index = tab.tabstrip_index; |
| 60 pinned = tab.pinned; |
| 61 extension_app_id = tab.extension_app_id; |
| 62 user_agent_override = tab.user_agent_override; |
| 63 |
| 64 if (tab.client_data) |
| 65 client_data = tab.client_data->Clone(); |
| 66 |
| 67 return *this; |
| 68 } |
| 69 |
| 43 // Window --------------------------------------------------------------------- | 70 // Window --------------------------------------------------------------------- |
| 44 | 71 |
| 45 TabRestoreService::Window::Window() : Entry(WINDOW), selected_tab_index(-1) { | 72 TabRestoreService::Window::Window() : Entry(WINDOW), selected_tab_index(-1) { |
| 46 } | 73 } |
| 47 | 74 |
| 48 TabRestoreService::Window::~Window() { | 75 TabRestoreService::Window::~Window() { |
| 49 } | 76 } |
| 50 | 77 |
| 51 // TabRestoreService ---------------------------------------------------------- | 78 // TabRestoreService ---------------------------------------------------------- |
| 52 | 79 |
| 53 TabRestoreService::~TabRestoreService() { | 80 TabRestoreService::~TabRestoreService() { |
| 54 } | 81 } |
| OLD | NEW |