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

Side by Side Diff: components/sync_sessions/synced_tab_delegate.h

Issue 2753753005: [sync] WebContentsObserver based sessions notifications (Closed)
Patch Set: [sync] WebContentsObserver based sessions notifications Created 3 years, 9 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_SYNC_SESSIONS_SYNCED_TAB_DELEGATE_H__ 5 #ifndef COMPONENTS_SYNC_SESSIONS_SYNCED_TAB_DELEGATE_H__
6 #define COMPONENTS_SYNC_SESSIONS_SYNCED_TAB_DELEGATE_H__ 6 #define COMPONENTS_SYNC_SESSIONS_SYNCED_TAB_DELEGATE_H__
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "components/sessions/core/serialized_navigation_entry.h" 12 #include "components/sessions/core/serialized_navigation_entry.h"
13 #include "components/sessions/core/session_id.h" 13 #include "components/sessions/core/session_id.h"
14 #include "ui/base/page_transition_types.h" 14 #include "ui/base/page_transition_types.h"
15 #include "url/gurl.h" 15 #include "url/gurl.h"
16 16
17 namespace sync_sessions { 17 namespace sync_sessions {
18 class SyncSessionsClient; 18 class SyncSessionsClient;
19 } 19 }
20 20
21 namespace sync_sessions { 21 namespace sync_sessions {
22 22
23 static const SessionID::id_type kUnknownTabID = -1;
24
23 // A SyncedTabDelegate is used to insulate the sync code from depending 25 // A SyncedTabDelegate is used to insulate the sync code from depending
24 // directly on WebContents, NavigationController, and the extensions TabHelper. 26 // directly on WebContents, NavigationController, and the extensions TabHelper.
25 class SyncedTabDelegate { 27 class SyncedTabDelegate {
26 public: 28 public:
27 virtual ~SyncedTabDelegate(); 29 virtual ~SyncedTabDelegate();
28 30
29 // Methods from TabContents. 31 // Methods from TabContents.
30 virtual SessionID::id_type GetWindowId() const = 0; 32 virtual SessionID::id_type GetWindowId() const = 0;
31 virtual SessionID::id_type GetSessionId() const = 0; 33 virtual SessionID::id_type GetSessionId() const = 0;
32 virtual bool IsBeingDestroyed() const = 0; 34 virtual bool IsBeingDestroyed() const = 0;
33 35
36 // Get the tab id of the tab responsible for opening this tab, if applicable.
37 // Returns -1 if no such tab exists.
Nicolas Zea 2017/03/16 19:57:44 returns kUnknownTabID
Patrick Noland 2017/03/16 20:23:27 Done.
38 virtual SessionID::id_type GetSourceTabID() const = 0;
39
34 // Method derived from extensions TabHelper. 40 // Method derived from extensions TabHelper.
35 virtual std::string GetExtensionAppId() const = 0; 41 virtual std::string GetExtensionAppId() const = 0;
36 42
37 // Methods from NavigationController. 43 // Methods from NavigationController.
38 virtual bool IsInitialBlankNavigation() const = 0; 44 virtual bool IsInitialBlankNavigation() const = 0;
39 virtual int GetCurrentEntryIndex() const = 0; 45 virtual int GetCurrentEntryIndex() const = 0;
40 virtual int GetEntryCount() const = 0; 46 virtual int GetEntryCount() const = 0;
41 virtual GURL GetVirtualURLAtIndex(int i) const = 0; 47 virtual GURL GetVirtualURLAtIndex(int i) const = 0;
42 virtual GURL GetFaviconURLAtIndex(int i) const = 0; 48 virtual GURL GetFaviconURLAtIndex(int i) const = 0;
43 virtual ui::PageTransition GetTransitionAtIndex(int i) const = 0; 49 virtual ui::PageTransition GetTransitionAtIndex(int i) const = 0;
(...skipping 18 matching lines...) Expand all
62 // tab should be preserved. 68 // tab should be preserved.
63 virtual bool IsPlaceholderTab() const = 0; 69 virtual bool IsPlaceholderTab() const = 0;
64 70
65 protected: 71 protected:
66 SyncedTabDelegate(); 72 SyncedTabDelegate();
67 }; 73 };
68 74
69 } // namespace sync_sessions 75 } // namespace sync_sessions
70 76
71 #endif // COMPONENTS_SYNC_SESSIONS_SYNCED_TAB_DELEGATE_H__ 77 #endif // COMPONENTS_SYNC_SESSIONS_SYNCED_TAB_DELEGATE_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698