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

Unified Diff: chrome/browser/sync/sessions/sync_sessions_multi_windowed_web_contents_router.h

Issue 2753753005: [sync] WebContentsObserver based sessions notifications (Closed)
Patch Set: Separate non-android class 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/sessions/sync_sessions_multi_windowed_web_contents_router.h
diff --git a/chrome/browser/sync/sessions/sync_sessions_multi_windowed_web_contents_router.h b/chrome/browser/sync/sessions/sync_sessions_multi_windowed_web_contents_router.h
new file mode 100644
index 0000000000000000000000000000000000000000..a0a3edc2ecbebba72f1476294842c88dd87e9982
--- /dev/null
+++ b/chrome/browser/sync/sessions/sync_sessions_multi_windowed_web_contents_router.h
@@ -0,0 +1,46 @@
+// Copyright 2017 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 CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSIONS_MULTI_WINDOWED_WEB_CONTENTS_ROUTER_H_
+#define CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSIONS_MULTI_WINDOWED_WEB_CONTENTS_ROUTER_H_
+
+#include "chrome/browser/sync/sessions/sync_sessions_web_contents_router.h"
+#include "chrome/browser/ui/browser_list_observer.h"
+#include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
+
+class Profile;
+
+namespace sync_sessions {
+
+// Non-android subclass of SyncSessionsWebContentsRouter that adds tracking for
+// multi-window scenarios(e.g. tab movement between windows). Android doesn't
+// have a BrowserList or TabStrip, so it doesn't compile the needed
+// dependencies, nor would it benefit from the added tracking.
+class SyncSessionsMultiWindowedWebContentsRouter
Nicolas Zea 2017/03/20 18:14:50 Multi-windowed is a bit unclear of a name (Android
Patrick Noland 2017/03/21 22:54:30 Done.
+ : public SyncSessionsWebContentsRouter,
+ public chrome::BrowserListObserver,
+ public TabStripModelObserver {
+ public:
+ explicit SyncSessionsMultiWindowedWebContentsRouter(Profile* profile);
+
+ // KeyedService implementation.
+ void Shutdown() override;
+
+ protected:
+ ~SyncSessionsMultiWindowedWebContentsRouter() override;
+
+ private:
+ // chrome::BrowserListObserver implementation.
+ void OnBrowserAdded(Browser* browser) override;
+ void OnBrowserRemoved(Browser* browser) override;
+ // TabStripModelObserver implementation.
+ void TabInsertedAt(TabStripModel* model,
+ content::WebContents* web_contents,
+ int index,
+ bool foreground) override;
+};
+
+} // namespace sync_sessions
+
+#endif // CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSIONS_MULTI_WINDOWED_WEB_CONTENTS_ROUTER_H_

Powered by Google App Engine
This is Rietveld 408576698