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

Unified Diff: chrome/common/extensions/extension.cc

Issue 7621032: Initial inline web store install bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback. Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 1b623538d0ce3e7064f8213bb0938268844e8943..f498c879b9db398c505159afad3b316a50c2c9a5 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -2327,17 +2327,6 @@ bool Extension::InitFromValue(const DictionaryValue& source, int flags,
return true;
}
-// static
-std::string Extension::ChromeStoreLaunchURL() {
- std::string gallery_prefix = extension_urls::kGalleryBrowsePrefix;
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppsGalleryURL))
- gallery_prefix = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kAppsGalleryURL);
- if (EndsWith(gallery_prefix, "/", true))
- gallery_prefix = gallery_prefix.substr(0, gallery_prefix.length() - 1);
- return gallery_prefix;
-}
-
GURL Extension::GetHomepageURL() const {
if (homepage_url_.is_valid())
return homepage_url_;
@@ -2345,10 +2334,7 @@ GURL Extension::GetHomepageURL() const {
if (!UpdatesFromGallery())
return GURL();
- // TODO(erikkay): This may not be entirely correct with the webstore.
- // I think it will have a mixture of /extensions/detail and /webstore/detail
- // URLs. Perhaps they'll handle this nicely with redirects?
- GURL url(ChromeStoreLaunchURL() + std::string("/detail/") + id());
+ GURL url(extension_misc::GetWebstoreItemDetailURLPrefix() + id());
return url;
}
@@ -2719,7 +2705,8 @@ bool Extension::CanExecuteScriptOnPage(const GURL& page_url,
// like extensions removing the "report abuse" link).
// TODO(erikkay): This seems like the wrong test. Shouldn't we we testing
// against the store app extent?
- if ((page_url.host() == GURL(Extension::ChromeStoreLaunchURL()).host()) &&
+ GURL store_url(extension_misc::GetWebstoreLaunchURL());
+ if ((page_url.host() == store_url.host()) &&
!CanExecuteScriptEverywhere() &&
!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAllowScriptingGallery)) {
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698