summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history
diff options
context:
space:
mode:
authorsergiu@chromium.org <sergiu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-24 11:42:13 +0000
committersergiu@chromium.org <sergiu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-24 11:42:13 +0000
commite8348350d4520eb0c4744fd8403ca9efadd4d3f8 (patch)
tree7f1998cd8d667cdc130b02f34e4c0ac9af82ff6e /chrome/browser/history
parentc28c952d93d25cadb3ba338a219231ab177748cf (diff)
downloadchromium_src-e8348350d4520eb0c4744fd8403ca9efadd4d3f8.zip
chromium_src-e8348350d4520eb0c4744fd8403ca9efadd4d3f8.tar.gz
chromium_src-e8348350d4520eb0c4744fd8403ca9efadd4d3f8.tar.bz2
Add visit attempts when the managed user is blocked
Added a new transition type for blocked visits and added a history visit when the managed user triggers the interstitial. Also refactored the place where we trigger the interstitial. R=bauerb@chromium.org, dubroy@chromium.org, brettw@chromium.org, jhawkins@chromium.org, joi@chromium.org BUG=228778 Review URL: https://chromiumcodereview.appspot.com/14320018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196120 0039d316-1c4b-4281-b951-d872f2087c98
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=.
};