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_GOOGLE_APIS_GDATA_UTIL_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_GDATA_UTIL_H_ |
6 #define CHROME_BROWSER_GOOGLE_APIS_GDATA_UTIL_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_GDATA_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/platform_file.h" | 11 #include "base/platform_file.h" |
12 #include "chrome/browser/google_apis/gdata_errorcode.h" | 12 #include "chrome/browser/google_apis/gdata_errorcode.h" |
13 | 13 |
14 class FilePath; | 14 class FilePath; |
15 class Profile; | 15 class Profile; |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class SequencedTaskRunner; | 18 class SequencedTaskRunner; |
19 class Time; | 19 class Time; |
20 } // namespace base | 20 } // namespace base |
21 | 21 |
22 namespace tracked_objects { | 22 namespace tracked_objects { |
23 class Location; | 23 class Location; |
24 } // tracked_objects | 24 } // tracked_objects |
25 | 25 |
26 namespace gdata { | 26 namespace gdata { |
27 namespace util { | 27 namespace util { |
28 | 28 |
29 // Returns true if Drive is enabled for the specified profile. | |
30 // Must be called on UI thread. | |
31 // TODO(satorux): Move this function to DriveSystemService. | |
32 // crbug.com/153962 | |
33 bool IsDriveEnabled(Profile* profile); | |
34 | |
35 // Disables Drive for the specified profile. Used to disable Drive when | |
36 // needed (ex. initialization of the Drive cache failed). | |
37 // Must be called on UI thread. | |
38 // TODO(satorux): Move this function to DriveSystemService. | |
39 // crbug.com/153962 | |
40 void DisableDrive(Profile* profile); | |
41 | |
42 // Returns true if Drive v2 API is enabled via commandline switch. | 29 // Returns true if Drive v2 API is enabled via commandline switch. |
43 bool IsDriveV2ApiEnabled(); | 30 bool IsDriveV2ApiEnabled(); |
44 | 31 |
45 // Returns a PlatformFileError that corresponds to the DriveFileError provided. | 32 // Returns a PlatformFileError that corresponds to the DriveFileError provided. |
46 base::PlatformFileError DriveFileErrorToPlatformError(DriveFileError error); | 33 base::PlatformFileError DriveFileErrorToPlatformError(DriveFileError error); |
47 | 34 |
48 // Parses an RFC 3339 date/time into a base::Time, returning true on success. | 35 // Parses an RFC 3339 date/time into a base::Time, returning true on success. |
49 // The time string must be in the format "yyyy-mm-ddThh:mm:ss.dddTZ" (TZ is | 36 // The time string must be in the format "yyyy-mm-ddThh:mm:ss.dddTZ" (TZ is |
50 // either '+hh:mm', '-hh:mm', 'Z' (representing UTC), or an empty string). | 37 // either '+hh:mm', '-hh:mm', 'Z' (representing UTC), or an empty string). |
51 bool GetTimeFromString(const base::StringPiece& raw_value, base::Time* time); | 38 bool GetTimeFromString(const base::StringPiece& raw_value, base::Time* time); |
(...skipping 15 matching lines...) Expand all Loading... |
67 void PostBlockingPoolSequencedTaskAndReply( | 54 void PostBlockingPoolSequencedTaskAndReply( |
68 const tracked_objects::Location& from_here, | 55 const tracked_objects::Location& from_here, |
69 base::SequencedTaskRunner* blocking_task_runner, | 56 base::SequencedTaskRunner* blocking_task_runner, |
70 const base::Closure& request_task, | 57 const base::Closure& request_task, |
71 const base::Closure& reply_task); | 58 const base::Closure& reply_task); |
72 | 59 |
73 } // namespace util | 60 } // namespace util |
74 } // namespace gdata | 61 } // namespace gdata |
75 | 62 |
76 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_UTIL_H_ | 63 #endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_UTIL_H_ |
OLD | NEW |