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 GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ | 5 #ifndef GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ |
6 #define GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ | 6 #define GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // Returns whether this application is installed. | 177 // Returns whether this application is installed. |
178 bool is_installed() const { return installed_; } | 178 bool is_installed() const { return installed_; } |
179 | 179 |
180 // Returns whether this application is authorized to access data on the | 180 // Returns whether this application is authorized to access data on the |
181 // user's Drive. | 181 // user's Drive. |
182 bool is_authorized() const { return authorized_; } | 182 bool is_authorized() const { return authorized_; } |
183 | 183 |
184 // Returns the product URL, e.g. at Chrome Web Store. | 184 // Returns the product URL, e.g. at Chrome Web Store. |
185 const GURL& product_url() const { return product_url_; } | 185 const GURL& product_url() const { return product_url_; } |
186 | 186 |
| 187 // Returns the create URL, i.e., the URL for opening a new file by the app. |
| 188 const GURL& create_url() const { return create_url_; } |
| 189 |
187 // List of primary mime types supported by this WebApp. Primary status should | 190 // List of primary mime types supported by this WebApp. Primary status should |
188 // trigger this WebApp becoming the default handler of file instances that | 191 // trigger this WebApp becoming the default handler of file instances that |
189 // have these mime types. | 192 // have these mime types. |
190 const ScopedVector<std::string>& primary_mimetypes() const { | 193 const ScopedVector<std::string>& primary_mimetypes() const { |
191 return primary_mimetypes_; | 194 return primary_mimetypes_; |
192 } | 195 } |
193 | 196 |
194 // List of secondary mime types supported by this WebApp. Secondary status | 197 // List of secondary mime types supported by this WebApp. Secondary status |
195 // should make this WebApp show up in "Open with..." pop-up menu of the | 198 // should make this WebApp show up in "Open with..." pop-up menu of the |
196 // default action menu for file with matching mime types. | 199 // default action menu for file with matching mime types. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 ScopedVector<std::string> primary_file_extensions) { | 252 ScopedVector<std::string> primary_file_extensions) { |
250 primary_file_extensions_ = primary_file_extensions.Pass(); | 253 primary_file_extensions_ = primary_file_extensions.Pass(); |
251 } | 254 } |
252 void set_secondary_file_extensions( | 255 void set_secondary_file_extensions( |
253 ScopedVector<std::string> secondary_file_extensions) { | 256 ScopedVector<std::string> secondary_file_extensions) { |
254 secondary_file_extensions_ = secondary_file_extensions.Pass(); | 257 secondary_file_extensions_ = secondary_file_extensions.Pass(); |
255 } | 258 } |
256 void set_icons(ScopedVector<DriveAppIcon> icons) { | 259 void set_icons(ScopedVector<DriveAppIcon> icons) { |
257 icons_ = icons.Pass(); | 260 icons_ = icons.Pass(); |
258 } | 261 } |
| 262 void set_create_url(const GURL& url) { |
| 263 create_url_ = url; |
| 264 } |
259 | 265 |
260 private: | 266 private: |
261 friend class base::internal::RepeatedMessageConverter<AppResource>; | 267 friend class base::internal::RepeatedMessageConverter<AppResource>; |
262 friend class AppList; | 268 friend class AppList; |
263 | 269 |
264 // Parses and initializes data members from content of |value|. | 270 // Parses and initializes data members from content of |value|. |
265 // Return false if parsing fails. | 271 // Return false if parsing fails. |
266 bool Parse(const base::Value& value); | 272 bool Parse(const base::Value& value); |
267 | 273 |
268 std::string application_id_; | 274 std::string application_id_; |
269 std::string name_; | 275 std::string name_; |
270 std::string object_type_; | 276 std::string object_type_; |
271 bool supports_create_; | 277 bool supports_create_; |
272 bool supports_import_; | 278 bool supports_import_; |
273 bool installed_; | 279 bool installed_; |
274 bool authorized_; | 280 bool authorized_; |
275 GURL product_url_; | 281 GURL product_url_; |
| 282 GURL create_url_; |
276 ScopedVector<std::string> primary_mimetypes_; | 283 ScopedVector<std::string> primary_mimetypes_; |
277 ScopedVector<std::string> secondary_mimetypes_; | 284 ScopedVector<std::string> secondary_mimetypes_; |
278 ScopedVector<std::string> primary_file_extensions_; | 285 ScopedVector<std::string> primary_file_extensions_; |
279 ScopedVector<std::string> secondary_file_extensions_; | 286 ScopedVector<std::string> secondary_file_extensions_; |
280 ScopedVector<DriveAppIcon> icons_; | 287 ScopedVector<DriveAppIcon> icons_; |
281 | 288 |
282 DISALLOW_COPY_AND_ASSIGN(AppResource); | 289 DISALLOW_COPY_AND_ASSIGN(AppResource); |
283 }; | 290 }; |
284 | 291 |
285 // AppList represents a list of Drive Applications. | 292 // AppList represents a list of Drive Applications. |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 GURL next_link_; | 855 GURL next_link_; |
849 int64 largest_change_id_; | 856 int64 largest_change_id_; |
850 ScopedVector<ChangeResource> items_; | 857 ScopedVector<ChangeResource> items_; |
851 | 858 |
852 DISALLOW_COPY_AND_ASSIGN(ChangeList); | 859 DISALLOW_COPY_AND_ASSIGN(ChangeList); |
853 }; | 860 }; |
854 | 861 |
855 } // namespace google_apis | 862 } // namespace google_apis |
856 | 863 |
857 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ | 864 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ |
OLD | NEW |