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

Unified Diff: components/sessions/core/open_tab.h

Issue 1321713005: Abstract WebContents/NavigationController from core TabRestore code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix 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 side-by-side diff with in-line comments
Download patch
Index: components/sessions/core/open_tab.h
diff --git a/components/sessions/core/open_tab.h b/components/sessions/core/open_tab.h
new file mode 100644
index 0000000000000000000000000000000000000000..f30cc54ed4f0af68a1655f32331a99181a29a64c
--- /dev/null
+++ b/components/sessions/core/open_tab.h
@@ -0,0 +1,39 @@
+// Copyright 2015 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.
+
+#ifndef COMPONENTS_SESSIONS_CORE_OPEN_TAB_H_
+#define COMPONENTS_SESSIONS_CORE_OPEN_TAB_H_
+
+#include "base/basictypes.h"
+#include "components/sessions/serialized_navigation_entry.h"
+#include "components/sessions/sessions_export.h"
+
+namespace sessions {
+
+// Interface that represents an open tab to the core sessions code, and in
+// particular, the tab restore service. This interface abstracts the concrete
+// representation of an open tab on different platforms (e.g., WebContents on
+// //content-based platforms).
+class SESSIONS_EXPORT OpenTab {
sky 2015/09/16 20:04:53 I'm not too thrilled about this name. It reads as
blundell 2015/09/17 11:52:25 Done.
+ public:
+ virtual ~OpenTab() {}
+
+ // Methods that return information about the navigation state of the tab.
+ virtual int GetCurrentEntryIndex() = 0;
+ virtual int GetPendingEntryIndex() = 0;
+ virtual sessions::SerializedNavigationEntry GetEntryAtIndex(int index) = 0;
+ virtual sessions::SerializedNavigationEntry GetPendingEntry() = 0;
+ virtual int GetEntryCount() = 0;
+
+ // Loads the current page if necessary (where "necessary" is defined on a
+ // platform-specific basis).
+ virtual void LoadIfNecessary() = 0;
+
+ // Returs the user agent override, if any.
sky 2015/09/16 20:04:53 Returns
blundell 2015/09/17 11:52:25 Done.
+ virtual const std::string& GetUserAgentOverride() const = 0;
+};
+
+} // namespace sessions
+
+#endif // COMPONENTS_SESSIONS_CORE_OPEN_TAB_H_

Powered by Google App Engine
This is Rietveld 408576698