| Index: chrome/browser/safe_browsing/ui_manager.cc
|
| diff --git a/chrome/browser/safe_browsing/ui_manager.cc b/chrome/browser/safe_browsing/ui_manager.cc
|
| index 9baab76fa01dc728b10e585880041f334733440f..38d513c7b3963a1dd419718cd6d72796c7a41a08 100644
|
| --- a/chrome/browser/safe_browsing/ui_manager.cc
|
| +++ b/chrome/browser/safe_browsing/ui_manager.cc
|
| @@ -10,6 +10,8 @@
|
| #include "base/metrics/histogram_macros.h"
|
| #include "base/threading/thread.h"
|
| #include "base/threading/thread_restrictions.h"
|
| +#include "chrome/browser/browser_process.h"
|
| +#include "chrome/browser/history/history_service_factory.h"
|
| #include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/safe_browsing/ping_manager.h"
|
| @@ -18,6 +20,7 @@
|
| #include "chrome/browser/safe_browsing/threat_details.h"
|
| #include "chrome/browser/tab_contents/tab_util.h"
|
| #include "chrome/common/pref_names.h"
|
| +#include "chrome/common/url_constants.h"
|
| #include "components/prefs/pref_service.h"
|
| #include "components/safe_browsing_db/metadata.pb.h"
|
| #include "components/safe_browsing_db/safe_browsing_prefs.h"
|
| @@ -38,23 +41,6 @@ using content::WebContents;
|
| using safe_browsing::HitReport;
|
| using safe_browsing::SBThreatType;
|
|
|
| -namespace {
|
| -
|
| -// Returns the URL that should be used in a WhitelistUrlSet for the given
|
| -// |resource|.
|
| -GURL GetMainFrameWhitelistUrlForResource(
|
| - const security_interstitials::UnsafeResource& resource) {
|
| - if (resource.is_subresource) {
|
| - NavigationEntry* entry = resource.GetNavigationEntryForResource();
|
| - if (!entry)
|
| - return GURL();
|
| - return entry->GetURL().GetWithEmptyPath();
|
| - }
|
| - return resource.url.GetWithEmptyPath();
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| namespace safe_browsing {
|
|
|
| SafeBrowsingUIManager::SafeBrowsingUIManager(
|
| @@ -70,9 +56,9 @@ void SafeBrowsingUIManager::StopOnIOThread(bool shutdown) {
|
| sb_service_ = NULL;
|
| }
|
|
|
| -void SafeBrowsingUIManager::LogPauseDelay(base::TimeDelta time) {
|
| +/*void SafeBrowsingUIManager::LogPauseDelay(base::TimeDelta time) {
|
| UMA_HISTOGRAM_LONG_TIMES("SB2.Delay", time);
|
| -}
|
| +}*/
|
|
|
| void SafeBrowsingUIManager::DisplayBlockingPage(
|
| const UnsafeResource& resource) {
|
| @@ -215,6 +201,31 @@ void SafeBrowsingUIManager::CreateWhitelistForTesting(
|
| EnsureWhitelistCreated(web_contents);
|
| }
|
|
|
| +void SafeBrowsingUIManager::AddObserver(Observer* observer) {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| + observer_list_.AddObserver(observer);
|
| +}
|
| +
|
| +void SafeBrowsingUIManager::RemoveObserver(Observer* observer) {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| + observer_list_.RemoveObserver(observer);
|
| +}
|
| +
|
| +const std::string SafeBrowsingUIManager::app_locale() {
|
| + return g_browser_process->GetApplicationLocale();
|
| +}
|
| +
|
| +history::HistoryService* SafeBrowsingUIManager::history_service(
|
| + content::WebContents* web_contents) {
|
| + return HistoryServiceFactory::GetForProfile(
|
| + Profile::FromBrowserContext(web_contents->GetBrowserContext()),
|
| + ServiceAccessType::EXPLICIT_ACCESS);
|
| +}
|
| +
|
| +const GURL SafeBrowsingUIManager::default_safe_page() {
|
| + return GURL(chrome::kChromeUINewTabURL);
|
| +}
|
| +
|
| void SafeBrowsingUIManager::ReportPermissionActionOnIOThread(
|
| const PermissionReportInfo& report_info) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
|
|