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 | |
72 // Converts FileResource to ResourceEntry. | 66 // Converts FileResource to ResourceEntry. |
73 scoped_ptr<google_apis::ResourceEntry> | 67 scoped_ptr<google_apis::ResourceEntry> |
74 ConvertFileResourceToResourceEntry( | 68 ConvertFileResourceToResourceEntry( |
75 const google_apis::FileResource& file_resource); | 69 const google_apis::FileResource& file_resource); |
76 | 70 |
77 // Converts ChangeResource to ResourceEntry. | 71 // Converts ChangeResource to ResourceEntry. |
78 scoped_ptr<google_apis::ResourceEntry> | 72 scoped_ptr<google_apis::ResourceEntry> |
79 ConvertChangeResourceToResourceEntry( | 73 ConvertChangeResourceToResourceEntry( |
80 const google_apis::ChangeResource& change_resource); | 74 const google_apis::ChangeResource& change_resource); |
81 | 75 |
(...skipping 18 matching lines...) Expand all Loading... |
100 bool IsKnownHostedDocumentMimeType(const std::string& mime_type); | 94 bool IsKnownHostedDocumentMimeType(const std::string& mime_type); |
101 | 95 |
102 // Returns true if the given file path has an extension corresponding to one of | 96 // Returns true if the given file path has an extension corresponding to one of |
103 // hosted document types. | 97 // hosted document types. |
104 bool HasHostedDocumentExtension(const base::FilePath& path); | 98 bool HasHostedDocumentExtension(const base::FilePath& path); |
105 | 99 |
106 } // namespace util | 100 } // namespace util |
107 } // namespace drive | 101 } // namespace drive |
108 | 102 |
109 #endif // CHROME_BROWSER_DRIVE_DRIVE_API_UTIL_H_ | 103 #endif // CHROME_BROWSER_DRIVE_DRIVE_API_UTIL_H_ |
OLD | NEW |