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

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

Issue 10391130: Merge 136233 - Support CWS intents query URL (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1132/src/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
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 #include "chrome/common/extensions/extension_constants.h" 5 #include "chrome/common/extensions/extension_constants.h"
6 #include "chrome/common/extensions/extension_manifest_constants.h" 6 #include "chrome/common/extensions/extension_manifest_constants.h"
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "chrome/common/chrome_switches.h" 12 #include "chrome/common/chrome_switches.h"
13 #include "chrome/common/net/url_util.h"
13 14
14 namespace extension_urls { 15 namespace extension_urls {
15 std::string GetWebstoreLaunchURL() { 16 std::string GetWebstoreLaunchURL() {
16 std::string gallery_prefix = kGalleryBrowsePrefix; 17 std::string gallery_prefix = kGalleryBrowsePrefix;
17 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppsGalleryURL)) 18 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppsGalleryURL))
18 gallery_prefix = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 19 gallery_prefix = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
19 switches::kAppsGalleryURL); 20 switches::kAppsGalleryURL);
20 if (EndsWith(gallery_prefix, "/", true)) 21 if (EndsWith(gallery_prefix, "/", true))
21 gallery_prefix = gallery_prefix.substr(0, gallery_prefix.length() - 1); 22 gallery_prefix = gallery_prefix.substr(0, gallery_prefix.length() - 1);
22 return gallery_prefix; 23 return gallery_prefix;
23 } 24 }
24 25
25 std::string GetWebstoreItemDetailURLPrefix() { 26 std::string GetWebstoreItemDetailURLPrefix() {
26 return GetWebstoreLaunchURL() + "/detail/"; 27 return GetWebstoreLaunchURL() + "/detail/";
27 } 28 }
28 29
30 GURL GetWebstoreIntentQueryURL(const std::string& action,
31 const std::string& type) {
32 const char kIntentsCategoryPath[] = "category/collection/webintent_apps";
33
34 GURL url(std::string(kGalleryBrowsePrefix) + "/");
35 url = url.Resolve(kIntentsCategoryPath);
36 url = chrome_common_net::AppendQueryParameter(url, "_wi", action);
37 url = chrome_common_net::AppendQueryParameter(url, "_mt", type);
38
39 return url;
40 }
41
29 GURL GetWebstoreItemJsonDataURL(const std::string& extension_id) { 42 GURL GetWebstoreItemJsonDataURL(const std::string& extension_id) {
30 return GURL(GetWebstoreLaunchURL() + "/inlineinstall/detail/" + extension_id); 43 return GURL(GetWebstoreLaunchURL() + "/inlineinstall/detail/" + extension_id);
31 } 44 }
32 45
33 const char kGalleryUpdateHttpUrl[] = 46 const char kGalleryUpdateHttpUrl[] =
34 "http://clients2.google.com/service/update2/crx"; 47 "http://clients2.google.com/service/update2/crx";
35 const char kGalleryUpdateHttpsUrl[] = 48 const char kGalleryUpdateHttpsUrl[] =
36 "https://clients2.google.com/service/update2/crx"; 49 "https://clients2.google.com/service/update2/crx";
37 // TODO(battre): Delete the HTTP URL once the blacklist is downloaded via HTTPS. 50 // TODO(battre): Delete the HTTP URL once the blacklist is downloaded via HTTPS.
38 const char kExtensionBlocklistUrlPrefix[] = 51 const char kExtensionBlocklistUrlPrefix[] =
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 const char kAppStateInstalled[] = "installed"; 130 const char kAppStateInstalled[] = "installed";
118 const char kAppStateDisabled[] = "disabled"; 131 const char kAppStateDisabled[] = "disabled";
119 const char kAppStateRunning[] = "running"; 132 const char kAppStateRunning[] = "running";
120 const char kAppStateCannotRun[] = "cannot_run"; 133 const char kAppStateCannotRun[] = "cannot_run";
121 const char kAppStateReadyToRun[] = "ready_to_run"; 134 const char kAppStateReadyToRun[] = "ready_to_run";
122 135
123 const char kAppNotificationsIncognitoError[] = 136 const char kAppNotificationsIncognitoError[] =
124 "This API is not accessible by 'split' mode " 137 "This API is not accessible by 'split' mode "
125 "extensions in incognito windows."; 138 "extensions in incognito windows.";
126 } 139 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_constants.h ('k') | chrome/common/extensions/extension_constants_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698