Chromium Code Reviews| 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/chromeos/drive/drive_sync_client.h" | 5 #include "chrome/browser/chromeos/drive/drive_sync_client.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/message_loop_proxy.h" | 11 #include "base/message_loop_proxy.h" |
| 12 #include "chrome/browser/api/prefs/pref_change_registrar.h" | 12 #include "chrome/browser/api/prefs/pref_change_registrar.h" |
| 13 #include "chrome/browser/chromeos/drive/drive.pb.h" | 13 #include "chrome/browser/chromeos/drive/drive.pb.h" |
| 14 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h" | 14 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h" |
| 15 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" | |
| 16 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 19 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 20 | 19 |
| 21 using content::BrowserThread; | 20 using content::BrowserThread; |
| 22 | 21 |
| 23 namespace drive { | 22 namespace drive { |
| 24 | 23 |
| 25 namespace { | 24 namespace { |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 if (profile_->GetPrefs()->GetBoolean(prefs::kDisableGData)) | 187 if (profile_->GetPrefs()->GetBoolean(prefs::kDisableGData)) |
| 189 return true; | 188 return true; |
| 190 | 189 |
| 191 // Should stop if the network is not online. | 190 // Should stop if the network is not online. |
| 192 if (net::NetworkChangeNotifier::IsOffline()) | 191 if (net::NetworkChangeNotifier::IsOffline()) |
| 193 return true; | 192 return true; |
| 194 | 193 |
| 195 // Should stop if the current connection is on cellular network, and | 194 // Should stop if the current connection is on cellular network, and |
| 196 // fetching is disabled over cellular. | 195 // fetching is disabled over cellular. |
| 197 if (profile_->GetPrefs()->GetBoolean(prefs::kDisableGDataOverCellular) && | 196 if (profile_->GetPrefs()->GetBoolean(prefs::kDisableGDataOverCellular) && |
| 198 util::IsConnectionTypeCellular()) | 197 net::NetworkChangeNotifier::IsConnectionCellular()) |
|
pauljensen
2012/10/22 14:05:07
How does this build? I thought you got rid of thi
droger
2012/10/22 15:11:32
Oops, I forgot to update this call, thanks.
Fixed
| |
| 199 return true; | 198 return true; |
| 200 | 199 |
| 201 return false; | 200 return false; |
| 202 } | 201 } |
| 203 | 202 |
| 204 void DriveSyncClient::OnInitialLoadFinished(DriveFileError error) { | 203 void DriveSyncClient::OnInitialLoadFinished(DriveFileError error) { |
| 205 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 204 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 206 | 205 |
| 207 StartProcessingBacklog(); | 206 StartProcessingBacklog(); |
| 208 } | 207 } |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 429 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 428 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 430 | 429 |
| 431 // Resume the sync loop if the network is back online. Note that we don't | 430 // Resume the sync loop if the network is back online. Note that we don't |
| 432 // need to check the type of the network as it will be checked in | 431 // need to check the type of the network as it will be checked in |
| 433 // ShouldStopSyncLoop() as soon as the loop is resumed. | 432 // ShouldStopSyncLoop() as soon as the loop is resumed. |
| 434 if (!net::NetworkChangeNotifier::IsOffline()) | 433 if (!net::NetworkChangeNotifier::IsOffline()) |
| 435 StartSyncLoop(); | 434 StartSyncLoop(); |
| 436 } | 435 } |
| 437 | 436 |
| 438 } // namespace drive | 437 } // namespace drive |
| OLD | NEW |