| 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_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
| 12 | 12 |
| 13 namespace extension_urls { | 13 namespace extension_urls { |
| 14 // Returns the URL prefix for the extension/apps gallery. Can be set via the | |
| 15 // --apps-gallery-url switch. The URL returned will not contain a trailing | |
| 16 // slash. Do not use this as a prefix/extent for the store. | |
| 17 std::string GetWebstoreLaunchURL(); | |
| 18 | |
| 19 // Returns the URL to the extensions category on the Web Store. This is | |
| 20 // derived from GetWebstoreLaunchURL(). | |
| 21 std::string GetExtensionGalleryURL(); | |
| 22 | |
| 23 // Returns the URL prefix for an item in the extension/app gallery. This URL | |
| 24 // will contain a trailing slash and should be concatenated with an item ID | |
| 25 // to get the item detail URL. | |
| 26 std::string GetWebstoreItemDetailURLPrefix(); | |
| 27 | |
| 28 // Returns the URL used to get webstore data (ratings, manifest, icon URL, | |
| 29 // etc.) about an extension from the webstore as JSON. | |
| 30 GURL GetWebstoreItemJsonDataURL(const std::string& extension_id); | |
| 31 | |
| 32 // Returns the URL used to get webstore search results in JSON format. The URL | |
| 33 // returns a JSON dictionary that has the search results (under "results"). | |
| 34 // Each entry in the array is a dictionary as the data returned for | |
| 35 // GetWebstoreItemJsonDataURL above. |query| is the user typed query string. | |
| 36 // |hl| is the host language code, e.g. en_US. Both arguments will be escaped | |
| 37 // and added as a query parameter to the returned web store json search URL. | |
| 38 GURL GetWebstoreJsonSearchUrl(const std::string& query, | |
| 39 const std::string& hl); | |
| 40 | |
| 41 // Returns the URL of the web store search results page for |query|. | |
| 42 GURL GetWebstoreSearchPageUrl(const std::string& query); | |
| 43 | |
| 44 // Return the update URL used by gallery/webstore extensions/apps. | 14 // Return the update URL used by gallery/webstore extensions/apps. |
| 45 GURL GetWebstoreUpdateUrl(); | 15 GURL GetWebstoreUpdateUrl(); |
| 46 | 16 |
| 47 // Returns whether the URL is the webstore update URL (just considering host | 17 // Returns whether the URL is the webstore update URL (just considering host |
| 48 // and path, not scheme, query, etc.) | 18 // and path, not scheme, query, etc.) |
| 49 bool IsWebstoreUpdateUrl(const GURL& update_url); | 19 bool IsWebstoreUpdateUrl(const GURL& update_url); |
| 50 | 20 |
| 51 // Returns true if the URL points to an extension blacklist. | 21 // Returns true if the URL points to an extension blacklist. |
| 52 bool IsBlacklistUpdateUrl(const GURL& url); | 22 bool IsBlacklistUpdateUrl(const GURL& url); |
| 53 | 23 |
| 54 // The greatest common prefixes of the main extensions gallery's browse and | |
| 55 // download URLs. | |
| 56 extern const char kGalleryBrowsePrefix[]; | |
| 57 | |
| 58 // Field to use with webstore URL for tracking launch source. | 24 // Field to use with webstore URL for tracking launch source. |
| 59 extern const char kWebstoreSourceField[]; | 25 extern const char kWebstoreSourceField[]; |
| 60 | 26 |
| 61 // Values to use with webstore URL launch source field. | 27 // Values to use with webstore URL launch source field. |
| 62 extern const char kLaunchSourceAppList[]; | 28 extern const char kLaunchSourceAppList[]; |
| 63 extern const char kLaunchSourceAppListSearch[]; | 29 extern const char kLaunchSourceAppListSearch[]; |
| 64 } // namespace extension_urls | 30 } // namespace extension_urls |
| 65 | 31 |
| 66 namespace extension_misc { | 32 namespace extension_misc { |
| 67 // Matches chrome.windows.WINDOW_ID_NONE. | 33 // Matches chrome.windows.WINDOW_ID_NONE. |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 // List of sizes for extension icons that can be defined in the manifest. | 284 // List of sizes for extension icons that can be defined in the manifest. |
| 319 extern const int kExtensionActionIconSizes[]; | 285 extern const int kExtensionActionIconSizes[]; |
| 320 extern const size_t kNumExtensionActionIconSizes; | 286 extern const size_t kNumExtensionActionIconSizes; |
| 321 | 287 |
| 322 // List of sizes for extension icons that can be defined in the manifest. | 288 // List of sizes for extension icons that can be defined in the manifest. |
| 323 extern const int kScriptBadgeIconSizes[]; | 289 extern const int kScriptBadgeIconSizes[]; |
| 324 extern const size_t kNumScriptBadgeIconSizes; | 290 extern const size_t kNumScriptBadgeIconSizes; |
| 325 } // namespace extension_misc | 291 } // namespace extension_misc |
| 326 | 292 |
| 327 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_ | 293 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_ |
| OLD | NEW |