コード例 #1
0
bool nsDefaultURIFixup::IsDomainWhitelisted(const nsAutoCString aAsciiHost,
                                            const uint32_t aDotLoc)
{
    if (sDNSFirstForSingleWords) {
        return true;
    }
    // Check if this domain is whitelisted as an actual
    // domain (which will prevent a keyword query)
    // NB: any processing of the host here should stay in sync with
    // code in the front-end(s) that set the pref.

    nsAutoCString pref("browser.fixup.domainwhitelist.");

    if (aDotLoc == aAsciiHost.Length() - 1) {
      pref.Append(Substring(aAsciiHost, 0, aAsciiHost.Length() - 1));
    } else {
      pref.Append(aAsciiHost);
    }

    return Preferences::GetBool(pref.get(), false);
}
コード例 #2
0
//-------------------------------------------------------------------------
void nsFilePicker::GetFileSystemCharset(nsCString & fileSystemCharset)
{
  static nsAutoCString aCharset;
  nsresult rv;

  if (aCharset.Length() < 1) {
    nsCOMPtr <nsIPlatformCharset> platformCharset = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv);
    if (NS_SUCCEEDED(rv))
     rv = platformCharset->GetCharset(kPlatformCharsetSel_FileName, aCharset);

    NS_ASSERTION(NS_SUCCEEDED(rv), "error getting platform charset");
    if (NS_FAILED(rv))
      aCharset.AssignLiteral("IBM850");
  }
  fileSystemCharset = aCharset;
}
コード例 #3
0
ファイル: TestUConv.cpp プロジェクト: Andrel322/gecko-dev
void nsTestLog::DelTrace(const char * aTrace)
{
  mTrace.Truncate(mTrace.Length() - strlen(aTrace) - strlen(kTraceDelimiter));
}