| 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/chrome_content_client.h" | 5 #include "chrome/common/chrome_content_client.h" |
| 6 | 6 |
| 7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #endif // defined(OS_LINUX) | 9 #endif // defined(OS_LINUX) |
| 10 | 10 |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 flash_versions.push_back(system_flash.release()); | 499 flash_versions.push_back(system_flash.release()); |
| 500 | 500 |
| 501 // This function will return only the most recent version of the flash plugin. | 501 // This function will return only the most recent version of the flash plugin. |
| 502 content::PepperPluginInfo* max_flash = | 502 content::PepperPluginInfo* max_flash = |
| 503 FindMostRecentPlugin(flash_versions.get()); | 503 FindMostRecentPlugin(flash_versions.get()); |
| 504 if (max_flash) | 504 if (max_flash) |
| 505 plugins->push_back(*max_flash); | 505 plugins->push_back(*max_flash); |
| 506 #endif // defined(ENABLE_PLUGINS) | 506 #endif // defined(ENABLE_PLUGINS) |
| 507 } | 507 } |
| 508 | 508 |
| 509 #if defined(OS_CHROMEOS) |
| 510 static const int kNumChromeStandardURLSchemes = 6; |
| 511 #else |
| 512 static const int kNumChromeStandardURLSchemes = 5; |
| 513 #endif |
| 514 static const url::SchemeWithType kChromeStandardURLSchemes[ |
| 515 kNumChromeStandardURLSchemes] = { |
| 516 {extensions::kExtensionScheme, url::SCHEME_WITHOUT_PORT}, |
| 517 {chrome::kChromeNativeScheme, url::SCHEME_WITHOUT_PORT}, |
| 518 {extensions::kExtensionResourceScheme, url::SCHEME_WITHOUT_PORT}, |
| 519 {chrome::kChromeSearchScheme, url::SCHEME_WITHOUT_PORT}, |
| 520 {dom_distiller::kDomDistillerScheme, url::SCHEME_WITHOUT_PORT}, |
| 521 #if defined(OS_CHROMEOS) |
| 522 {chrome::kCrosScheme, url::SCHEME_WITHOUT_PORT}, |
| 523 #endif |
| 524 }; |
| 525 |
| 509 void ChromeContentClient::AddAdditionalSchemes( | 526 void ChromeContentClient::AddAdditionalSchemes( |
| 510 std::vector<std::string>* standard_schemes, | 527 std::vector<url::SchemeWithType>* standard_schemes, |
| 511 std::vector<std::string>* savable_schemes) { | 528 std::vector<std::string>* savable_schemes) { |
| 512 standard_schemes->push_back(extensions::kExtensionScheme); | 529 for (int i = 0; i < kNumChromeStandardURLSchemes; i++) |
| 530 standard_schemes->push_back(kChromeStandardURLSchemes[i]); |
| 531 |
| 513 savable_schemes->push_back(extensions::kExtensionScheme); | 532 savable_schemes->push_back(extensions::kExtensionScheme); |
| 514 standard_schemes->push_back(chrome::kChromeNativeScheme); | |
| 515 standard_schemes->push_back(extensions::kExtensionResourceScheme); | |
| 516 savable_schemes->push_back(extensions::kExtensionResourceScheme); | 533 savable_schemes->push_back(extensions::kExtensionResourceScheme); |
| 517 standard_schemes->push_back(chrome::kChromeSearchScheme); | |
| 518 savable_schemes->push_back(chrome::kChromeSearchScheme); | 534 savable_schemes->push_back(chrome::kChromeSearchScheme); |
| 519 standard_schemes->push_back(dom_distiller::kDomDistillerScheme); | |
| 520 savable_schemes->push_back(dom_distiller::kDomDistillerScheme); | 535 savable_schemes->push_back(dom_distiller::kDomDistillerScheme); |
| 521 #if defined(OS_CHROMEOS) | |
| 522 standard_schemes->push_back(chrome::kCrosScheme); | |
| 523 #endif | |
| 524 } | 536 } |
| 525 | 537 |
| 526 std::string ChromeContentClient::GetProduct() const { | 538 std::string ChromeContentClient::GetProduct() const { |
| 527 return ::GetProduct(); | 539 return ::GetProduct(); |
| 528 } | 540 } |
| 529 | 541 |
| 530 std::string ChromeContentClient::GetUserAgent() const { | 542 std::string ChromeContentClient::GetUserAgent() const { |
| 531 return ::GetUserAgent(); | 543 return ::GetUserAgent(); |
| 532 } | 544 } |
| 533 | 545 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 schemes->insert(content::kChromeUIScheme); | 599 schemes->insert(content::kChromeUIScheme); |
| 588 schemes->insert(extensions::kExtensionScheme); | 600 schemes->insert(extensions::kExtensionScheme); |
| 589 schemes->insert(extensions::kExtensionResourceScheme); | 601 schemes->insert(extensions::kExtensionResourceScheme); |
| 590 GetSecureOriginWhitelist(origins); | 602 GetSecureOriginWhitelist(origins); |
| 591 } | 603 } |
| 592 | 604 |
| 593 void ChromeContentClient::AddServiceWorkerSchemes( | 605 void ChromeContentClient::AddServiceWorkerSchemes( |
| 594 std::set<std::string>* schemes) { | 606 std::set<std::string>* schemes) { |
| 595 schemes->insert(extensions::kExtensionScheme); | 607 schemes->insert(extensions::kExtensionScheme); |
| 596 } | 608 } |
| OLD | NEW |