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

Side by Side Diff: chrome/browser/sync/sessions/sync_sessions_web_contents_router.cc

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
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 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router.h" 5 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router.h"
6 6
7 #include "chrome/browser/history/history_service_factory.h" 7 #include "chrome/browser/history/history_service_factory.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #if !defined(OS_ANDROID) 9 #if !defined(OS_ANDROID)
10 #include "chrome/browser/sync/sessions/browser_list_router_helper.h" 10 #include "chrome/browser/sync/sessions/browser_list_router_helper.h"
(...skipping 28 matching lines...) Expand all
39 history::HistoryService* history_service = 39 history::HistoryService* history_service =
40 HistoryServiceFactory::GetForProfile(profile, 40 HistoryServiceFactory::GetForProfile(profile,
41 ServiceAccessType::EXPLICIT_ACCESS); 41 ServiceAccessType::EXPLICIT_ACCESS);
42 if (history_service) { 42 if (history_service) {
43 favicon_changed_subscription_ = history_service->AddFaviconsChangedCallback( 43 favicon_changed_subscription_ = history_service->AddFaviconsChangedCallback(
44 base::Bind(&SyncSessionsWebContentsRouter::OnFaviconsChanged, 44 base::Bind(&SyncSessionsWebContentsRouter::OnFaviconsChanged,
45 base::Unretained(this))); 45 base::Unretained(this)));
46 } 46 }
47 47
48 #if !defined(OS_ANDROID) 48 #if !defined(OS_ANDROID)
49 browser_list_helper_ = base::MakeUnique<BrowserListRouterHelper>(this); 49 browser_list_helper_ =
50 base::MakeUnique<BrowserListRouterHelper>(this, profile);
50 #endif // !defined(OS_ANDROID) 51 #endif // !defined(OS_ANDROID)
51 } 52 }
52 53
53 SyncSessionsWebContentsRouter::~SyncSessionsWebContentsRouter() {} 54 SyncSessionsWebContentsRouter::~SyncSessionsWebContentsRouter() {}
54 55
55 void SyncSessionsWebContentsRouter::NotifyTabModified( 56 void SyncSessionsWebContentsRouter::NotifyTabModified(
56 content::WebContents* web_contents, 57 content::WebContents* web_contents,
57 bool page_load_completed) { 58 bool page_load_completed) {
58 SyncedTabDelegate* delegate = nullptr; 59 SyncedTabDelegate* delegate = nullptr;
59 if (web_contents) 60 if (web_contents)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 93
93 void SyncSessionsWebContentsRouter::Shutdown() { 94 void SyncSessionsWebContentsRouter::Shutdown() {
94 favicon_changed_subscription_.reset(); 95 favicon_changed_subscription_.reset();
95 96
96 #if !defined(OS_ANDROID) 97 #if !defined(OS_ANDROID)
97 browser_list_helper_.reset(); 98 browser_list_helper_.reset();
98 #endif // !defined(OS_ANDROID) 99 #endif // !defined(OS_ANDROID)
99 } 100 }
100 101
101 } // namespace sync_sessions 102 } // namespace sync_sessions
OLDNEW
« no previous file with comments | « chrome/browser/sync/sessions/browser_list_router_helper_unittest.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698