OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |