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

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

Issue 31008: Coalesce more hardcoded schemes to using predefined constants. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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/browser/extensions/extension.h ('k') | chrome/browser/extensions/extension_protocols.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension.cc
===================================================================
--- chrome/browser/extensions/extension.cc (revision 10345)
+++ chrome/browser/extensions/extension.cc (working copy)
@@ -9,10 +9,8 @@
#include "base/string_util.h"
#include "net/base/net_util.h"
#include "chrome/common/extensions/user_script.h"
+#include "chrome/common/url_constants.h"
-const char kExtensionURLScheme[] = "chrome-extension";
-const char kUserScriptURLScheme[] = "chrome-user-script";
-
const char Extension::kManifestFilename[] = "manifest.json";
const wchar_t* Extension::kContentScriptsKey = L"content_scripts";
@@ -75,13 +73,10 @@
return version_->GetString();
}
-// Defined in extension_protocols.h.
-extern const char kExtensionURLScheme[];
-
// static
GURL Extension::GetResourceURL(const GURL& extension_url,
const std::string& relative_path) {
- DCHECK(extension_url.SchemeIs(kExtensionURLScheme));
+ DCHECK(extension_url.SchemeIs(chrome::kExtensionScheme));
DCHECK(extension_url.path() == "/");
GURL ret_val = GURL(extension_url.spec() + relative_path);
@@ -195,7 +190,8 @@
}
// Initialize URL.
- extension_url_ = GURL(std::string(kExtensionURLScheme) + "://" + id_ + "/");
+ extension_url_ = GURL(std::string(chrome::kExtensionScheme) +
+ chrome::kStandardSchemeSeparator + id_ + "/");
// Initialize version.
std::string version_str;
« no previous file with comments | « chrome/browser/extensions/extension.h ('k') | chrome/browser/extensions/extension_protocols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698