| OLD | NEW |
| (Empty) | |
| 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. |
| 4 |
| 5 #include "chrome/browser/sessions/in_memory_tab_restore_service.h" |
| 6 |
| 7 #include "base/compiler_specific.h" |
| 8 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 9 |
| 10 InMemoryTabRestoreService::InMemoryTabRestoreService( |
| 11 Profile* profile, |
| 12 TabRestoreService::TimeFactory* time_factory) |
| 13 : ALLOW_THIS_IN_INITIALIZER_LIST( |
| 14 helper_(this, NULL, profile, time_factory)) { |
| 15 } |
| 16 |
| 17 InMemoryTabRestoreService::~InMemoryTabRestoreService() {} |
| 18 |
| 19 void InMemoryTabRestoreService::AddObserver( |
| 20 TabRestoreServiceObserver* observer) { |
| 21 helper_.AddObserver(observer); |
| 22 } |
| 23 |
| 24 void InMemoryTabRestoreService::RemoveObserver( |
| 25 TabRestoreServiceObserver* observer) { |
| 26 helper_.RemoveObserver(observer); |
| 27 } |
| 28 |
| 29 void InMemoryTabRestoreService::CreateHistoricalTab( |
| 30 content::WebContents* contents, |
| 31 int index) { |
| 32 helper_.CreateHistoricalTab(contents, index); |
| 33 } |
| 34 |
| 35 void InMemoryTabRestoreService::BrowserClosing( |
| 36 TabRestoreServiceDelegate* delegate) { |
| 37 helper_.BrowserClosing(delegate); |
| 38 } |
| 39 |
| 40 void InMemoryTabRestoreService::BrowserClosed( |
| 41 TabRestoreServiceDelegate* delegate) { |
| 42 helper_.BrowserClosed(delegate); |
| 43 } |
| 44 |
| 45 void InMemoryTabRestoreService::ClearEntries() { |
| 46 helper_.ClearEntries(); |
| 47 } |
| 48 |
| 49 const TabRestoreService::Entries& InMemoryTabRestoreService::entries() const { |
| 50 return helper_.entries(); |
| 51 } |
| 52 |
| 53 void InMemoryTabRestoreService::RestoreMostRecentEntry( |
| 54 TabRestoreServiceDelegate* delegate) { |
| 55 helper_.RestoreMostRecentEntry(delegate); |
| 56 } |
| 57 |
| 58 TabRestoreService::Tab* InMemoryTabRestoreService::RemoveTabEntryById( |
| 59 SessionID::id_type id) { |
| 60 return helper_.RemoveTabEntryById(id); |
| 61 } |
| 62 |
| 63 void InMemoryTabRestoreService::RestoreEntryById( |
| 64 TabRestoreServiceDelegate* delegate, |
| 65 SessionID::id_type id, |
| 66 WindowOpenDisposition disposition) { |
| 67 helper_.RestoreEntryById(delegate, id, disposition); |
| 68 } |
| 69 |
| 70 void InMemoryTabRestoreService::LoadTabsFromLastSession() { |
| 71 // Do nothing. This relies on tab persistence which is implemented in Java on |
| 72 // the application side on Android. |
| 73 } |
| 74 |
| 75 bool InMemoryTabRestoreService::IsLoaded() const { |
| 76 // See comment above. |
| 77 return true; |
| 78 } |
| 79 |
| 80 void InMemoryTabRestoreService::DeleteLastSession() { |
| 81 // See comment above. |
| 82 } |
| 83 |
| 84 void InMemoryTabRestoreService::Shutdown() { |
| 85 } |
| 86 |
| 87 ProfileKeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor( |
| 88 Profile* profile) const { |
| 89 return new InMemoryTabRestoreService(profile, NULL); |
| 90 } |
| OLD | NEW |