OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 2320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2331 std::string Extension::ChromeStoreLaunchURL() { | 2331 std::string Extension::ChromeStoreLaunchURL() { |
2332 std::string gallery_prefix = extension_urls::kGalleryBrowsePrefix; | 2332 std::string gallery_prefix = extension_urls::kGalleryBrowsePrefix; |
2333 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppsGalleryURL)) | 2333 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppsGalleryURL)) |
2334 gallery_prefix = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 2334 gallery_prefix = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
2335 switches::kAppsGalleryURL); | 2335 switches::kAppsGalleryURL); |
2336 if (EndsWith(gallery_prefix, "/", true)) | 2336 if (EndsWith(gallery_prefix, "/", true)) |
2337 gallery_prefix = gallery_prefix.substr(0, gallery_prefix.length() - 1); | 2337 gallery_prefix = gallery_prefix.substr(0, gallery_prefix.length() - 1); |
2338 return gallery_prefix; | 2338 return gallery_prefix; |
2339 } | 2339 } |
2340 | 2340 |
| 2341 // static |
| 2342 std::string Extension::ChromeStoreItemDetailURLPrefix() { |
| 2343 return ChromeStoreLaunchURL() + "/detail/"; |
| 2344 } |
| 2345 |
2341 GURL Extension::GetHomepageURL() const { | 2346 GURL Extension::GetHomepageURL() const { |
2342 if (homepage_url_.is_valid()) | 2347 if (homepage_url_.is_valid()) |
2343 return homepage_url_; | 2348 return homepage_url_; |
2344 | 2349 |
2345 if (!UpdatesFromGallery()) | 2350 if (!UpdatesFromGallery()) |
2346 return GURL(); | 2351 return GURL(); |
2347 | 2352 |
2348 // TODO(erikkay): This may not be entirely correct with the webstore. | 2353 GURL url(ChromeStoreItemDetailURLPrefix() + id()); |
2349 // I think it will have a mixture of /extensions/detail and /webstore/detail | |
2350 // URLs. Perhaps they'll handle this nicely with redirects? | |
2351 GURL url(ChromeStoreLaunchURL() + std::string("/detail/") + id()); | |
2352 return url; | 2354 return url; |
2353 } | 2355 } |
2354 | 2356 |
2355 std::set<FilePath> Extension::GetBrowserImages() const { | 2357 std::set<FilePath> Extension::GetBrowserImages() const { |
2356 std::set<FilePath> image_paths; | 2358 std::set<FilePath> image_paths; |
2357 // TODO(viettrungluu): These |FilePath::FromWStringHack(UTF8ToWide())| | 2359 // TODO(viettrungluu): These |FilePath::FromWStringHack(UTF8ToWide())| |
2358 // indicate that we're doing something wrong. | 2360 // indicate that we're doing something wrong. |
2359 | 2361 |
2360 // Extension icons. | 2362 // Extension icons. |
2361 for (ExtensionIconSet::IconMap::const_iterator iter = icons().map().begin(); | 2363 for (ExtensionIconSet::IconMap::const_iterator iter = icons().map().begin(); |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2870 already_disabled(false), | 2872 already_disabled(false), |
2871 extension(extension) {} | 2873 extension(extension) {} |
2872 | 2874 |
2873 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 2875 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
2874 const Extension* extension, | 2876 const Extension* extension, |
2875 const ExtensionPermissionSet* permissions, | 2877 const ExtensionPermissionSet* permissions, |
2876 Reason reason) | 2878 Reason reason) |
2877 : reason(reason), | 2879 : reason(reason), |
2878 extension(extension), | 2880 extension(extension), |
2879 permissions(permissions) {} | 2881 permissions(permissions) {} |
OLD | NEW |