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

Unified Diff: chrome/browser/sessions/in_memory_tab_restore_service.cc

Issue 10989027: Split TabRestoreService into InMemoryTRS and PersistentTRS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GYP out InMemoryTRS on non-Android and fix incorrect comments Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sessions/in_memory_tab_restore_service.cc
diff --git a/chrome/browser/sessions/in_memory_tab_restore_service.cc b/chrome/browser/sessions/in_memory_tab_restore_service.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1122bbd6caf0892b0ac72ae57820c2670c620ebd
--- /dev/null
+++ b/chrome/browser/sessions/in_memory_tab_restore_service.cc
@@ -0,0 +1,90 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/sessions/in_memory_tab_restore_service.h"
+
+#include "base/compiler_specific.h"
+#include "chrome/browser/sessions/tab_restore_service_factory.h"
+
+InMemoryTabRestoreService::InMemoryTabRestoreService(
+ Profile* profile,
+ TabRestoreService::TimeFactory* time_factory)
+ : ALLOW_THIS_IN_INITIALIZER_LIST(
+ helper_(this, NULL, profile, time_factory)) {
+}
+
+InMemoryTabRestoreService::~InMemoryTabRestoreService() {}
+
+void InMemoryTabRestoreService::AddObserver(
+ TabRestoreServiceObserver* observer) {
+ helper_.AddObserver(observer);
+}
+
+void InMemoryTabRestoreService::RemoveObserver(
+ TabRestoreServiceObserver* observer) {
+ helper_.RemoveObserver(observer);
+}
+
+void InMemoryTabRestoreService::CreateHistoricalTab(
+ content::WebContents* contents,
+ int index) {
+ helper_.CreateHistoricalTab(contents, index);
+}
+
+void InMemoryTabRestoreService::BrowserClosing(
+ TabRestoreServiceDelegate* delegate) {
+ helper_.BrowserClosing(delegate);
+}
+
+void InMemoryTabRestoreService::BrowserClosed(
+ TabRestoreServiceDelegate* delegate) {
+ helper_.BrowserClosed(delegate);
+}
+
+void InMemoryTabRestoreService::ClearEntries() {
+ helper_.ClearEntries();
+}
+
+const TabRestoreService::Entries& InMemoryTabRestoreService::entries() const {
+ return helper_.entries();
+}
+
+void InMemoryTabRestoreService::RestoreMostRecentEntry(
+ TabRestoreServiceDelegate* delegate) {
+ helper_.RestoreMostRecentEntry(delegate);
+}
+
+TabRestoreService::Tab* InMemoryTabRestoreService::RemoveTabEntryById(
+ SessionID::id_type id) {
+ return helper_.RemoveTabEntryById(id);
+}
+
+void InMemoryTabRestoreService::RestoreEntryById(
+ TabRestoreServiceDelegate* delegate,
+ SessionID::id_type id,
+ WindowOpenDisposition disposition) {
+ helper_.RestoreEntryById(delegate, id, disposition);
+}
+
+void InMemoryTabRestoreService::LoadTabsFromLastSession() {
+ // Do nothing. This relies on tab persistence which is implemented in Java on
+ // the application side on Android.
+}
+
+bool InMemoryTabRestoreService::IsLoaded() const {
+ // See comment above.
+ return true;
+}
+
+void InMemoryTabRestoreService::DeleteLastSession() {
+ // See comment above.
+}
+
+void InMemoryTabRestoreService::Shutdown() {
+}
+
+ProfileKeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor(
+ Profile* profile) const {
+ return new InMemoryTabRestoreService(profile, NULL);
+}
« 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