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_DRIVE_DRIVE_API_UTIL_H_ | 5 #ifndef CHROME_BROWSER_DRIVE_DRIVE_API_UTIL_H_ |
6 #define CHROME_BROWSER_DRIVE_DRIVE_API_UTIL_H_ | 6 #define CHROME_BROWSER_DRIVE_DRIVE_API_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "chrome/browser/google_apis/drive_common_callbacks.h" | 11 #include "chrome/browser/google_apis/drive_common_callbacks.h" |
12 #include "chrome/browser/google_apis/gdata_errorcode.h" | 12 #include "chrome/browser/google_apis/gdata_errorcode.h" |
13 | 13 |
14 class GURL; | 14 class GURL; |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class Value; | 17 class Value; |
18 } // namespace base | 18 } // namespace base |
19 | 19 |
| 20 namespace google_apis { |
| 21 class FileResource; |
| 22 class ResourceEntry; |
| 23 } // namespace google_apis |
| 24 |
20 namespace drive { | 25 namespace drive { |
21 namespace util { | 26 namespace util { |
22 | 27 |
23 // Returns true if Drive v2 API is enabled via commandline switch. | 28 // Returns true if Drive v2 API is enabled via commandline switch. |
24 bool IsDriveV2ApiEnabled(); | 29 bool IsDriveV2ApiEnabled(); |
25 | 30 |
26 // Escapes ' to \' in the |str|. This is designed to use for string value of | 31 // Escapes ' to \' in the |str|. This is designed to use for string value of |
27 // search parameter on Drive API v2. | 32 // search parameter on Drive API v2. |
28 // See also: https://developers.google.com/drive/search-parameters | 33 // See also: https://developers.google.com/drive/search-parameters |
29 std::string EscapeQueryStringValue(const std::string& str); | 34 std::string EscapeQueryStringValue(const std::string& str); |
(...skipping 25 matching lines...) Expand all Loading... |
55 // OAuth2 scopes for the GData WAPI. | 60 // OAuth2 scopes for the GData WAPI. |
56 extern const char kDocsListScope[]; | 61 extern const char kDocsListScope[]; |
57 extern const char kDriveAppsScope[]; | 62 extern const char kDriveAppsScope[]; |
58 | 63 |
59 // Extracts an url to the sharing dialog and returns it via |callback|. If | 64 // Extracts an url to the sharing dialog and returns it via |callback|. If |
60 // the share url doesn't exist, then an empty url is returned. | 65 // the share url doesn't exist, then an empty url is returned. |
61 void ParseShareUrlAndRun(const google_apis::GetShareUrlCallback& callback, | 66 void ParseShareUrlAndRun(const google_apis::GetShareUrlCallback& callback, |
62 google_apis::GDataErrorCode error, | 67 google_apis::GDataErrorCode error, |
63 scoped_ptr<base::Value> value); | 68 scoped_ptr<base::Value> value); |
64 | 69 |
| 70 // Converts ResourceEntry to FileResource. |
| 71 scoped_ptr<google_apis::FileResource> |
| 72 ConvertResourceEntryToFileResource(const google_apis::ResourceEntry& entry); |
| 73 |
65 // The resource ID for the root directory for WAPI is defined in the spec: | 74 // The resource ID for the root directory for WAPI is defined in the spec: |
66 // https://developers.google.com/google-apps/documents-list/ | 75 // https://developers.google.com/google-apps/documents-list/ |
67 extern const char kWapiRootDirectoryResourceId[]; | 76 extern const char kWapiRootDirectoryResourceId[]; |
68 | 77 |
69 } // namespace util | 78 } // namespace util |
70 } // namespace drive | 79 } // namespace drive |
71 | 80 |
72 #endif // CHROME_BROWSER_DRIVE_DRIVE_API_UTIL_H_ | 81 #endif // CHROME_BROWSER_DRIVE_DRIVE_API_UTIL_H_ |
OLD | NEW |