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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 // Reads URL from a GDoc file. | 198 // Reads URL from a GDoc file. |
199 GURL ReadUrlFromGDocFile(const base::FilePath& file_path); | 199 GURL ReadUrlFromGDocFile(const base::FilePath& file_path); |
200 | 200 |
201 // Reads resource ID from a GDoc file. | 201 // Reads resource ID from a GDoc file. |
202 std::string ReadResourceIdFromGDocFile(const base::FilePath& file_path); | 202 std::string ReadResourceIdFromGDocFile(const base::FilePath& file_path); |
203 | 203 |
204 // Returns true if Drive is enabled for the given Profile. | 204 // Returns true if Drive is enabled for the given Profile. |
205 bool IsDriveEnabledForProfile(Profile* profile); | 205 bool IsDriveEnabledForProfile(Profile* profile); |
206 | 206 |
| 207 // Enum type for describing the current connection status to Drive. |
| 208 enum ConnectionStatusType { |
| 209 // Disconnected because Drive service is unavailable for this account (either |
| 210 // disabled by a flag or the account has no Google account (e.g., guests)). |
| 211 DRIVE_DISCONNECTED_NOSERVICE, |
| 212 // Disconnected because no network is available. |
| 213 DRIVE_DISCONNECTED_NONETWORK, |
| 214 // Disconnected because authentication is not ready. |
| 215 DRIVE_DISCONNECTED_NOTREADY, |
| 216 // Connected by cellular network. Background sync is disabled. |
| 217 DRIVE_CONNECTED_METERED, |
| 218 // Connected without condition (WiFi, Ethernet, or cellular with the |
| 219 // disable-sync preference turned off.) |
| 220 DRIVE_CONNECTED, |
| 221 }; |
| 222 |
| 223 // Returns the Drive connection status for the |profile|. |
| 224 ConnectionStatusType GetDriveConnectionStatus(Profile* profile); |
| 225 |
207 } // namespace util | 226 } // namespace util |
208 } // namespace drive | 227 } // namespace drive |
209 | 228 |
210 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ | 229 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_UTIL_H_ |
OLD | NEW |