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

Side by Side Diff: chrome/browser/sync/chrome_sync_client.cc

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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/chrome_sync_client.h" 5 #include "chrome/browser/sync/chrome_sync_client.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 10 matching lines...) Expand all
21 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" 21 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h"
22 #include "chrome/browser/password_manager/password_store_factory.h" 22 #include "chrome/browser/password_manager/password_store_factory.h"
23 #include "chrome/browser/prefs/pref_service_syncable_util.h" 23 #include "chrome/browser/prefs/pref_service_syncable_util.h"
24 #include "chrome/browser/profiles/profile.h" 24 #include "chrome/browser/profiles/profile.h"
25 #include "chrome/browser/profiles/profile_manager.h" 25 #include "chrome/browser/profiles/profile_manager.h"
26 #include "chrome/browser/search_engines/template_url_service_factory.h" 26 #include "chrome/browser/search_engines/template_url_service_factory.h"
27 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 27 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
28 #include "chrome/browser/sync/glue/sync_start_util.h" 28 #include "chrome/browser/sync/glue/sync_start_util.h"
29 #include "chrome/browser/sync/glue/theme_data_type_controller.h" 29 #include "chrome/browser/sync/glue/theme_data_type_controller.h"
30 #include "chrome/browser/sync/profile_sync_service_factory.h" 30 #include "chrome/browser/sync/profile_sync_service_factory.h"
31 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" 31 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router.h"
32 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router_factory .h"
32 #include "chrome/browser/themes/theme_service.h" 33 #include "chrome/browser/themes/theme_service.h"
33 #include "chrome/browser/themes/theme_service_factory.h" 34 #include "chrome/browser/themes/theme_service_factory.h"
34 #include "chrome/browser/themes/theme_syncable_service.h" 35 #include "chrome/browser/themes/theme_syncable_service.h"
35 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" 36 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h"
36 #include "chrome/browser/undo/bookmark_undo_service_factory.h" 37 #include "chrome/browser/undo/bookmark_undo_service_factory.h"
37 #include "chrome/browser/web_data_service_factory.h" 38 #include "chrome/browser/web_data_service_factory.h"
38 #include "chrome/common/channel_info.h" 39 #include "chrome/common/channel_info.h"
39 #include "chrome/common/chrome_paths.h" 40 #include "chrome/common/chrome_paths.h"
40 #include "chrome/common/features.h" 41 #include "chrome/common/features.h"
41 #include "chrome/common/pref_names.h" 42 #include "chrome/common/pref_names.h"
(...skipping 18 matching lines...) Expand all
60 #include "components/spellcheck/spellcheck_build_features.h" 61 #include "components/spellcheck/spellcheck_build_features.h"
61 #include "components/sync/base/pref_names.h" 62 #include "components/sync/base/pref_names.h"
62 #include "components/sync/base/report_unrecoverable_error.h" 63 #include "components/sync/base/report_unrecoverable_error.h"
63 #include "components/sync/driver/async_directory_type_controller.h" 64 #include "components/sync/driver/async_directory_type_controller.h"
64 #include "components/sync/driver/sync_api_component_factory.h" 65 #include "components/sync/driver/sync_api_component_factory.h"
65 #include "components/sync/driver/sync_util.h" 66 #include "components/sync/driver/sync_util.h"
66 #include "components/sync/engine/browser_thread_model_worker.h" 67 #include "components/sync/engine/browser_thread_model_worker.h"
67 #include "components/sync/engine/passive_model_worker.h" 68 #include "components/sync/engine/passive_model_worker.h"
68 #include "components/sync/engine/ui_model_worker.h" 69 #include "components/sync/engine/ui_model_worker.h"
69 #include "components/sync_preferences/pref_service_syncable.h" 70 #include "components/sync_preferences/pref_service_syncable.h"
71 #include "components/sync_sessions/favicon_cache.h"
70 #include "components/sync_sessions/sync_sessions_client.h" 72 #include "components/sync_sessions/sync_sessions_client.h"
71 #include "content/public/browser/browser_thread.h" 73 #include "content/public/browser/browser_thread.h"
72 #include "extensions/features/features.h" 74 #include "extensions/features/features.h"
73 #include "ui/base/device_form_factor.h" 75 #include "ui/base/device_form_factor.h"
74 76
75 #if BUILDFLAG(ENABLE_APP_LIST) 77 #if BUILDFLAG(ENABLE_APP_LIST)
76 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" 78 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
77 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" 79 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h"
78 #include "ui/app_list/app_list_switches.h" 80 #include "ui/app_list/app_list_switches.h"
79 #endif 81 #endif
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 176 }
175 return url.is_valid() && !url.SchemeIs(content::kChromeUIScheme) && 177 return url.is_valid() && !url.SchemeIs(content::kChromeUIScheme) &&
176 !url.SchemeIs(chrome::kChromeNativeScheme) && !url.SchemeIsFile(); 178 !url.SchemeIs(chrome::kChromeNativeScheme) && !url.SchemeIsFile();
177 } 179 }
178 180
179 sync_sessions::SyncedWindowDelegatesGetter* GetSyncedWindowDelegatesGetter() 181 sync_sessions::SyncedWindowDelegatesGetter* GetSyncedWindowDelegatesGetter()
180 override { 182 override {
181 return window_delegates_getter_.get(); 183 return window_delegates_getter_.get();
182 } 184 }
183 185
184 std::unique_ptr<sync_sessions::LocalSessionEventRouter> 186 sync_sessions::LocalSessionEventRouter* GetLocalSessionEventRouter()
185 GetLocalSessionEventRouter() override { 187 override {
186 syncer::SyncableService::StartSyncFlare flare( 188 syncer::SyncableService::StartSyncFlare flare(
187 sync_start_util::GetFlareForSyncableService(profile_->GetPath())); 189 sync_start_util::GetFlareForSyncableService(profile_->GetPath()));
188 return base::MakeUnique<sync_sessions::NotificationServiceSessionsRouter>( 190 sync_sessions::SyncSessionsWebContentsRouter* router =
189 profile_, this, flare); 191 sync_sessions::SyncSessionsWebContentsRouterFactory::GetForProfile(
192 profile_);
193 router->InjectStartSyncFlare(flare);
194 return router;
190 } 195 }
191 196
192 private: 197 private:
193 Profile* profile_; 198 Profile* profile_;
194 std::unique_ptr<sync_sessions::SyncedWindowDelegatesGetter> 199 std::unique_ptr<sync_sessions::SyncedWindowDelegatesGetter>
195 window_delegates_getter_; 200 window_delegates_getter_;
196 201
197 DISALLOW_COPY_AND_ASSIGN(SyncSessionsClientImpl); 202 DISALLOW_COPY_AND_ASSIGN(SyncSessionsClientImpl);
198 }; 203 };
199 204
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 sync_service->RegisterDataTypeController( 701 sync_service->RegisterDataTypeController(
697 base::MakeUnique<SupervisedUserSyncDataTypeController>( 702 base::MakeUnique<SupervisedUserSyncDataTypeController>(
698 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); 703 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_));
699 sync_service->RegisterDataTypeController( 704 sync_service->RegisterDataTypeController(
700 base::MakeUnique<SupervisedUserSyncDataTypeController>( 705 base::MakeUnique<SupervisedUserSyncDataTypeController>(
701 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); 706 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_));
702 #endif 707 #endif
703 } 708 }
704 709
705 } // namespace browser_sync 710 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698