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" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // See also: https://developers.google.com/drive/search-parameters | 56 // See also: https://developers.google.com/drive/search-parameters |
57 std::string TranslateQuery(const std::string& original_query); | 57 std::string TranslateQuery(const std::string& original_query); |
58 | 58 |
59 // Extracts resource_id out of edit url. | 59 // Extracts resource_id out of edit url. |
60 std::string ExtractResourceIdFromUrl(const GURL& url); | 60 std::string ExtractResourceIdFromUrl(const GURL& url); |
61 | 61 |
62 // If |resource_id| is in the old resource ID format used by WAPI, converts it | 62 // If |resource_id| is in the old resource ID format used by WAPI, converts it |
63 // into the new format. | 63 // into the new format. |
64 std::string CanonicalizeResourceId(const std::string& resource_id); | 64 std::string CanonicalizeResourceId(const std::string& resource_id); |
65 | 65 |
| 66 // Extracts an url to the sharing dialog and returns it via |callback|. If |
| 67 // the share url doesn't exist, then an empty url is returned. |
| 68 void ParseShareUrlAndRun(const google_apis::GetShareUrlCallback& callback, |
| 69 google_apis::GDataErrorCode error, |
| 70 scoped_ptr<base::Value> value); |
| 71 |
66 // Converts FileResource to ResourceEntry. | 72 // Converts FileResource to ResourceEntry. |
67 scoped_ptr<google_apis::ResourceEntry> | 73 scoped_ptr<google_apis::ResourceEntry> |
68 ConvertFileResourceToResourceEntry( | 74 ConvertFileResourceToResourceEntry( |
69 const google_apis::FileResource& file_resource); | 75 const google_apis::FileResource& file_resource); |
70 | 76 |
71 // Converts ChangeResource to ResourceEntry. | 77 // Converts ChangeResource to ResourceEntry. |
72 scoped_ptr<google_apis::ResourceEntry> | 78 scoped_ptr<google_apis::ResourceEntry> |
73 ConvertChangeResourceToResourceEntry( | 79 ConvertChangeResourceToResourceEntry( |
74 const google_apis::ChangeResource& change_resource); | 80 const google_apis::ChangeResource& change_resource); |
75 | 81 |
(...skipping 18 matching lines...) Expand all Loading... |
94 bool IsKnownHostedDocumentMimeType(const std::string& mime_type); | 100 bool IsKnownHostedDocumentMimeType(const std::string& mime_type); |
95 | 101 |
96 // Returns true if the given file path has an extension corresponding to one of | 102 // Returns true if the given file path has an extension corresponding to one of |
97 // hosted document types. | 103 // hosted document types. |
98 bool HasHostedDocumentExtension(const base::FilePath& path); | 104 bool HasHostedDocumentExtension(const base::FilePath& path); |
99 | 105 |
100 } // namespace util | 106 } // namespace util |
101 } // namespace drive | 107 } // namespace drive |
102 | 108 |
103 #endif // CHROME_BROWSER_DRIVE_DRIVE_API_UTIL_H_ | 109 #endif // CHROME_BROWSER_DRIVE_DRIVE_API_UTIL_H_ |
OLD | NEW |