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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host.cc

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "chrome/browser/sync/glue/sync_backend_host.h" 7 #include "chrome/browser/sync/glue/sync_backend_host.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 15 matching lines...) Expand all
26 #include "chrome/browser/sync/notifier/sync_notifier.h" 26 #include "chrome/browser/sync/notifier/sync_notifier.h"
27 #include "chrome/browser/sync/protocol/sync.pb.h" 27 #include "chrome/browser/sync/protocol/sync.pb.h"
28 #include "chrome/browser/sync/sessions/session_state.h" 28 #include "chrome/browser/sync/sessions/session_state.h"
29 // TODO(tim): Remove this! We should have a syncapi pass-thru instead. 29 // TODO(tim): Remove this! We should have a syncapi pass-thru instead.
30 #include "chrome/browser/sync/syncable/directory_manager.h" // Cryptographer. 30 #include "chrome/browser/sync/syncable/directory_manager.h" // Cryptographer.
31 #include "chrome/browser/sync/sync_prefs.h" 31 #include "chrome/browser/sync/sync_prefs.h"
32 #include "chrome/common/chrome_notification_types.h" 32 #include "chrome/common/chrome_notification_types.h"
33 #include "chrome/common/chrome_version_info.h" 33 #include "chrome/common/chrome_version_info.h"
34 #include "chrome/common/net/gaia/gaia_constants.h" 34 #include "chrome/common/net/gaia/gaia_constants.h"
35 #include "content/browser/browser_thread.h" 35 #include "content/browser/browser_thread.h"
36 #include "content/common/notification_service.h" 36 #include "content/public/browser/notification_service.h"
37 #include "content/public/common/content_client.h" 37 #include "content/public/common/content_client.h"
38 38
39 static const int kSaveChangesIntervalSeconds = 10; 39 static const int kSaveChangesIntervalSeconds = 10;
40 static const FilePath::CharType kSyncDataFolderName[] = 40 static const FilePath::CharType kSyncDataFolderName[] =
41 FILE_PATH_LITERAL("Sync Data"); 41 FILE_PATH_LITERAL("Sync Data");
42 42
43 typedef TokenService::TokenAvailableDetails TokenAvailableDetails; 43 typedef TokenService::TokenAvailableDetails TokenAvailableDetails;
44 44
45 typedef GoogleServiceAuthError AuthError; 45 typedef GoogleServiceAuthError AuthError;
46 46
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 781
782 host_->PersistEncryptionBootstrapToken(bootstrap_token); 782 host_->PersistEncryptionBootstrapToken(bootstrap_token);
783 host_->frontend_->OnPassphraseAccepted(); 783 host_->frontend_->OnPassphraseAccepted();
784 } 784 }
785 785
786 void SyncBackendHost::Core::NotifyUpdatedToken(const std::string& token) { 786 void SyncBackendHost::Core::NotifyUpdatedToken(const std::string& token) {
787 if (!host_) 787 if (!host_)
788 return; 788 return;
789 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 789 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
790 TokenAvailableDetails details(GaiaConstants::kSyncService, token); 790 TokenAvailableDetails details(GaiaConstants::kSyncService, token);
791 NotificationService::current()->Notify( 791 content::NotificationService::current()->Notify(
792 chrome::NOTIFICATION_TOKEN_UPDATED, 792 chrome::NOTIFICATION_TOKEN_UPDATED,
793 content::Source<Profile>(host_->profile_), 793 content::Source<Profile>(host_->profile_),
794 content::Details<const TokenAvailableDetails>(&details)); 794 content::Details<const TokenAvailableDetails>(&details));
795 } 795 }
796 796
797 void SyncBackendHost::Core::NotifyEncryptionComplete( 797 void SyncBackendHost::Core::NotifyEncryptionComplete(
798 const syncable::ModelTypeSet& encrypted_types) { 798 const syncable::ModelTypeSet& encrypted_types) {
799 if (!host_) 799 if (!host_)
800 return; 800 return;
801 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); 801 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_);
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 FROM_HERE, 1044 FROM_HERE,
1045 base::Bind(&SyncBackendHost::Core::DoRefreshEncryption, 1045 base::Bind(&SyncBackendHost::Core::DoRefreshEncryption,
1046 core_.get(), sync_thread_done_callback)); 1046 core_.get(), sync_thread_done_callback));
1047 } 1047 }
1048 1048
1049 #undef SVLOG 1049 #undef SVLOG
1050 1050
1051 #undef SLOG 1051 #undef SLOG
1052 1052
1053 } // namespace browser_sync 1053 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/session_model_associator.cc ('k') | chrome/browser/sync/glue/typed_url_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698