Upstream version 10.38.222.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync_file_system / drive_backend_v1 / drive_file_sync_util.h
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_V1_DRIVE_FILE_SYNC_UTIL_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_V1_DRIVE_FILE_SYNC_UTIL_H_
7
8 #include "chrome/browser/sync_file_system/sync_status_code.h"
9 #include "google_apis/drive/gdata_errorcode.h"
10
11 namespace sync_file_system {
12
13 // Enables or disables Drive API in Sync FileSystem API.
14 // TODO(nhiroki): This method should go away when we completely migrate to
15 // DriveAPI. (http://crbug.com/234557)
16 void SetDisableDriveAPI(bool flag);
17
18 // Returns true if we disable Drive API in Sync FileSystem API.
19 // It is enabled by default but can be overridden by a command-line switch
20 // (--disable-drive-api-for-syncfs) or by calling SetDisableDriveAPI().
21 // TODO(nhiroki): This method should go away when we completely migrate to
22 // DriveAPI. (http://crbug.com/234557)
23 bool IsDriveAPIDisabled();
24
25 class ScopedDisableDriveAPI {
26  public:
27   ScopedDisableDriveAPI();
28   ~ScopedDisableDriveAPI();
29
30  private:
31   bool was_disabled_;
32
33   DISALLOW_COPY_AND_ASSIGN(ScopedDisableDriveAPI);
34 };
35
36 }  // namespace sync_file_system
37
38 #endif  // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_V1_DRIVE_FILE_SYNC_UTIL_H_