| 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/persistent_tab_restore_service.h" | 5 #include "chrome/browser/sessions/persistent_tab_restore_service.h" |
| 6 | 6 |
| 7 #include <cstring> // memcpy | 7 #include <cstring> // memcpy |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // Implements the link between the tab restore service and the session backend. | 115 // Implements the link between the tab restore service and the session backend. |
| 116 class PersistentTabRestoreService::Delegate | 116 class PersistentTabRestoreService::Delegate |
| 117 : public BaseSessionService, | 117 : public BaseSessionService, |
| 118 public TabRestoreServiceHelper::Observer { | 118 public TabRestoreServiceHelper::Observer { |
| 119 public: | 119 public: |
| 120 explicit Delegate(Profile* profile); | 120 explicit Delegate(Profile* profile); |
| 121 | 121 |
| 122 virtual ~Delegate(); | 122 virtual ~Delegate(); |
| 123 | 123 |
| 124 // BaseSessionService: | 124 // BaseSessionService: |
| 125 virtual void Save() OVERRIDE; | 125 virtual void Save() override; |
| 126 | 126 |
| 127 // TabRestoreServiceHelper::Observer: | 127 // TabRestoreServiceHelper::Observer: |
| 128 virtual void OnClearEntries() OVERRIDE; | 128 virtual void OnClearEntries() override; |
| 129 virtual void OnRestoreEntryById( | 129 virtual void OnRestoreEntryById( |
| 130 SessionID::id_type id, | 130 SessionID::id_type id, |
| 131 Entries::const_iterator entry_iterator) OVERRIDE; | 131 Entries::const_iterator entry_iterator) override; |
| 132 virtual void OnAddEntry() OVERRIDE; | 132 virtual void OnAddEntry() override; |
| 133 | 133 |
| 134 void set_tab_restore_service_helper( | 134 void set_tab_restore_service_helper( |
| 135 TabRestoreServiceHelper* tab_restore_service_helper) { | 135 TabRestoreServiceHelper* tab_restore_service_helper) { |
| 136 tab_restore_service_helper_ = tab_restore_service_helper; | 136 tab_restore_service_helper_ = tab_restore_service_helper; |
| 137 } | 137 } |
| 138 | 138 |
| 139 void LoadTabsFromLastSession(); | 139 void LoadTabsFromLastSession(); |
| 140 | 140 |
| 141 bool IsLoaded() const; | 141 bool IsLoaded() const; |
| 142 | 142 |
| (...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 } | 983 } |
| 984 | 984 |
| 985 void PersistentTabRestoreService::PruneEntries() { | 985 void PersistentTabRestoreService::PruneEntries() { |
| 986 helper_.PruneEntries(); | 986 helper_.PruneEntries(); |
| 987 } | 987 } |
| 988 | 988 |
| 989 KeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor( | 989 KeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor( |
| 990 content::BrowserContext* profile) const { | 990 content::BrowserContext* profile) const { |
| 991 return new PersistentTabRestoreService(static_cast<Profile*>(profile), NULL); | 991 return new PersistentTabRestoreService(static_cast<Profile*>(profile), NULL); |
| 992 } | 992 } |
| OLD | NEW |