| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_feature_extractor.h" | 5 #include "chrome/browser/safe_browsing/browser_feature_extractor.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/format_macros.h" | 12 #include "base/format_macros.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "chrome/browser/cancelable_request.h" | 16 #include "chrome/browser/cancelable_request.h" |
| 17 #include "chrome/browser/history/history.h" | 17 #include "chrome/browser/history/history.h" |
| 18 #include "chrome/browser/history/history_service_factory.h" |
| 18 #include "chrome/browser/history/history_types.h" | 19 #include "chrome/browser/history/history_types.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/safe_browsing/browser_features.h" | 21 #include "chrome/browser/safe_browsing/browser_features.h" |
| 21 #include "chrome/browser/safe_browsing/client_side_detection_service.h" | 22 #include "chrome/browser/safe_browsing/client_side_detection_service.h" |
| 22 #include "chrome/common/safe_browsing/csd.pb.h" | 23 #include "chrome/common/safe_browsing/csd.pb.h" |
| 23 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
| 24 #include "content/public/browser/navigation_controller.h" | 25 #include "content/public/browser/navigation_controller.h" |
| 25 #include "content/public/browser/navigation_entry.h" | 26 #include "content/public/browser/navigation_entry.h" |
| 26 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
| 27 #include "content/public/common/page_transition_types.h" | 28 #include "content/public/common/page_transition_types.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 pending_queries_.erase(it); | 434 pending_queries_.erase(it); |
| 434 return true; | 435 return true; |
| 435 } | 436 } |
| 436 return false; | 437 return false; |
| 437 } | 438 } |
| 438 | 439 |
| 439 bool BrowserFeatureExtractor::GetHistoryService(HistoryService** history) { | 440 bool BrowserFeatureExtractor::GetHistoryService(HistoryService** history) { |
| 440 *history = NULL; | 441 *history = NULL; |
| 441 if (tab_ && tab_->GetBrowserContext()) { | 442 if (tab_ && tab_->GetBrowserContext()) { |
| 442 Profile* profile = Profile::FromBrowserContext(tab_->GetBrowserContext()); | 443 Profile* profile = Profile::FromBrowserContext(tab_->GetBrowserContext()); |
| 443 *history = profile->GetHistoryService(Profile::EXPLICIT_ACCESS); | 444 *history = HistoryServiceFactory::GetForProfile(profile, |
| 445 Profile::EXPLICIT_ACCESS); |
| 444 if (*history) { | 446 if (*history) { |
| 445 return true; | 447 return true; |
| 446 } | 448 } |
| 447 } | 449 } |
| 448 VLOG(2) << "Unable to query history. No history service available."; | 450 VLOG(2) << "Unable to query history. No history service available."; |
| 449 return false; | 451 return false; |
| 450 } | 452 } |
| 451 | 453 |
| 452 } // namespace safe_browsing | 454 } // namespace safe_browsing |
| OLD | NEW |