OLD | NEW |
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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 local_sync_runners_.push_back(local_syncer.release()); | 400 local_sync_runners_.push_back(local_syncer.release()); |
401 remote_sync_runners_.push_back(remote_syncer.release()); | 401 remote_sync_runners_.push_back(remote_syncer.release()); |
402 | 402 |
403 ProfileSyncServiceBase* profile_sync_service = | 403 ProfileSyncServiceBase* profile_sync_service = |
404 ProfileSyncServiceFactory::GetForProfile(profile_); | 404 ProfileSyncServiceFactory::GetForProfile(profile_); |
405 if (profile_sync_service) { | 405 if (profile_sync_service) { |
406 UpdateSyncEnabledStatus(profile_sync_service); | 406 UpdateSyncEnabledStatus(profile_sync_service); |
407 profile_sync_service->AddObserver(this); | 407 profile_sync_service->AddObserver(this); |
408 } | 408 } |
409 | 409 |
410 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED, | 410 registrar_.Add(this, |
| 411 chrome::NOTIFICATION_EXTENSION_INSTALLED_DEPRECATED, |
411 content::Source<Profile>(profile_)); | 412 content::Source<Profile>(profile_)); |
412 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, | 413 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
413 content::Source<Profile>(profile_)); | 414 content::Source<Profile>(profile_)); |
414 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, | 415 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
415 content::Source<Profile>(profile_)); | 416 content::Source<Profile>(profile_)); |
416 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_ENABLED, | 417 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_ENABLED, |
417 content::Source<Profile>(profile_)); | 418 content::Source<Profile>(profile_)); |
418 } | 419 } |
419 | 420 |
420 void SyncFileSystemService::DidInitializeFileSystem( | 421 void SyncFileSystemService::DidInitializeFileSystem( |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 // (User action) (Notification type) | 617 // (User action) (Notification type) |
617 // Install: INSTALLED. | 618 // Install: INSTALLED. |
618 // Update: INSTALLED. | 619 // Update: INSTALLED. |
619 // Uninstall: UNINSTALLED. | 620 // Uninstall: UNINSTALLED. |
620 // Launch, Close: No notification. | 621 // Launch, Close: No notification. |
621 // Enable: ENABLED. | 622 // Enable: ENABLED. |
622 // Disable: UNLOADED(DISABLE). | 623 // Disable: UNLOADED(DISABLE). |
623 // Reload, Restart: UNLOADED(DISABLE) -> INSTALLED -> ENABLED. | 624 // Reload, Restart: UNLOADED(DISABLE) -> INSTALLED -> ENABLED. |
624 // | 625 // |
625 switch (type) { | 626 switch (type) { |
626 case chrome::NOTIFICATION_EXTENSION_INSTALLED: | 627 case chrome::NOTIFICATION_EXTENSION_INSTALLED_DEPRECATED: |
627 HandleExtensionInstalled(details); | 628 HandleExtensionInstalled(details); |
628 break; | 629 break; |
629 case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: | 630 case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: |
630 HandleExtensionUnloaded(type, details); | 631 HandleExtensionUnloaded(type, details); |
631 break; | 632 break; |
632 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: | 633 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: |
633 HandleExtensionUninstalled(type, details); | 634 HandleExtensionUninstalled(type, details); |
634 break; | 635 break; |
635 case chrome::NOTIFICATION_EXTENSION_ENABLED: | 636 case chrome::NOTIFICATION_EXTENSION_ENABLED: |
636 HandleExtensionEnabled(type, details); | 637 HandleExtensionEnabled(type, details); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get()); | 782 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get()); |
782 v2_remote_service_->AddFileStatusObserver(this); | 783 v2_remote_service_->AddFileStatusObserver(this); |
783 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get()); | 784 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get()); |
784 v2_remote_service_->SetSyncEnabled(sync_enabled_); | 785 v2_remote_service_->SetSyncEnabled(sync_enabled_); |
785 remote_sync_runners_.push_back(v2_remote_syncer.release()); | 786 remote_sync_runners_.push_back(v2_remote_syncer.release()); |
786 } | 787 } |
787 return v2_remote_service_.get(); | 788 return v2_remote_service_.get(); |
788 } | 789 } |
789 | 790 |
790 } // namespace sync_file_system | 791 } // namespace sync_file_system |
OLD | NEW |