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

Side by Side Diff: chrome/browser/ui/webui/settings/people_handler.cc

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Use parameter 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 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/ui/webui/settings/people_handler.h" 5 #include "chrome/browser/ui/webui/settings/people_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 const std::string& /* username */, 684 const std::string& /* username */,
685 const std::string& /* password */) { 685 const std::string& /* password */) {
686 UpdateSyncStatus(); 686 UpdateSyncStatus();
687 } 687 }
688 688
689 void PeopleHandler::GoogleSignedOut(const std::string& /* account_id */, 689 void PeopleHandler::GoogleSignedOut(const std::string& /* account_id */,
690 const std::string& /* username */) { 690 const std::string& /* username */) {
691 UpdateSyncStatus(); 691 UpdateSyncStatus();
692 } 692 }
693 693
694 void PeopleHandler::OnStateChanged() { 694 void PeopleHandler::OnStateChanged(syncer::SyncService* sync) {
695 UpdateSyncStatus(); 695 UpdateSyncStatus();
696 696
697 // When the SyncService changes its state, we should also push the updated 697 // When the SyncService changes its state, we should also push the updated
698 // sync preferences. 698 // sync preferences.
699 PushSyncPrefs(); 699 PushSyncPrefs();
700 } 700 }
701 701
702 std::unique_ptr<base::DictionaryValue> 702 std::unique_ptr<base::DictionaryValue>
703 PeopleHandler::GetSyncStatusDictionary() { 703 PeopleHandler::GetSyncStatusDictionary() {
704 // The items which are to be written into |sync_status| are also described in 704 // The items which are to be written into |sync_status| are also described in
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 base::FilePath profile_file_path = profile_->GetPath(); 914 base::FilePath profile_file_path = profile_->GetPath();
915 ProfileMetrics::LogProfileSyncSignIn(profile_file_path); 915 ProfileMetrics::LogProfileSyncSignIn(profile_file_path);
916 916
917 // We're done configuring, so notify ProfileSyncService that it is OK to 917 // We're done configuring, so notify ProfileSyncService that it is OK to
918 // start syncing. 918 // start syncing.
919 sync_blocker_.reset(); 919 sync_blocker_.reset();
920 service->SetFirstSetupComplete(); 920 service->SetFirstSetupComplete();
921 } 921 }
922 922
923 } // namespace settings 923 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698