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

Side by Side Diff: chrome/common/extensions/manifest_url_handler.cc

Issue 16283002: Move Extension::UpdatesFromGallery to ManifestURL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/manifest_url_handler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/file_util.h" 7 #include "base/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/string_util.h" 10 #include "base/string_util.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // static 48 // static
49 const GURL& ManifestURL::GetDevToolsPage(const Extension* extension) { 49 const GURL& ManifestURL::GetDevToolsPage(const Extension* extension) {
50 return GetManifestURL(extension, keys::kDevToolsPage); 50 return GetManifestURL(extension, keys::kDevToolsPage);
51 } 51 }
52 52
53 // static 53 // static
54 const GURL ManifestURL::GetHomepageURL(const Extension* extension) { 54 const GURL ManifestURL::GetHomepageURL(const Extension* extension) {
55 const GURL& homepage_url = GetManifestURL(extension, keys::kHomepageURL); 55 const GURL& homepage_url = GetManifestURL(extension, keys::kHomepageURL);
56 if (homepage_url.is_valid()) 56 if (homepage_url.is_valid())
57 return homepage_url; 57 return homepage_url;
58 return extension->UpdatesFromGallery() ? 58 return UpdatesFromGallery(extension) ?
59 GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + extension->id()) : 59 GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + extension->id()) :
60 GURL::EmptyGURL(); 60 GURL::EmptyGURL();
61 } 61 }
62 62
63 // static 63 // static
64 const GURL& ManifestURL::GetUpdateURL(const Extension* extension) { 64 const GURL& ManifestURL::GetUpdateURL(const Extension* extension) {
65 return GetManifestURL(extension, keys::kUpdateURL); 65 return GetManifestURL(extension, keys::kUpdateURL);
66 } 66 }
67 67
68 // static 68 // static
69 bool ManifestURL::UpdatesFromGallery(const Extension* extension) {
70 return extension_urls::IsWebstoreUpdateUrl(GetUpdateURL(extension));
71 }
72
73 // static
69 const GURL& ManifestURL::GetOptionsPage(const Extension* extension) { 74 const GURL& ManifestURL::GetOptionsPage(const Extension* extension) {
70 return GetManifestURL(extension, keys::kOptionsPage); 75 return GetManifestURL(extension, keys::kOptionsPage);
71 } 76 }
72 77
73 // static 78 // static
74 const GURL ManifestURL::GetDetailsURL(const Extension* extension) { 79 const GURL ManifestURL::GetDetailsURL(const Extension* extension) {
75 return extension->from_webstore() ? 80 return extension->from_webstore() ?
76 GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + extension->id()) : 81 GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + extension->id()) :
77 GURL::EmptyGURL(); 82 GURL::EmptyGURL();
78 } 83 }
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 extension->SetManifestData(keys::kChromeURLOverrides, 321 extension->SetManifestData(keys::kChromeURLOverrides,
317 url_overrides.release()); 322 url_overrides.release());
318 return true; 323 return true;
319 } 324 }
320 325
321 const std::vector<std::string> URLOverridesHandler::Keys() const { 326 const std::vector<std::string> URLOverridesHandler::Keys() const {
322 return SingleKey(keys::kChromeURLOverrides); 327 return SingleKey(keys::kChromeURLOverrides);
323 } 328 }
324 329
325 } // namespace extensions 330 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/manifest_url_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698