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

Side by Side Diff: chrome/browser/sync/sessions/browser_list_router_helper.h

Issue 2887513002: [sync] Scope BrowserListRouterHelper to browsers with a matching profile (Closed)
Patch Set: fix last memory leak Created 3 years, 7 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 | « no previous file | chrome/browser/sync/sessions/browser_list_router_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 CHROME_BROWSER_SYNC_SESSIONS_BROWSER_LIST_ROUTER_HELPER_H_ 5 #ifndef CHROME_BROWSER_SYNC_SESSIONS_BROWSER_LIST_ROUTER_HELPER_H_
6 #define CHROME_BROWSER_SYNC_SESSIONS_BROWSER_LIST_ROUTER_HELPER_H_ 6 #define CHROME_BROWSER_SYNC_SESSIONS_BROWSER_LIST_ROUTER_HELPER_H_
7 7
8 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router.h" 8 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router.h"
9 #include "chrome/browser/ui/browser_list_observer.h" 9 #include "chrome/browser/ui/browser_list_observer.h"
10 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
11 11
12 namespace sync_sessions { 12 namespace sync_sessions {
13 13
14 // Non-android helper of SyncSessionsWebContentsRouter that adds tracking for 14 // Non-android helper of SyncSessionsWebContentsRouter that adds tracking for
15 // multi-window scenarios(e.g. tab movement between windows). Android doesn't 15 // multi-window scenarios(e.g. tab movement between windows). Android doesn't
16 // have a BrowserList or TabStrip, so it doesn't compile the needed 16 // have a BrowserList or TabStrip, so it doesn't compile the needed
17 // dependencies, nor would it benefit from the added tracking. 17 // dependencies, nor would it benefit from the added tracking.
18 class BrowserListRouterHelper : public chrome::BrowserListObserver, 18 class BrowserListRouterHelper : public chrome::BrowserListObserver,
19 public TabStripModelObserver { 19 public TabStripModelObserver {
20 public: 20 public:
21 explicit BrowserListRouterHelper(SyncSessionsWebContentsRouter* router); 21 explicit BrowserListRouterHelper(SyncSessionsWebContentsRouter* router,
22 Profile* profile);
22 ~BrowserListRouterHelper() override; 23 ~BrowserListRouterHelper() override;
23 24
24 private: 25 private:
25 // chrome::BrowserListObserver implementation. 26 // chrome::BrowserListObserver implementation.
26 void OnBrowserAdded(Browser* browser) override; 27 void OnBrowserAdded(Browser* browser) override;
27 void OnBrowserRemoved(Browser* browser) override; 28 void OnBrowserRemoved(Browser* browser) override;
28 // TabStripModelObserver implementation. 29 // TabStripModelObserver implementation.
29 void TabInsertedAt(TabStripModel* model, 30 void TabInsertedAt(TabStripModel* model,
30 content::WebContents* web_contents, 31 content::WebContents* web_contents,
31 int index, 32 int index,
32 bool foreground) override; 33 bool foreground) override;
33 34
34 // |router_| owns |this|. 35 // |router_| owns |this|.
35 SyncSessionsWebContentsRouter* router_; 36 SyncSessionsWebContentsRouter* router_;
36 37
38 Profile* profile_;
39
40 std::set<Browser*> attached_browsers_;
41
37 DISALLOW_COPY_AND_ASSIGN(BrowserListRouterHelper); 42 DISALLOW_COPY_AND_ASSIGN(BrowserListRouterHelper);
38 }; 43 };
39 44
40 } // namespace sync_sessions 45 } // namespace sync_sessions
41 46
42 #endif // CHROME_BROWSER_SYNC_SESSIONS_BROWSER_LIST_ROUTER_HELPER_H_ 47 #endif // CHROME_BROWSER_SYNC_SESSIONS_BROWSER_LIST_ROUTER_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/sessions/browser_list_router_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698