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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/sync_engine.cc

Issue 419463002: [SyncFS] Restore refresh token availability on re-initialize of SyncEngine (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/drive_backend/sync_engine.h" 5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 base::Unretained(sync_worker_.get()), 347 base::Unretained(sync_worker_.get()),
348 base::Passed(&sync_engine_context))); 348 base::Passed(&sync_engine_context)));
349 if (remote_change_processor_) 349 if (remote_change_processor_)
350 SetRemoteChangeProcessor(remote_change_processor_); 350 SetRemoteChangeProcessor(remote_change_processor_);
351 351
352 drive_service_->AddObserver(this); 352 drive_service_->AddObserver(this);
353 353
354 service_state_ = REMOTE_SERVICE_TEMPORARY_UNAVAILABLE; 354 service_state_ = REMOTE_SERVICE_TEMPORARY_UNAVAILABLE;
355 SetSyncEnabled(sync_enabled_); 355 SetSyncEnabled(sync_enabled_);
356 OnNetworkChanged(net::NetworkChangeNotifier::GetConnectionType()); 356 OnNetworkChanged(net::NetworkChangeNotifier::GetConnectionType());
357 if (drive_service_->HasRefreshToken())
358 OnReadyToSendRequests();
359 else
360 OnRefreshTokenInvalid();
357 } 361 }
358 362
359 void SyncEngine::AddServiceObserver(SyncServiceObserver* observer) { 363 void SyncEngine::AddServiceObserver(SyncServiceObserver* observer) {
360 service_observers_.AddObserver(observer); 364 service_observers_.AddObserver(observer);
361 } 365 }
362 366
363 void SyncEngine::AddFileStatusObserver(FileStatusObserver* observer) { 367 void SyncEngine::AddFileStatusObserver(FileStatusObserver* observer) {
364 file_status_observers_.AddObserver(observer); 368 file_status_observers_.AddObserver(observer);
365 } 369 }
366 370
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 777
774 SyncStatusCallback SyncEngine::TrackCallback( 778 SyncStatusCallback SyncEngine::TrackCallback(
775 const SyncStatusCallback& callback) { 779 const SyncStatusCallback& callback) {
776 return callback_tracker_.Register( 780 return callback_tracker_.Register(
777 base::Bind(callback, SYNC_STATUS_ABORT), 781 base::Bind(callback, SYNC_STATUS_ABORT),
778 callback); 782 callback);
779 } 783 }
780 784
781 } // namespace drive_backend 785 } // namespace drive_backend
782 } // namespace sync_file_system 786 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698