OLD | NEW |
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/manifest_url_handler.h" | 5 #include "chrome/common/extensions/manifest_url_handler.h" |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 return homepage_url; | 59 return homepage_url; |
60 bool use_webstore_url = UpdatesFromGallery(extension) && | 60 bool use_webstore_url = UpdatesFromGallery(extension) && |
61 !SharedModuleInfo::IsSharedModule(extension); | 61 !SharedModuleInfo::IsSharedModule(extension); |
62 return use_webstore_url | 62 return use_webstore_url |
63 ? GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + | 63 ? GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + |
64 extension->id()) | 64 extension->id()) |
65 : GURL::EmptyGURL(); | 65 : GURL::EmptyGURL(); |
66 } | 66 } |
67 | 67 |
68 // static | 68 // static |
| 69 bool ManifestURL::SpecifiedHomepageURL(const Extension* extension) { |
| 70 return GetManifestURL(extension, keys::kHomepageURL).is_valid(); |
| 71 } |
| 72 |
| 73 // static |
69 const GURL& ManifestURL::GetUpdateURL(const Extension* extension) { | 74 const GURL& ManifestURL::GetUpdateURL(const Extension* extension) { |
70 return GetManifestURL(extension, keys::kUpdateURL); | 75 return GetManifestURL(extension, keys::kUpdateURL); |
71 } | 76 } |
72 | 77 |
73 // static | 78 // static |
74 bool ManifestURL::UpdatesFromGallery(const Extension* extension) { | 79 bool ManifestURL::UpdatesFromGallery(const Extension* extension) { |
75 return extension_urls::IsWebstoreUpdateUrl(GetUpdateURL(extension)); | 80 return extension_urls::IsWebstoreUpdateUrl(GetUpdateURL(extension)); |
76 } | 81 } |
77 | 82 |
78 // static | 83 // static |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 extension->SetManifestData(keys::kChromeURLOverrides, | 389 extension->SetManifestData(keys::kChromeURLOverrides, |
385 url_overrides.release()); | 390 url_overrides.release()); |
386 return true; | 391 return true; |
387 } | 392 } |
388 | 393 |
389 const std::vector<std::string> URLOverridesHandler::Keys() const { | 394 const std::vector<std::string> URLOverridesHandler::Keys() const { |
390 return SingleKey(keys::kChromeURLOverrides); | 395 return SingleKey(keys::kChromeURLOverrides); |
391 } | 396 } |
392 | 397 |
393 } // namespace extensions | 398 } // namespace extensions |
OLD | NEW |