| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/common/extensions/manifest_url_info.h" |
| 6 |
| 7 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 8 |
| 9 namespace keys = extension_manifest_keys; |
| 10 |
| 11 namespace extensions { |
| 12 |
| 13 // static |
| 14 const GURL& ManifestURLInfo::GetDevToolsPage(const Extension* extension) { |
| 15 ManifestURLInfo* info = static_cast<ManifestURLInfo*>( |
| 16 extension->GetManifestData(keys::kDevToolsPage)); |
| 17 |
| 18 if (info) |
| 19 return info->url_; |
| 20 return GURL::EmptyGURL(); |
| 21 } |
| 22 |
| 23 // static |
| 24 const GURL ManifestURLInfo::GetHomepageURL(const Extension* extension) { |
| 25 ManifestURLInfo* info = static_cast<ManifestURLInfo*>( |
| 26 extension->GetManifestData(keys::kHomepageURL)); |
| 27 |
| 28 if (info && info->url_.is_valid()) |
| 29 return info->url_; |
| 30 return extension->UpdatesFromGallery() ? |
| 31 GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + extension->id()) : |
| 32 GURL::EmptyGURL(); |
| 33 } |
| 34 |
| 35 } // namespace extensions |
| OLD | NEW |