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

Side by Side Diff: chrome/browser/sync_file_system/sync_file_system_service.cc

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Chromeos fix Created 3 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_file_system/sync_file_system_service.h" 5 #include "chrome/browser/sync_file_system/sync_file_system_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 content::BrowserContext* browser_context, 721 content::BrowserContext* browser_context,
722 const Extension* extension) { 722 const Extension* extension) {
723 GURL app_origin = Extension::GetBaseURLFromExtensionId(extension->id()); 723 GURL app_origin = Extension::GetBaseURLFromExtensionId(extension->id());
724 DVLOG(1) << "Handle extension notification for LOADED: " << app_origin; 724 DVLOG(1) << "Handle extension notification for LOADED: " << app_origin;
725 remote_service_->EnableOrigin( 725 remote_service_->EnableOrigin(
726 app_origin, 726 app_origin,
727 base::Bind(&DidHandleLoadEvent, app_origin)); 727 base::Bind(&DidHandleLoadEvent, app_origin));
728 local_service_->SetOriginEnabled(app_origin, true); 728 local_service_->SetOriginEnabled(app_origin, true);
729 } 729 }
730 730
731 void SyncFileSystemService::OnStateChanged() { 731 void SyncFileSystemService::OnStateChanged(syncer::SyncService* sync) {
732 syncer::SyncService* profile_sync_service = 732 UpdateSyncEnabledStatus(sync);
733 ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(profile_);
734 if (profile_sync_service)
735 UpdateSyncEnabledStatus(profile_sync_service);
736 } 733 }
737 734
738 void SyncFileSystemService::OnFileStatusChanged( 735 void SyncFileSystemService::OnFileStatusChanged(
739 const FileSystemURL& url, 736 const FileSystemURL& url,
740 SyncFileType file_type, 737 SyncFileType file_type,
741 SyncFileStatus sync_status, 738 SyncFileStatus sync_status,
742 SyncAction action_taken, 739 SyncAction action_taken,
743 SyncDirection direction) { 740 SyncDirection direction) {
744 for (auto& observer : observers_) 741 for (auto& observer : observers_)
745 observer.OnFileSynced(url, file_type, sync_status, action_taken, direction); 742 observer.OnFileSynced(url, file_type, sync_status, action_taken, direction);
(...skipping 17 matching lines...) Expand all
763 local_sync_runners_.begin(); 760 local_sync_runners_.begin();
764 iter != local_sync_runners_.end(); ++iter) 761 iter != local_sync_runners_.end(); ++iter)
765 ((*iter)->*method)(); 762 ((*iter)->*method)();
766 for (ScopedVector<SyncProcessRunner>::iterator iter = 763 for (ScopedVector<SyncProcessRunner>::iterator iter =
767 remote_sync_runners_.begin(); 764 remote_sync_runners_.begin();
768 iter != remote_sync_runners_.end(); ++iter) 765 iter != remote_sync_runners_.end(); ++iter)
769 ((*iter)->*method)(); 766 ((*iter)->*method)();
770 } 767 }
771 768
772 } // namespace sync_file_system 769 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/sync_file_system_service.h ('k') | chrome/browser/ui/ash/app_sync_ui_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698