protocol: api to register custom schemes to standard schemes

This commit is contained in:
deepak1556 2015-06-12 13:28:23 +05:30
parent ad59393641
commit 663a48ee38
8 changed files with 47 additions and 0 deletions

View file

@ -75,6 +75,16 @@ std::string AtomContentClient::GetProduct() const {
void AtomContentClient::AddAdditionalSchemes(
std::vector<std::string>* standard_schemes,
std::vector<std::string>* savable_schemes) {
auto command_line = base::CommandLine::ForCurrentProcess();
auto custom_schemes = command_line->GetSwitchValueASCII(
switches::kRegisterStandardSchemes);
if (!custom_schemes.empty()) {
std::vector<std::string> schemes;
base::SplitString(custom_schemes, ',', &schemes);
standard_schemes->insert(standard_schemes->end(),
schemes.begin(),
schemes.end());
}
standard_schemes->push_back("chrome-extension");
}