Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: chrome/browser/sessions/in_memory_tab_restore_service.cc

Issue 1321713005: Abstract WebContents/NavigationController from core TabRestore code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/in_memory_tab_restore_service.h" 5 #include "chrome/browser/sessions/in_memory_tab_restore_service.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 10
11 using sessions::LiveTab;
12
11 InMemoryTabRestoreService::InMemoryTabRestoreService( 13 InMemoryTabRestoreService::InMemoryTabRestoreService(
12 scoped_ptr<sessions::TabRestoreServiceClient> client, 14 scoped_ptr<sessions::TabRestoreServiceClient> client,
13 TabRestoreService::TimeFactory* time_factory) 15 TabRestoreService::TimeFactory* time_factory)
14 : client_(client.Pass()), 16 : client_(client.Pass()),
15 helper_(this, NULL, client_.get(), time_factory) {} 17 helper_(this, NULL, client_.get(), time_factory) {}
16 18
17 InMemoryTabRestoreService::~InMemoryTabRestoreService() {} 19 InMemoryTabRestoreService::~InMemoryTabRestoreService() {}
18 20
19 void InMemoryTabRestoreService::AddObserver( 21 void InMemoryTabRestoreService::AddObserver(
20 TabRestoreServiceObserver* observer) { 22 TabRestoreServiceObserver* observer) {
21 helper_.AddObserver(observer); 23 helper_.AddObserver(observer);
22 } 24 }
23 25
24 void InMemoryTabRestoreService::RemoveObserver( 26 void InMemoryTabRestoreService::RemoveObserver(
25 TabRestoreServiceObserver* observer) { 27 TabRestoreServiceObserver* observer) {
26 helper_.RemoveObserver(observer); 28 helper_.RemoveObserver(observer);
27 } 29 }
28 30
29 void InMemoryTabRestoreService::CreateHistoricalTab( 31 void InMemoryTabRestoreService::CreateHistoricalTab(LiveTab* live_tab,
30 content::WebContents* contents, 32 int index) {
31 int index) { 33 helper_.CreateHistoricalTab(live_tab, index);
32 helper_.CreateHistoricalTab(contents, index);
33 } 34 }
34 35
35 void InMemoryTabRestoreService::BrowserClosing( 36 void InMemoryTabRestoreService::BrowserClosing(
36 TabRestoreServiceDelegate* delegate) { 37 TabRestoreServiceDelegate* delegate) {
37 helper_.BrowserClosing(delegate); 38 helper_.BrowserClosing(delegate);
38 } 39 }
39 40
40 void InMemoryTabRestoreService::BrowserClosed( 41 void InMemoryTabRestoreService::BrowserClosed(
41 TabRestoreServiceDelegate* delegate) { 42 TabRestoreServiceDelegate* delegate) {
42 helper_.BrowserClosed(delegate); 43 helper_.BrowserClosed(delegate);
43 } 44 }
44 45
45 void InMemoryTabRestoreService::ClearEntries() { 46 void InMemoryTabRestoreService::ClearEntries() {
46 helper_.ClearEntries(); 47 helper_.ClearEntries();
47 } 48 }
48 49
49 const TabRestoreService::Entries& InMemoryTabRestoreService::entries() const { 50 const TabRestoreService::Entries& InMemoryTabRestoreService::entries() const {
50 return helper_.entries(); 51 return helper_.entries();
51 } 52 }
52 53
53 std::vector<content::WebContents*> 54 std::vector<LiveTab*> InMemoryTabRestoreService::RestoreMostRecentEntry(
54 InMemoryTabRestoreService::RestoreMostRecentEntry(
55 TabRestoreServiceDelegate* delegate, 55 TabRestoreServiceDelegate* delegate,
56 int host_desktop_type) { 56 int host_desktop_type) {
57 return helper_.RestoreMostRecentEntry(delegate, host_desktop_type); 57 return helper_.RestoreMostRecentEntry(delegate, host_desktop_type);
58 } 58 }
59 59
60 TabRestoreService::Tab* InMemoryTabRestoreService::RemoveTabEntryById( 60 TabRestoreService::Tab* InMemoryTabRestoreService::RemoveTabEntryById(
61 SessionID::id_type id) { 61 SessionID::id_type id) {
62 return helper_.RemoveTabEntryById(id); 62 return helper_.RemoveTabEntryById(id);
63 } 63 }
64 64
65 std::vector<content::WebContents*> InMemoryTabRestoreService::RestoreEntryById( 65 std::vector<LiveTab*> InMemoryTabRestoreService::RestoreEntryById(
66 TabRestoreServiceDelegate* delegate, 66 TabRestoreServiceDelegate* delegate,
67 SessionID::id_type id, 67 SessionID::id_type id,
68 int host_desktop_type, 68 int host_desktop_type,
69 WindowOpenDisposition disposition) { 69 WindowOpenDisposition disposition) {
70 return helper_.RestoreEntryById(delegate, id, host_desktop_type, disposition); 70 return helper_.RestoreEntryById(delegate, id, host_desktop_type, disposition);
71 } 71 }
72 72
73 void InMemoryTabRestoreService::LoadTabsFromLastSession() { 73 void InMemoryTabRestoreService::LoadTabsFromLastSession() {
74 // Do nothing. This relies on tab persistence which is implemented in Java on 74 // Do nothing. This relies on tab persistence which is implemented in Java on
75 // the application side on Android. 75 // the application side on Android.
76 } 76 }
77 77
78 bool InMemoryTabRestoreService::IsLoaded() const { 78 bool InMemoryTabRestoreService::IsLoaded() const {
79 // See comment above. 79 // See comment above.
80 return true; 80 return true;
81 } 81 }
82 82
83 void InMemoryTabRestoreService::DeleteLastSession() { 83 void InMemoryTabRestoreService::DeleteLastSession() {
84 // See comment above. 84 // See comment above.
85 } 85 }
86 86
87 void InMemoryTabRestoreService::Shutdown() { 87 void InMemoryTabRestoreService::Shutdown() {
88 } 88 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/in_memory_tab_restore_service.h ('k') | chrome/browser/sessions/persistent_tab_restore_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698