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/browser/safe_browsing/download_protection_service.h" | 5 #include "chrome/browser/safe_browsing/download_protection_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 void DownloadProtectionService::ShowDetailsForDownload( | 986 void DownloadProtectionService::ShowDetailsForDownload( |
987 const content::DownloadItem& item, | 987 const content::DownloadItem& item, |
988 content::PageNavigator* navigator) { | 988 content::PageNavigator* navigator) { |
989 GURL learn_more_url(chrome::kDownloadScanningLearnMoreURL); | 989 GURL learn_more_url(chrome::kDownloadScanningLearnMoreURL); |
990 learn_more_url = google_util::AppendGoogleLocaleParam( | 990 learn_more_url = google_util::AppendGoogleLocaleParam( |
991 learn_more_url, g_browser_process->GetApplicationLocale()); | 991 learn_more_url, g_browser_process->GetApplicationLocale()); |
992 navigator->OpenURL( | 992 navigator->OpenURL( |
993 content::OpenURLParams(learn_more_url, | 993 content::OpenURLParams(learn_more_url, |
994 content::Referrer(), | 994 content::Referrer(), |
995 NEW_FOREGROUND_TAB, | 995 NEW_FOREGROUND_TAB, |
996 content::PAGE_TRANSITION_LINK, | 996 ui::PAGE_TRANSITION_LINK, |
997 false)); | 997 false)); |
998 } | 998 } |
999 | 999 |
1000 namespace { | 1000 namespace { |
1001 // Escapes a certificate attribute so that it can be used in a whitelist | 1001 // Escapes a certificate attribute so that it can be used in a whitelist |
1002 // entry. Currently, we only escape slashes, since they are used as a | 1002 // entry. Currently, we only escape slashes, since they are used as a |
1003 // separator between attributes. | 1003 // separator between attributes. |
1004 std::string EscapeCertAttribute(const std::string& attribute) { | 1004 std::string EscapeCertAttribute(const std::string& attribute) { |
1005 std::string escaped; | 1005 std::string escaped; |
1006 for (size_t i = 0; i < attribute.size(); ++i) { | 1006 for (size_t i = 0; i < attribute.size(); ++i) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 GURL DownloadProtectionService::GetDownloadRequestUrl() { | 1076 GURL DownloadProtectionService::GetDownloadRequestUrl() { |
1077 GURL url(kDownloadRequestUrl); | 1077 GURL url(kDownloadRequestUrl); |
1078 std::string api_key = google_apis::GetAPIKey(); | 1078 std::string api_key = google_apis::GetAPIKey(); |
1079 if (!api_key.empty()) | 1079 if (!api_key.empty()) |
1080 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true)); | 1080 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true)); |
1081 | 1081 |
1082 return url; | 1082 return url; |
1083 } | 1083 } |
1084 | 1084 |
1085 } // namespace safe_browsing | 1085 } // namespace safe_browsing |
OLD | NEW |