summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/history')
-rw-r--r--chrome/browser/history/history_backend.cc5
-rw-r--r--chrome/browser/history/history_types.cc7
-rw-r--r--chrome/browser/history/history_types.h8
3 files changed, 18 insertions, 2 deletions
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index 327896b..0588170 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -1433,6 +1433,11 @@ void HistoryBackend::QueryHistoryBasic(URLDatabase* url_db,
url_result.set_visit_time(visit.visit_time);
+ // Set whether the visit was blocked for a managed user by looking at the
+ // transition type.
+ url_result.set_blocked_visit(
+ (visit.transition & content::PAGE_TRANSITION_BLOCKED) != 0);
+
// We don't set any of the query-specific parts of the URLResult, since
// snippets and stuff don't apply to basic querying.
result->AppendURLBySwapping(&url_result);
diff --git a/chrome/browser/history/history_types.cc b/chrome/browser/history/history_types.cc
index fe56fc3..524bdc2 100644
--- a/chrome/browser/history/history_types.cc
+++ b/chrome/browser/history/history_types.cc
@@ -92,12 +92,14 @@ VisitRow::~VisitRow() {
// URLResult -------------------------------------------------------------------
-URLResult::URLResult() {
+URLResult::URLResult()
+ : blocked_visit_(false) {
}
URLResult::URLResult(const GURL& url, base::Time visit_time)
: URLRow(url),
- visit_time_(visit_time) {
+ visit_time_(visit_time),
+ blocked_visit_(false) {
}
URLResult::URLResult(const GURL& url,
@@ -114,6 +116,7 @@ void URLResult::SwapResult(URLResult* other) {
std::swap(visit_time_, other->visit_time_);
snippet_.Swap(&other->snippet_);
title_match_positions_.swap(other->title_match_positions_);
+ std::swap(blocked_visit_, other->blocked_visit_);
}
// QueryResults ----------------------------------------------------------------
diff --git a/chrome/browser/history/history_types.h b/chrome/browser/history/history_types.h
index fec66a4..a78a8bc 100644
--- a/chrome/browser/history/history_types.h
+++ b/chrome/browser/history/history_types.h
@@ -301,6 +301,11 @@ class URLResult : public URLRow {
const Snippet& snippet() const { return snippet_; }
+ bool blocked_visit() const { return blocked_visit_; }
+ void set_blocked_visit(bool blocked_visit) {
+ blocked_visit_ = blocked_visit;
+ }
+
// If this is a title match, title_match_positions contains an entry for
// every word in the title that matched one of the query parameters. Each
// entry contains the start and end of the match.
@@ -320,6 +325,9 @@ class URLResult : public URLRow {
Snippet snippet_;
Snippet::MatchPositions title_match_positions_;
+ // Whether a managed user was blocked when attempting to visit this URL.
+ bool blocked_visit_;
+
// We support the implicit copy constructor and operator=.
};