Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_util.h

Issue 10920091: Move Drive API files to google_apis directory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix dependency problem Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_
7
8 #include <string>
9 #include <utility>
10 #include <vector>
11
12 #include "base/bind.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/platform_file.h"
15 #include "base/time.h"
16 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h"
17
18 class FilePath;
19 class Profile;
20
21 namespace base {
22 class SequencedTaskRunner;
23 } // namespace base
24
25 namespace tracked_objects {
26 class Location;
27 } // tracked_objects
28
29 namespace gdata {
30 namespace util {
31
32 // Returns true if gdata is currently active with the specified profile.
33 bool IsGDataAvailable(Profile* profile);
34
35 // Returns true if Drive v2 API is enabled via commandline switch.
36 bool IsDriveV2ApiEnabled();
37
38 // Returns a PlatformFileError that corresponds to the DriveFileError provided.
39 base::PlatformFileError DriveFileErrorToPlatformError(DriveFileError error);
40
41 // Parses an RFC 3339 date/time into a base::Time, returning true on success.
42 // The time string must be in the format "yyyy-mm-ddThh:mm:ss.dddTZ" (TZ is
43 // either '+hh:mm', '-hh:mm', 'Z' (representing UTC), or an empty string).
44 bool GetTimeFromString(const base::StringPiece& raw_value, base::Time* time);
45
46 // Formats a base::Time as an RFC 3339 date/time (in UTC).
47 std::string FormatTimeAsString(const base::Time& time);
48 // Formats a base::Time as an RFC 3339 date/time (in localtime).
49 std::string FormatTimeAsStringLocaltime(const base::Time& time);
50
51 // Wrapper around BrowserThread::PostTask to post a task to the blocking
52 // pool with the given sequence token.
53 void PostBlockingPoolSequencedTask(
54 const tracked_objects::Location& from_here,
55 base::SequencedTaskRunner* blocking_task_runner,
56 const base::Closure& task);
57
58 // Similar to PostBlockingPoolSequencedTask() but this one takes a reply
59 // callback that runs on the calling thread.
60 void PostBlockingPoolSequencedTaskAndReply(
61 const tracked_objects::Location& from_here,
62 base::SequencedTaskRunner* blocking_task_runner,
63 const base::Closure& request_task,
64 const base::Closure& reply_task);
65
66 } // namespace util
67 } // namespace gdata
68
69 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698