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

Side by Side Diff: components/sessions/content/content_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 unified diff | Download patch
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_OPEN_TAB_H_
6 #define COMPONENTS_SESSIONS_CONTENT_CONTENT_OPEN_TAB_H_
7
8 #include "base/basictypes.h"
9 #include "components/sessions/content/content_serialized_navigation_builder.h"
10 #include "components/sessions/core/open_tab.h"
11 #include "components/sessions/sessions_export.h"
12 #include "content/public/browser/navigation_controller.h"
13 #include "content/public/browser/web_contents_user_data.h"
14
15 namespace content {
16 class NavigationEntry;
17 class SessionStorageNamespace;
18 }
19
20 class PersistentTabRestoreServiceTest;
21
22 namespace sessions {
23
24 // An implementation of OpenTab that is backed by content::WebContents for use
25 // on //content-based platforms.
26 class SESSIONS_EXPORT ContentOpenTab
27 : public OpenTab,
28 public content::WebContentsUserData<ContentOpenTab> {
29 public:
30 ~ContentOpenTab() override;
31
32 // OpenTab:
33 int GetCurrentEntryIndex() override;
34 int GetPendingEntryIndex() override;
35 sessions::SerializedNavigationEntry GetEntryAtIndex(int index) override;
36 sessions::SerializedNavigationEntry GetPendingEntry() override;
37 int GetEntryCount() override;
38 void LoadIfNecessary() override;
39 const std::string& GetUserAgentOverride() const override;
40
41 content::WebContents* web_contents() { return web_contents_; }
42 const content::WebContents* web_contents() const { return web_contents_; }
43
44 private:
45 explicit ContentOpenTab(content::WebContents* contents);
46 friend class content::WebContentsUserData<ContentOpenTab>;
sky 2015/09/16 20:04:53 nit: generally friend decls are before functions (
blundell 2015/09/17 11:52:25 Done.
47 friend class ::PersistentTabRestoreServiceTest;
48
49 content::NavigationController& navigation_controller() {
50 return web_contents_->GetController();
51 }
52
53 content::WebContents* web_contents_;
54
55 DISALLOW_COPY_AND_ASSIGN(ContentOpenTab);
56 };
57
58 } // namespace sessions
59
60 #endif // COMPONENTS_SESSIONS_CONTENT_CONTENT_OPEN_TAB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698