Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: chrome/common/extensions/extension_constants.h

Issue 575113002: Move Webstore URL concepts to //extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ENABLE_EXTENSIONS guard in core chrome code Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 14
15 // Returns the URL prefix for the extension/apps gallery. Can be set via the 15 // This returns the compile-time constant webstore update url specific to
16 // --apps-gallery-url switch. The URL returned will not contain a trailing 16 // Chrome. Usually you should prefer using GetWebstoreUpdateUrl.
17 // slash. Do not use this as a prefix/extent for the store.
18 std::string GetWebstoreLaunchURL();
19
20 // Returns the URL to the extensions category on the Web Store. This is
21 // derived from GetWebstoreLaunchURL().
22 std::string GetExtensionGalleryURL();
23
24 // Returns the URL prefix for an item in the extension/app gallery. This URL
25 // will contain a trailing slash and should be concatenated with an item ID
26 // to get the item detail URL.
27 std::string GetWebstoreItemDetailURLPrefix();
28
29 // Returns the URL used to get webstore data (ratings, manifest, icon URL,
30 // etc.) about an extension from the webstore as JSON.
31 GURL GetWebstoreItemJsonDataURL(const std::string& extension_id);
32
33 // Returns the URL used to get webstore search results in JSON format. The URL
34 // returns a JSON dictionary that has the search results (under "results").
35 // Each entry in the array is a dictionary as the data returned for
36 // GetWebstoreItemJsonDataURL above. |query| is the user typed query string.
37 // |hl| is the host language code, e.g. en_US. Both arguments will be escaped
38 // and added as a query parameter to the returned web store json search URL.
39 GURL GetWebstoreJsonSearchUrl(const std::string& query, 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. This may
45 // have been overridden by a command line flag for testing purposes.
46 GURL GetWebstoreUpdateUrl();
47
48 // This returns the compile-time constant webstore update url. Usually you
49 // should prefer using GetWebstoreUpdateUrl.
50 GURL GetDefaultWebstoreUpdateUrl(); 17 GURL GetDefaultWebstoreUpdateUrl();
51 18
52 // Returns whether the URL is the webstore update URL (just considering host
53 // and path, not scheme, query, etc.)
54 bool IsWebstoreUpdateUrl(const GURL& update_url);
55
56 // Returns true if the URL points to an extension blacklist.
57 bool IsBlacklistUpdateUrl(const GURL& url);
58 // The greatest common prefixes of the main extensions gallery's browse and
59 // download URLs.
60 extern const char kGalleryBrowsePrefix[];
61
62 // Field to use with webstore URL for tracking launch source. 19 // Field to use with webstore URL for tracking launch source.
63 extern const char kWebstoreSourceField[]; 20 extern const char kWebstoreSourceField[];
64 21
65 // Values to use with webstore URL launch source field. 22 // Values to use with webstore URL launch source field.
66 extern const char kLaunchSourceAppList[]; 23 extern const char kLaunchSourceAppList[];
67 extern const char kLaunchSourceAppListSearch[]; 24 extern const char kLaunchSourceAppListSearch[];
68 extern const char kLaunchSourceAppListInfoDialog[]; 25 extern const char kLaunchSourceAppListInfoDialog[];
69 26
70 } // namespace extension_urls 27 } // namespace extension_urls
71 28
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 LAUNCH_CONTAINER_PANEL, 282 LAUNCH_CONTAINER_PANEL,
326 LAUNCH_CONTAINER_TAB, 283 LAUNCH_CONTAINER_TAB,
327 // For platform apps, which don't actually have a container (they just get a 284 // For platform apps, which don't actually have a container (they just get a
328 // "onLaunched" event). 285 // "onLaunched" event).
329 LAUNCH_CONTAINER_NONE 286 LAUNCH_CONTAINER_NONE
330 }; 287 };
331 288
332 } // namespace extensions 289 } // namespace extensions
333 290
334 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_ 291 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/chrome_extensions_client.cc ('k') | chrome/common/extensions/extension_constants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698