| Index: components/sessions/content/content_open_tab.cc
|
| diff --git a/components/sessions/content/content_open_tab.cc b/components/sessions/content/content_open_tab.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c5cab1eb5a411b79d1b94ad3ad2fccb923b59972
|
| --- /dev/null
|
| +++ b/components/sessions/content/content_open_tab.cc
|
| @@ -0,0 +1,48 @@
|
| +// 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.
|
| +
|
| +#include "components/sessions/content/content_open_tab.h"
|
| +
|
| +#include "content/public/browser/web_contents.h"
|
| +
|
| +DEFINE_WEB_CONTENTS_USER_DATA_KEY(sessions::ContentOpenTab);
|
| +
|
| +namespace sessions {
|
| +
|
| +ContentOpenTab::ContentOpenTab(content::WebContents* contents)
|
| + : web_contents_(contents) {}
|
| +
|
| +ContentOpenTab::~ContentOpenTab() {}
|
| +
|
| +int ContentOpenTab::GetCurrentEntryIndex() {
|
| + return navigation_controller().GetCurrentEntryIndex();
|
| +}
|
| +
|
| +int ContentOpenTab::GetPendingEntryIndex() {
|
| + return navigation_controller().GetPendingEntryIndex();
|
| +}
|
| +
|
| +sessions::SerializedNavigationEntry ContentOpenTab::GetEntryAtIndex(int index) {
|
| + return sessions::ContentSerializedNavigationBuilder::FromNavigationEntry(
|
| + index, *navigation_controller().GetEntryAtIndex(index));
|
| +}
|
| +
|
| +sessions::SerializedNavigationEntry ContentOpenTab::GetPendingEntry() {
|
| + return sessions::ContentSerializedNavigationBuilder::FromNavigationEntry(
|
| + GetPendingEntryIndex(), *navigation_controller().GetPendingEntry());
|
| +}
|
| +
|
| +int ContentOpenTab::GetEntryCount() {
|
| + return navigation_controller().GetEntryCount();
|
| +}
|
| +
|
| +void ContentOpenTab::LoadIfNecessary() {
|
| + navigation_controller().LoadIfNecessary();
|
| +}
|
| +
|
| +const std::string& ContentOpenTab::GetUserAgentOverride() const {
|
| + return web_contents()->GetUserAgentOverride();
|
| +}
|
| +
|
| +} // namespace sessions
|
|
|