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

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

Issue 11624036: Move the parsing of homepage_url" and "devtools_page" out of Extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments addressed Created 8 years 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
Index: chrome/common/extensions/manifest_url_info.cc
diff --git a/chrome/common/extensions/manifest_url_info.cc b/chrome/common/extensions/manifest_url_info.cc
new file mode 100644
index 0000000000000000000000000000000000000000..956f7b57a76a8da9e0f62bb56eac314b7803e43a
--- /dev/null
+++ b/chrome/common/extensions/manifest_url_info.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/extensions/manifest_url_info.h"
+
+#include "chrome/common/extensions/extension_manifest_constants.h"
+
+namespace keys = extension_manifest_keys;
+
+namespace extensions {
+
+// static
+const GURL& ManifestURLInfo::GetDevToolsPage(const Extension* extension) {
+ ManifestURLInfo* info = static_cast<ManifestURLInfo*>(
+ extension->GetManifestData(keys::kDevToolsPage));
+
+ if (info)
+ return info->url_;
+ return GURL::EmptyGURL();
+}
+
+// static
+const GURL ManifestURLInfo::GetHomepageURL(const Extension* extension) {
+ ManifestURLInfo* info = static_cast<ManifestURLInfo*>(
+ extension->GetManifestData(keys::kHomepageURL));
+
+ if (info && info->url_.is_valid())
+ return info->url_;
+ return extension->UpdatesFromGallery() ?
+ GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + extension->id()) :
+ GURL::EmptyGURL();
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698