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

Side by Side Diff: components/sessions/content/content_live_tab.h

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
« no previous file with comments | « components/sessions/BUILD.gn ('k') | components/sessions/content/content_live_tab.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 #ifndef COMPONENTS_SESSIONS_CONTENT_CONTENT_LIVE_TAB_H_
6 #define COMPONENTS_SESSIONS_CONTENT_CONTENT_LIVE_TAB_H_
7
8 #include "base/basictypes.h"
9 #include "base/supports_user_data.h"
10 #include "components/sessions/content/content_serialized_navigation_builder.h"
11 #include "components/sessions/core/live_tab.h"
12 #include "components/sessions/sessions_export.h"
13 #include "content/public/browser/web_contents.h"
14
15 namespace content {
16 class NavigationController;
17 class NavigationEntry;
18 class SessionStorageNamespace;
19 }
20
21 class PersistentTabRestoreServiceTest;
22
23 namespace sessions {
24
25 // An implementation of LiveTab that is backed by content::WebContents for use
26 // on //content-based platforms.
27 // Implementation note: This class can't be a WebContentsUserData due to that
28 // class being unusable in the component build. crbug.com/532866
29 class SESSIONS_EXPORT ContentLiveTab
30 : public LiveTab,
31 public base::SupportsUserData::Data {
32 public:
33 ~ContentLiveTab() override;
34
35 static void CreateForWebContents(content::WebContents* web_contents);
36 static ContentLiveTab* FromWebContents(content::WebContents* web_contents);
37
38 // LiveTab:
39 int GetCurrentEntryIndex() override;
40 int GetPendingEntryIndex() override;
41 sessions::SerializedNavigationEntry GetEntryAtIndex(int index) override;
42 sessions::SerializedNavigationEntry GetPendingEntry() override;
43 int GetEntryCount() override;
44 void LoadIfNecessary() override;
45 const std::string& GetUserAgentOverride() const override;
46
47 content::WebContents* web_contents() { return web_contents_; }
48 const content::WebContents* web_contents() const { return web_contents_; }
49
50 private:
51 friend class base::SupportsUserData;
52 friend class ::PersistentTabRestoreServiceTest;
53
54 explicit ContentLiveTab(content::WebContents* contents);
55
56 content::NavigationController& navigation_controller() {
57 return web_contents_->GetController();
58 }
59
60 content::WebContents* web_contents_;
61
62 DISALLOW_COPY_AND_ASSIGN(ContentLiveTab);
63 };
64
65 } // namespace sessions
66
67 #endif // COMPONENTS_SESSIONS_CONTENT_CONTENT_LIVE_TAB_H_
OLDNEW
« no previous file with comments | « components/sessions/BUILD.gn ('k') | components/sessions/content/content_live_tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698