Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_COMMON_EXTENSION_URLS_H_ | 5 #ifndef EXTENSIONS_COMMON_EXTENSION_URLS_H_ |
| 6 #define EXTENSIONS_COMMON_EXTENSION_URLS_H_ | 6 #define EXTENSIONS_COMMON_EXTENSION_URLS_H_ |
| 7 | 7 |
| 8 #include <string> | |
| 9 | |
| 8 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 9 | 11 |
| 12 class GURL; | |
| 13 | |
| 10 namespace extensions { | 14 namespace extensions { |
| 11 | 15 |
| 12 // The name of the event_bindings module. | 16 // The name of the event_bindings module. |
| 13 extern const char kEventBindings[]; | 17 extern const char kEventBindings[]; |
| 14 | 18 |
| 15 // The name of the schemaUtils module. | 19 // The name of the schemaUtils module. |
| 16 extern const char kSchemaUtils[]; | 20 extern const char kSchemaUtils[]; |
| 17 | 21 |
| 18 // Determine whether or not a source came from an extension. |source| can link | 22 // Determine whether or not a source came from an extension. |source| can link |
| 19 // to a page or a script, and can be external (e.g., "http://www.google.com"), | 23 // to a page or a script, and can be external (e.g., "http://www.google.com"), |
| 20 // extension-related (e.g., "chrome-extension://<extension_id>/background.js"), | 24 // extension-related (e.g., "chrome-extension://<extension_id>/background.js"), |
| 21 // or internal (e.g., "event_bindings" or "schemaUtils"). | 25 // or internal (e.g., "event_bindings" or "schemaUtils"). |
| 22 bool IsSourceFromAnExtension(const base::string16& source); | 26 bool IsSourceFromAnExtension(const base::string16& source); |
| 23 | 27 |
| 24 } // namespace extensions | 28 } // namespace extensions |
| 25 | 29 |
| 30 namespace extension_urls { | |
| 31 | |
| 32 // Returns the URL prefix for the extension/apps gallery. Can be set via the | |
| 33 // --apps-gallery-url switch. The URL returned will not contain a trailing | |
| 34 // slash. Do not use this as a prefix/extent for the store. | |
| 35 std::string GetWebstoreLaunchURL(); | |
| 36 | |
| 37 // Returns the URL to the extensions category on the Web Store. This is | |
| 38 // derived from GetWebstoreLaunchURL(). | |
| 39 std::string GetExtensionGalleryURL(); | |
|
asargent_no_longer_on_chrome
2014/09/17 21:41:32
A long time ago we renamed the "extensions gallery
Ken Rockot(use gerrit already)
2014/09/17 22:04:29
Done.
| |
| 40 | |
| 41 // Returns the URL prefix for an item in the extension/app gallery. This URL | |
| 42 // will contain a trailing slash and should be concatenated with an item ID | |
| 43 // to get the item detail URL. | |
| 44 std::string GetWebstoreItemDetailURLPrefix(); | |
| 45 | |
| 46 // Returns the URL used to get webstore data (ratings, manifest, icon URL, | |
| 47 // etc.) about an extension from the webstore as JSON. | |
| 48 GURL GetWebstoreItemJsonDataURL(const std::string& extension_id); | |
| 49 | |
| 50 // Returns the URL used to get webstore search results in JSON format. The URL | |
| 51 // returns a JSON dictionary that has the search results (under "results"). | |
| 52 // Each entry in the array is a dictionary as the data returned for | |
| 53 // GetWebstoreItemJsonDataURL above. |query| is the user typed query string. | |
| 54 // |hl| is the host language code, e.g. en_US. Both arguments will be escaped | |
|
asargent_no_longer_on_chrome
2014/09/17 21:41:32
nit: consider renaming hl to host_language_code
Ken Rockot(use gerrit already)
2014/09/17 22:04:29
Done.
| |
| 55 // and added as a query parameter to the returned web store json search URL. | |
| 56 GURL GetWebstoreJsonSearchUrl(const std::string& query, const std::string& hl); | |
| 57 | |
| 58 // Returns the URL of the web store search results page for |query|. | |
| 59 GURL GetWebstoreSearchPageUrl(const std::string& query); | |
| 60 | |
| 61 // Return the update URL used by gallery/webstore extensions/apps. This may | |
| 62 // have been overridden by a command line flag for testing purposes. | |
| 63 GURL GetWebstoreUpdateUrl(); | |
| 64 | |
| 65 // Returns whether the URL is the webstore update URL (just considering host | |
| 66 // and path, not scheme, query, etc.) | |
| 67 bool IsWebstoreUpdateUrl(const GURL& update_url); | |
| 68 | |
| 69 // Returns true if the URL points to an extension blacklist. | |
| 70 bool IsBlacklistUpdateUrl(const GURL& url); | |
| 71 | |
| 72 } // namespace extension_urls | |
| 73 | |
| 26 #endif // EXTENSIONS_COMMON_EXTENSION_URLS_H_ | 74 #endif // EXTENSIONS_COMMON_EXTENSION_URLS_H_ |
| OLD | NEW |