diff options
author | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-03 07:38:30 +0000 |
---|---|---|
committer | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-03 07:38:30 +0000 |
commit | 79a66c5e94b8930a52d90ef7904c9486e9048687 (patch) | |
tree | 1a88120782f1ceec690339c7001f24f7e7d6b470 /chrome/browser/chromeos/drive/file_system_util.h | |
parent | 3c53f86574789c7c7518f4213d210e6d2b87e566 (diff) | |
download | chromium_src-79a66c5e94b8930a52d90ef7904c9486e9048687.zip chromium_src-79a66c5e94b8930a52d90ef7904c9486e9048687.tar.gz chromium_src-79a66c5e94b8930a52d90ef7904c9486e9048687.tar.bz2 |
Simplify fileBrowserPrivate.getDriveConnectionStatus().
The "reasons" field had been a subset of {NO_SERVICE, NO_NETWORK, NOT_READY},
but it is now used only for signaling errors when it has NOT_READY
without other reasons. This can more simply be represented
by a single "reason" field whose value is set in the order:
NO_SERVICE > NO_NETWORK > NOT_READY, i.e., NOT_READY is set
only when other two states are not set.
BUG=237427
R=benwells@chromium.org, yoshiki@chromium.org
Review URL: https://codereview.chromium.org/98493003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238318 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/drive/file_system_util.h')
-rw-r--r-- | chrome/browser/chromeos/drive/file_system_util.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/drive/file_system_util.h b/chrome/browser/chromeos/drive/file_system_util.h index 96029f8..7766f0c 100644 --- a/chrome/browser/chromeos/drive/file_system_util.h +++ b/chrome/browser/chromeos/drive/file_system_util.h @@ -204,6 +204,25 @@ std::string ReadResourceIdFromGDocFile(const base::FilePath& file_path); // Returns true if Drive is enabled for the given Profile. bool IsDriveEnabledForProfile(Profile* profile); +// Enum type for describing the current connection status to Drive. +enum ConnectionStatusType { + // Disconnected because Drive service is unavailable for this account (either + // disabled by a flag or the account has no Google account (e.g., guests)). + DRIVE_DISCONNECTED_NOSERVICE, + // Disconnected because no network is available. + DRIVE_DISCONNECTED_NONETWORK, + // Disconnected because authentication is not ready. + DRIVE_DISCONNECTED_NOTREADY, + // Connected by cellular network. Background sync is disabled. + DRIVE_CONNECTED_METERED, + // Connected without condition (WiFi, Ethernet, or cellular with the + // disable-sync preference turned off.) + DRIVE_CONNECTED, +}; + +// Returns the Drive connection status for the |profile|. +ConnectionStatusType GetDriveConnectionStatus(Profile* profile); + } // namespace util } // namespace drive |