OLD | NEW |
1 // Copyright (c) 2011 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/extension_constants.h" | 5 #include "chrome/common/extensions/extension_constants.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 } | 451 } |
452 | 452 |
453 GURL GetWebstoreItemJsonDataURL(const std::string& extension_id) { | 453 GURL GetWebstoreItemJsonDataURL(const std::string& extension_id) { |
454 return GURL(GetWebstoreLaunchURL() + "/inlineinstall/detail/" + extension_id); | 454 return GURL(GetWebstoreLaunchURL() + "/inlineinstall/detail/" + extension_id); |
455 } | 455 } |
456 | 456 |
457 const char kGalleryUpdateHttpUrl[] = | 457 const char kGalleryUpdateHttpUrl[] = |
458 "http://clients2.google.com/service/update2/crx"; | 458 "http://clients2.google.com/service/update2/crx"; |
459 const char kGalleryUpdateHttpsUrl[] = | 459 const char kGalleryUpdateHttpsUrl[] = |
460 "https://clients2.google.com/service/update2/crx"; | 460 "https://clients2.google.com/service/update2/crx"; |
| 461 // TODO(battre): Delete the HTTP URL once the blacklist is downloaded via HTTPS. |
| 462 const char kExtensionBlocklistUrlPrefix[] = |
| 463 "http://www.gstatic.com/chrome/extensions/blacklist"; |
| 464 const char kExtensionBlocklistHttpsUrlPrefix[] = |
| 465 "https://www.gstatic.com/chrome/extensions/blacklist"; |
461 | 466 |
462 GURL GetWebstoreUpdateUrl(bool secure) { | 467 GURL GetWebstoreUpdateUrl(bool secure) { |
463 CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 468 CommandLine* cmdline = CommandLine::ForCurrentProcess(); |
464 if (cmdline->HasSwitch(switches::kAppsGalleryUpdateURL)) | 469 if (cmdline->HasSwitch(switches::kAppsGalleryUpdateURL)) |
465 return GURL(cmdline->GetSwitchValueASCII(switches::kAppsGalleryUpdateURL)); | 470 return GURL(cmdline->GetSwitchValueASCII(switches::kAppsGalleryUpdateURL)); |
466 else | 471 else |
467 return GURL(secure ? kGalleryUpdateHttpsUrl : kGalleryUpdateHttpUrl); | 472 return GURL(secure ? kGalleryUpdateHttpsUrl : kGalleryUpdateHttpUrl); |
468 } | 473 } |
469 | 474 |
470 bool IsWebstoreUpdateUrl(const GURL& update_url) { | 475 bool IsWebstoreUpdateUrl(const GURL& update_url) { |
471 return update_url == GetWebstoreUpdateUrl(false) || | 476 return update_url == GetWebstoreUpdateUrl(false) || |
472 update_url == GetWebstoreUpdateUrl(true); | 477 update_url == GetWebstoreUpdateUrl(true); |
473 } | 478 } |
474 | 479 |
| 480 bool IsBlacklistUpdateUrl(const GURL& url) { |
| 481 // The extension blacklist URL is returned from the update service and |
| 482 // therefore not determined by Chromium. If the location of the blacklist file |
| 483 // ever changes, we need to update this function. A DCHECK in the |
| 484 // ExtensionUpdater ensures that we notice a change. This is the full URL |
| 485 // of a blacklist: |
| 486 // http://www.gstatic.com/chrome/extensions/blacklist/l_0_0_0_7.txt |
| 487 return StartsWithASCII(url.spec(), kExtensionBlocklistUrlPrefix, true) || |
| 488 StartsWithASCII(url.spec(), kExtensionBlocklistHttpsUrlPrefix, true); |
| 489 } |
| 490 |
475 const char kGalleryBrowsePrefix[] = "https://chrome.google.com/webstore"; | 491 const char kGalleryBrowsePrefix[] = "https://chrome.google.com/webstore"; |
476 } | 492 } |
477 | 493 |
478 namespace extension_filenames { | 494 namespace extension_filenames { |
479 const char kTempExtensionName[] = "CRX_INSTALL"; | 495 const char kTempExtensionName[] = "CRX_INSTALL"; |
480 | 496 |
481 // The file to write our decoded images to, relative to the extension_path. | 497 // The file to write our decoded images to, relative to the extension_path. |
482 const char kDecodedImagesFilename[] = "DECODED_IMAGES"; | 498 const char kDecodedImagesFilename[] = "DECODED_IMAGES"; |
483 | 499 |
484 // The file to write our decoded message catalogs to, relative to the | 500 // The file to write our decoded message catalogs to, relative to the |
485 // extension_path. | 501 // extension_path. |
486 const char kDecodedMessageCatalogsFilename[] = "DECODED_MESSAGE_CATALOGS"; | 502 const char kDecodedMessageCatalogsFilename[] = "DECODED_MESSAGE_CATALOGS"; |
487 } | 503 } |
488 | 504 |
489 namespace extension_misc { | 505 namespace extension_misc { |
490 const char kBookmarkManagerId[] = "eemcgdkfndhakfknompkggombfjjjeno"; | 506 const char kBookmarkManagerId[] = "eemcgdkfndhakfknompkggombfjjjeno"; |
491 const char kWebStoreAppId[] = "ahfgeienlihckogmohjhadlkjgocpleb"; | 507 const char kWebStoreAppId[] = "ahfgeienlihckogmohjhadlkjgocpleb"; |
492 const char kCloudPrintAppId[] = "mfehgcgbbipciphmccgaenjidiccnmng"; | 508 const char kCloudPrintAppId[] = "mfehgcgbbipciphmccgaenjidiccnmng"; |
493 const char kAppsPromoHistogram[] = "Extensions.AppsPromo"; | 509 const char kAppsPromoHistogram[] = "Extensions.AppsPromo"; |
494 const char kAppLaunchHistogram[] = "Extensions.AppLaunch"; | 510 const char kAppLaunchHistogram[] = "Extensions.AppLaunch"; |
495 #if defined(OS_CHROMEOS) | 511 #if defined(OS_CHROMEOS) |
496 const char kAccessExtensionPath[] = | 512 const char kAccessExtensionPath[] = |
497 "/usr/share/chromeos-assets/accessibility/extensions"; | 513 "/usr/share/chromeos-assets/accessibility/extensions"; |
498 const char kChromeVoxDirectoryName[] = "access_chromevox"; | 514 const char kChromeVoxDirectoryName[] = "access_chromevox"; |
499 #endif | 515 #endif |
500 | 516 |
501 } | 517 } |
OLD | NEW |