summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/history')
-rw-r--r--chrome/browser/history/android/android_provider_backend.cc1
-rw-r--r--chrome/browser/history/android/android_provider_backend_unittest.cc36
-rw-r--r--chrome/browser/history/android/visit_sql_handler.cc6
-rw-r--r--chrome/browser/history/expire_history_backend.cc14
-rw-r--r--chrome/browser/history/expire_history_backend_unittest.cc10
-rw-r--r--chrome/browser/history/history_backend.cc98
-rw-r--r--chrome/browser/history/history_backend.h4
-rw-r--r--chrome/browser/history/history_backend_unittest.cc100
-rw-r--r--chrome/browser/history/history_notifications.cc2
-rw-r--r--chrome/browser/history/history_notifications.h2
-rw-r--r--chrome/browser/history/history_querying_unittest.cc2
-rw-r--r--chrome/browser/history/history_service.cc4
-rw-r--r--chrome/browser/history/history_service.h4
-rw-r--r--chrome/browser/history/history_tab_helper.cc2
-rw-r--r--chrome/browser/history/history_types.cc8
-rw-r--r--chrome/browser/history/history_types.h16
-rw-r--r--chrome/browser/history/history_unittest.cc86
-rw-r--r--chrome/browser/history/in_memory_url_index_cache.proto2
-rw-r--r--chrome/browser/history/scored_history_match.cc2
-rw-r--r--chrome/browser/history/scored_history_match_unittest.cc14
-rw-r--r--chrome/browser/history/shortcuts_database.cc4
-rw-r--r--chrome/browser/history/shortcuts_database_unittest.cc15
-rw-r--r--chrome/browser/history/top_sites_impl_unittest.cc6
-rw-r--r--chrome/browser/history/typed_url_syncable_service.cc32
-rw-r--r--chrome/browser/history/typed_url_syncable_service.h6
-rw-r--r--chrome/browser/history/typed_url_syncable_service_unittest.cc44
-rw-r--r--chrome/browser/history/url_index_private_data.cc3
-rw-r--r--chrome/browser/history/visit_database.cc50
-rw-r--r--chrome/browser/history/visit_database.h2
-rw-r--r--chrome/browser/history/visit_database_unittest.cc66
30 files changed, 319 insertions, 322 deletions
diff --git a/chrome/browser/history/android/android_provider_backend.cc b/chrome/browser/history/android/android_provider_backend.cc
index 7fc745b..bfb9019 100644
--- a/chrome/browser/history/android/android_provider_backend.cc
+++ b/chrome/browser/history/android/android_provider_backend.cc
@@ -17,7 +17,6 @@
#include "chrome/browser/history/thumbnail_database.h"
#include "components/history/core/browser/history_client.h"
#include "components/history/core/browser/keyword_search_term.h"
-#include "content/public/common/page_transition_types.h"
#include "sql/connection.h"
diff --git a/chrome/browser/history/android/android_provider_backend_unittest.cc b/chrome/browser/history/android/android_provider_backend_unittest.cc
index e1c8d76..efc8ecc 100644
--- a/chrome/browser/history/android/android_provider_backend_unittest.cc
+++ b/chrome/browser/history/android/android_provider_backend_unittest.cc
@@ -224,20 +224,20 @@ TEST_F(AndroidProviderBackendTest, UpdateTables) {
std::vector<VisitInfo> visits1;
Time last_visited1 = Time::Now() - TimeDelta::FromDays(1);
Time created1 = last_visited1 - TimeDelta::FromDays(20);
- visits1.push_back(VisitInfo(created1, content::PAGE_TRANSITION_LINK));
+ visits1.push_back(VisitInfo(created1, ui::PAGE_TRANSITION_LINK));
visits1.push_back(VisitInfo(last_visited1 - TimeDelta::FromDays(1),
- content::PAGE_TRANSITION_LINK));
- visits1.push_back(VisitInfo(last_visited1, content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
+ visits1.push_back(VisitInfo(last_visited1, ui::PAGE_TRANSITION_LINK));
GURL url2("http://www.example.com");
URLID url_id2 = 0;
std::vector<VisitInfo> visits2;
Time last_visited2 = Time::Now();
Time created2 = last_visited2 - TimeDelta::FromDays(10);
- visits2.push_back(VisitInfo(created2, content::PAGE_TRANSITION_LINK));
+ visits2.push_back(VisitInfo(created2, ui::PAGE_TRANSITION_LINK));
visits2.push_back(VisitInfo(last_visited2 - TimeDelta::FromDays(5),
- content::PAGE_TRANSITION_LINK));
- visits2.push_back(VisitInfo(last_visited2, content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
+ visits2.push_back(VisitInfo(last_visited2, ui::PAGE_TRANSITION_LINK));
// Add a bookmark which is not in the history.
GURL url3("http://www.bookmark.com");
@@ -366,20 +366,20 @@ TEST_F(AndroidProviderBackendTest, QueryHistoryAndBookmarks) {
std::vector<VisitInfo> visits1;
Time last_visited1 = Time::Now() - TimeDelta::FromDays(1);
Time created1 = last_visited1 - TimeDelta::FromDays(20);
- visits1.push_back(VisitInfo(created1, content::PAGE_TRANSITION_LINK));
+ visits1.push_back(VisitInfo(created1, ui::PAGE_TRANSITION_LINK));
visits1.push_back(VisitInfo(last_visited1 - TimeDelta::FromDays(1),
- content::PAGE_TRANSITION_LINK));
- visits1.push_back(VisitInfo(last_visited1, content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
+ visits1.push_back(VisitInfo(last_visited1, ui::PAGE_TRANSITION_LINK));
GURL url2("http://www.example.com");
std::vector<VisitInfo> visits2;
const base::string16 title2(UTF8ToUTF16("example"));
Time last_visited2 = Time::Now();
Time created2 = last_visited2 - TimeDelta::FromDays(10);
- visits2.push_back(VisitInfo(created2, content::PAGE_TRANSITION_LINK));
+ visits2.push_back(VisitInfo(created2, ui::PAGE_TRANSITION_LINK));
visits2.push_back(VisitInfo(last_visited2 - TimeDelta::FromDays(5),
- content::PAGE_TRANSITION_LINK));
- visits2.push_back(VisitInfo(last_visited2, content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
+ visits2.push_back(VisitInfo(last_visited2, ui::PAGE_TRANSITION_LINK));
// Only use the HistoryBackend to generate the test data.
// HistoryBackend will shutdown after that.
@@ -1802,20 +1802,20 @@ TEST_F(AndroidProviderBackendTest, QueryWithoutThumbnailDB) {
std::vector<VisitInfo> visits1;
Time last_visited1 = Time::Now() - TimeDelta::FromDays(1);
Time created1 = last_visited1 - TimeDelta::FromDays(20);
- visits1.push_back(VisitInfo(created1, content::PAGE_TRANSITION_LINK));
+ visits1.push_back(VisitInfo(created1, ui::PAGE_TRANSITION_LINK));
visits1.push_back(VisitInfo(last_visited1 - TimeDelta::FromDays(1),
- content::PAGE_TRANSITION_LINK));
- visits1.push_back(VisitInfo(last_visited1, content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
+ visits1.push_back(VisitInfo(last_visited1, ui::PAGE_TRANSITION_LINK));
GURL url2("http://www.example.com");
std::vector<VisitInfo> visits2;
const base::string16 title2(UTF8ToUTF16("example"));
Time last_visited2 = Time::Now();
Time created2 = last_visited2 - TimeDelta::FromDays(10);
- visits2.push_back(VisitInfo(created2, content::PAGE_TRANSITION_LINK));
+ visits2.push_back(VisitInfo(created2, ui::PAGE_TRANSITION_LINK));
visits2.push_back(VisitInfo(last_visited2 - TimeDelta::FromDays(5),
- content::PAGE_TRANSITION_LINK));
- visits2.push_back(VisitInfo(last_visited2, content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
+ visits2.push_back(VisitInfo(last_visited2, ui::PAGE_TRANSITION_LINK));
// Only use the HistoryBackend to generate the test data.
// HistoryBackend will shutdown after that.
diff --git a/chrome/browser/history/android/visit_sql_handler.cc b/chrome/browser/history/android/visit_sql_handler.cc
index fe9c1e5..29be69f 100644
--- a/chrome/browser/history/android/visit_sql_handler.cc
+++ b/chrome/browser/history/android/visit_sql_handler.cc
@@ -113,10 +113,10 @@ bool VisitSQLHandler::Delete(const TableIDRows& ids_set) {
}
bool VisitSQLHandler::AddVisit(URLID url_id, const Time& visit_time) {
- // TODO : Is 'content::PAGE_TRANSITION_AUTO_BOOKMARK' proper?
- // if not, a new content::PageTransition type will need.
+ // TODO : Is 'ui::PAGE_TRANSITION_AUTO_BOOKMARK' proper?
+ // if not, a new ui::PageTransition type will need.
VisitRow visit_row(url_id, visit_time, 0,
- content::PAGE_TRANSITION_AUTO_BOOKMARK, 0);
+ ui::PAGE_TRANSITION_AUTO_BOOKMARK, 0);
return history_db_->AddVisit(&visit_row, SOURCE_BROWSED);
}
diff --git a/chrome/browser/history/expire_history_backend.cc b/chrome/browser/history/expire_history_backend.cc
index 58eace8..7c6de26 100644
--- a/chrome/browser/history/expire_history_backend.cc
+++ b/chrome/browser/history/expire_history_backend.cc
@@ -86,7 +86,7 @@ class AutoSubframeVisitsReader : public ExpiringVisitsReader {
db->GetVisitsInRangeForTransition(begin_time, early_end_time,
max_visits,
- content::PAGE_TRANSITION_AUTO_SUBFRAME,
+ ui::PAGE_TRANSITION_AUTO_SUBFRAME,
visits);
bool more = static_cast<int>(visits->size()) == max_visits;
if (!more)
@@ -399,13 +399,13 @@ void ExpireHistoryBackend::ExpireURLsForVisits(const VisitVector& visits,
// TODO(pkasting): http://b/1148304 We shouldn't be marking so many URLs as
// typed, which would help eliminate the need for this code (we still would
// need to handle RELOAD transitions specially, though).
- content::PageTransition transition =
- content::PageTransitionStripQualifier(visits[i].transition);
- if (transition != content::PAGE_TRANSITION_RELOAD)
+ ui::PageTransition transition =
+ ui::PageTransitionStripQualifier(visits[i].transition);
+ if (transition != ui::PAGE_TRANSITION_RELOAD)
cur.visit_count++;
- if ((transition == content::PAGE_TRANSITION_TYPED &&
- !content::PageTransitionIsRedirect(visits[i].transition)) ||
- transition == content::PAGE_TRANSITION_KEYWORD_GENERATED)
+ if ((transition == ui::PAGE_TRANSITION_TYPED &&
+ !ui::PageTransitionIsRedirect(visits[i].transition)) ||
+ transition == ui::PAGE_TRANSITION_KEYWORD_GENERATED)
cur.typed_count++;
}
diff --git a/chrome/browser/history/expire_history_backend_unittest.cc b/chrome/browser/history/expire_history_backend_unittest.cc
index 3253369..9542dbc 100644
--- a/chrome/browser/history/expire_history_backend_unittest.cc
+++ b/chrome/browser/history/expire_history_backend_unittest.cc
@@ -236,7 +236,7 @@ void ExpireHistoryTest::AddExampleData(URLID url_ids[3], Time visit_times[4]) {
VisitRow visit_row3;
visit_row3.url_id = url_ids[1];
visit_row3.visit_time = visit_times[2];
- visit_row3.transition = content::PAGE_TRANSITION_TYPED;
+ visit_row3.transition = ui::PAGE_TRANSITION_TYPED;
main_db_->AddVisit(&visit_row3, SOURCE_BROWSED);
VisitRow visit_row4;
@@ -259,19 +259,19 @@ void ExpireHistoryTest::AddExampleSourceData(const GURL& url, URLID* id) {
// Four times for each visit.
VisitRow visit_row1(url_id, last_visit_time - TimeDelta::FromDays(4), 0,
- content::PAGE_TRANSITION_TYPED, 0);
+ ui::PAGE_TRANSITION_TYPED, 0);
main_db_->AddVisit(&visit_row1, SOURCE_SYNCED);
VisitRow visit_row2(url_id, last_visit_time - TimeDelta::FromDays(3), 0,
- content::PAGE_TRANSITION_TYPED, 0);
+ ui::PAGE_TRANSITION_TYPED, 0);
main_db_->AddVisit(&visit_row2, SOURCE_BROWSED);
VisitRow visit_row3(url_id, last_visit_time - TimeDelta::FromDays(2), 0,
- content::PAGE_TRANSITION_TYPED, 0);
+ ui::PAGE_TRANSITION_TYPED, 0);
main_db_->AddVisit(&visit_row3, SOURCE_EXTENSION);
VisitRow visit_row4(
- url_id, last_visit_time, 0, content::PAGE_TRANSITION_TYPED, 0);
+ url_id, last_visit_time, 0, ui::PAGE_TRANSITION_TYPED, 0);
main_db_->AddVisit(&visit_row4, SOURCE_FIREFOX_IMPORTED);
}
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index 1ab3a55..7c7dcf2 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -322,18 +322,18 @@ SegmentID HistoryBackend::UpdateSegments(
const GURL& url,
VisitID from_visit,
VisitID visit_id,
- content::PageTransition transition_type,
+ ui::PageTransition transition_type,
const Time ts) {
if (!db_)
return 0;
// We only consider main frames.
- if (!content::PageTransitionIsMainFrame(transition_type))
+ if (!ui::PageTransitionIsMainFrame(transition_type))
return 0;
SegmentID segment_id = 0;
- content::PageTransition t =
- content::PageTransitionStripQualifier(transition_type);
+ ui::PageTransition t =
+ ui::PageTransitionStripQualifier(transition_type);
// Are we at the beginning of a new segment?
// Note that navigating to an existing entry (with back/forward) reuses the
@@ -348,9 +348,9 @@ SegmentID HistoryBackend::UpdateSegments(
// Note also that we should still be updating the visit count for that segment
// which we are not doing now. It should be addressed when
// http://crbug.com/96860 is fixed.
- if ((t == content::PAGE_TRANSITION_TYPED ||
- t == content::PAGE_TRANSITION_AUTO_BOOKMARK) &&
- (transition_type & content::PAGE_TRANSITION_FORWARD_BACK) == 0) {
+ if ((t == ui::PAGE_TRANSITION_TYPED ||
+ t == ui::PAGE_TRANSITION_AUTO_BOOKMARK) &&
+ (transition_type & ui::PAGE_TRANSITION_FORWARD_BACK) == 0) {
// If so, create or get the segment.
std::string segment_name = db_->ComputeSegmentName(url);
URLID url_id = db_->GetRowForURL(url, NULL);
@@ -437,18 +437,18 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
if (request.time < first_recorded_time_)
first_recorded_time_ = request.time;
- content::PageTransition request_transition = request.transition;
- content::PageTransition stripped_transition =
- content::PageTransitionStripQualifier(request_transition);
+ ui::PageTransition request_transition = request.transition;
+ ui::PageTransition stripped_transition =
+ ui::PageTransitionStripQualifier(request_transition);
bool is_keyword_generated =
- (stripped_transition == content::PAGE_TRANSITION_KEYWORD_GENERATED);
+ (stripped_transition == ui::PAGE_TRANSITION_KEYWORD_GENERATED);
// If the user is navigating to a not-previously-typed intranet hostname,
// change the transition to TYPED so that the omnibox will learn that this is
// a known host.
bool has_redirects = request.redirects.size() > 1;
- if (content::PageTransitionIsMainFrame(request_transition) &&
- (stripped_transition != content::PAGE_TRANSITION_TYPED) &&
+ if (ui::PageTransitionIsMainFrame(request_transition) &&
+ (stripped_transition != ui::PAGE_TRANSITION_TYPED) &&
!is_keyword_generated) {
const GURL& origin_url(has_redirects ?
request.redirects[0] : request.url);
@@ -462,21 +462,21 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
if (registry_length == 0 && !db_->IsTypedHost(host)) {
- stripped_transition = content::PAGE_TRANSITION_TYPED;
+ stripped_transition = ui::PAGE_TRANSITION_TYPED;
request_transition =
- content::PageTransitionFromInt(
+ ui::PageTransitionFromInt(
stripped_transition |
- content::PageTransitionGetQualifier(request_transition));
+ ui::PageTransitionGetQualifier(request_transition));
}
}
}
if (!has_redirects) {
// The single entry is both a chain start and end.
- content::PageTransition t = content::PageTransitionFromInt(
+ ui::PageTransition t = ui::PageTransitionFromInt(
request_transition |
- content::PAGE_TRANSITION_CHAIN_START |
- content::PAGE_TRANSITION_CHAIN_END);
+ ui::PAGE_TRANSITION_CHAIN_START |
+ ui::PAGE_TRANSITION_CHAIN_END);
// No redirect case (one element means just the page itself).
last_ids = AddPageVisit(request.url, request.time,
@@ -495,8 +495,8 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
} else {
// Redirect case. Add the redirect chain.
- content::PageTransition redirect_info =
- content::PAGE_TRANSITION_CHAIN_START;
+ ui::PageTransition redirect_info =
+ ui::PAGE_TRANSITION_CHAIN_START;
RedirectList redirects = request.redirects;
if (redirects[0].SchemeIs(url::kAboutScheme)) {
@@ -510,8 +510,8 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
// In this case, we just don't bother hooking up the source of the
// redirects, so we remove it.
redirects.erase(redirects.begin());
- } else if (request_transition & content::PAGE_TRANSITION_CLIENT_REDIRECT) {
- redirect_info = content::PAGE_TRANSITION_CLIENT_REDIRECT;
+ } else if (request_transition & ui::PAGE_TRANSITION_CLIENT_REDIRECT) {
+ redirect_info = ui::PAGE_TRANSITION_CLIENT_REDIRECT;
// The first entry in the redirect chain initiated a client redirect.
// We don't add this to the database since the referrer is already
// there, so we skip over it but change the transition type of the first
@@ -532,9 +532,9 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
VisitRow visit_row;
if (request.did_replace_entry &&
db_->GetRowForVisit(last_ids.second, &visit_row) &&
- visit_row.transition & content::PAGE_TRANSITION_CHAIN_END) {
- visit_row.transition = content::PageTransitionFromInt(
- visit_row.transition & ~content::PAGE_TRANSITION_CHAIN_END);
+ visit_row.transition & ui::PAGE_TRANSITION_CHAIN_END) {
+ visit_row.transition = ui::PageTransitionFromInt(
+ visit_row.transition & ~ui::PAGE_TRANSITION_CHAIN_END);
db_->UpdateVisitRow(visit_row);
}
}
@@ -542,13 +542,13 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
for (size_t redirect_index = 0; redirect_index < redirects.size();
redirect_index++) {
- content::PageTransition t =
- content::PageTransitionFromInt(stripped_transition | redirect_info);
+ ui::PageTransition t =
+ ui::PageTransitionFromInt(stripped_transition | redirect_info);
// If this is the last transition, add a CHAIN_END marker
if (redirect_index == (redirects.size() - 1)) {
- t = content::PageTransitionFromInt(
- t | content::PAGE_TRANSITION_CHAIN_END);
+ t = ui::PageTransitionFromInt(
+ t | ui::PAGE_TRANSITION_CHAIN_END);
}
// Record all redirect visits with the same timestamp. We don't display
@@ -557,7 +557,7 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
last_ids = AddPageVisit(redirects[redirect_index],
request.time, last_ids.second,
t, request.visit_source);
- if (t & content::PAGE_TRANSITION_CHAIN_START) {
+ if (t & ui::PAGE_TRANSITION_CHAIN_START) {
// Update the segment for this visit.
UpdateSegments(redirects[redirect_index],
from_visit_id, last_ids.second, t, request.time);
@@ -568,7 +568,7 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
// Subsequent transitions in the redirect list must all be server
// redirects.
- redirect_info = content::PAGE_TRANSITION_SERVER_REDIRECT;
+ redirect_info = ui::PAGE_TRANSITION_SERVER_REDIRECT;
}
// Last, save this redirect chain for later so we can set titles & favicons
@@ -583,8 +583,8 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
// TODO(evanm): Due to http://b/1194536 we lose the referrers of a subframe
// navigation anyway, so last_visit_id is always zero for them. But adding
// them here confuses main frame history, so we skip them for now.
- if (stripped_transition != content::PAGE_TRANSITION_AUTO_SUBFRAME &&
- stripped_transition != content::PAGE_TRANSITION_MANUAL_SUBFRAME &&
+ if (stripped_transition != ui::PAGE_TRANSITION_AUTO_SUBFRAME &&
+ stripped_transition != ui::PAGE_TRANSITION_MANUAL_SUBFRAME &&
!is_keyword_generated) {
tracker_.AddVisit(request.context_id, request.page_id, request.url,
last_ids.second);
@@ -734,28 +734,28 @@ std::pair<URLID, VisitID> HistoryBackend::AddPageVisit(
const GURL& url,
Time time,
VisitID referring_visit,
- content::PageTransition transition,
+ ui::PageTransition transition,
VisitSource visit_source) {
// Top-level frame navigations are visible, everything else is hidden
- bool new_hidden = !content::PageTransitionIsMainFrame(transition);
+ bool new_hidden = !ui::PageTransitionIsMainFrame(transition);
// NOTE: This code must stay in sync with
// ExpireHistoryBackend::ExpireURLsForVisits().
// TODO(pkasting): http://b/1148304 We shouldn't be marking so many URLs as
// typed, which would eliminate the need for this code.
int typed_increment = 0;
- content::PageTransition transition_type =
- content::PageTransitionStripQualifier(transition);
- if ((transition_type == content::PAGE_TRANSITION_TYPED &&
- !content::PageTransitionIsRedirect(transition)) ||
- transition_type == content::PAGE_TRANSITION_KEYWORD_GENERATED)
+ ui::PageTransition transition_type =
+ ui::PageTransitionStripQualifier(transition);
+ if ((transition_type == ui::PAGE_TRANSITION_TYPED &&
+ !ui::PageTransitionIsRedirect(transition)) ||
+ transition_type == ui::PAGE_TRANSITION_KEYWORD_GENERATED)
typed_increment = 1;
#if defined(OS_ANDROID)
// Only count the page visit if it came from user browsing and only count it
// once when cycling through a redirect chain.
if (visit_source == SOURCE_BROWSED &&
- (transition & content::PAGE_TRANSITION_CHAIN_END) != 0) {
+ (transition & ui::PAGE_TRANSITION_CHAIN_END) != 0) {
RecordTopPageVisitStats(url);
}
#endif
@@ -765,8 +765,8 @@ std::pair<URLID, VisitID> HistoryBackend::AddPageVisit(
URLID url_id = db_->GetRowForURL(url, &url_info);
if (url_id) {
// Update of an existing row.
- if (content::PageTransitionStripQualifier(transition) !=
- content::PAGE_TRANSITION_RELOAD)
+ if (ui::PageTransitionStripQualifier(transition) !=
+ ui::PAGE_TRANSITION_RELOAD)
url_info.set_visit_count(url_info.visit_count() + 1);
if (typed_increment)
url_info.set_typed_count(url_info.typed_count() + typed_increment);
@@ -854,10 +854,10 @@ void HistoryBackend::AddPagesWithDetails(const URLRows& urls,
if (visit_source != SOURCE_SYNCED) {
// Make up a visit to correspond to the last visit to the page.
VisitRow visit_info(url_id, i->last_visit(), 0,
- content::PageTransitionFromInt(
- content::PAGE_TRANSITION_LINK |
- content::PAGE_TRANSITION_CHAIN_START |
- content::PAGE_TRANSITION_CHAIN_END), 0);
+ ui::PageTransitionFromInt(
+ ui::PAGE_TRANSITION_LINK |
+ ui::PAGE_TRANSITION_CHAIN_START |
+ ui::PAGE_TRANSITION_CHAIN_END), 0);
if (!db_->AddVisit(&visit_info, visit_source)) {
NOTREACHED() << "Adding visit failed.";
return;
@@ -1253,7 +1253,7 @@ void HistoryBackend::QueryHistoryBasic(const QueryOptions& options,
// 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);
+ (visit.transition & ui::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.
diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h
index 21d864b..293595c 100644
--- a/chrome/browser/history/history_backend.h
+++ b/chrome/browser/history/history_backend.h
@@ -613,7 +613,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
std::pair<URLID, VisitID> AddPageVisit(const GURL& url,
base::Time time,
VisitID referring_visit,
- content::PageTransition transition,
+ ui::PageTransition transition,
VisitSource visit_source);
// Returns a redirect chain in |redirects| for the VisitID
@@ -672,7 +672,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
SegmentID UpdateSegments(const GURL& url,
VisitID from_visit,
VisitID visit_id,
- content::PageTransition transition_type,
+ ui::PageTransition transition_type,
const base::Time ts);
// Favicons ------------------------------------------------------------------
diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc
index 91091a7..15b6b70 100644
--- a/chrome/browser/history/history_backend_unittest.cc
+++ b/chrome/browser/history/history_backend_unittest.cc
@@ -232,14 +232,14 @@ class HistoryBackendTest : public HistoryBackendTestBase {
protected:
void AddRedirectChain(const char* sequence[], int page_id) {
AddRedirectChainWithTransitionAndTime(sequence, page_id,
- content::PAGE_TRANSITION_LINK,
+ ui::PAGE_TRANSITION_LINK,
Time::Now());
}
void AddRedirectChainWithTransitionAndTime(
const char* sequence[],
int page_id,
- content::PageTransition transition,
+ ui::PageTransition transition,
base::Time time) {
history::RedirectList redirects;
for (int i = 0; sequence[i] != NULL; ++i)
@@ -271,7 +271,7 @@ class HistoryBackendTest : public HistoryBackendTestBase {
redirects.push_back(url2);
HistoryAddPageArgs request(
url2, time, dummy_context_id, 0, url1,
- redirects, content::PAGE_TRANSITION_CLIENT_REDIRECT,
+ redirects, ui::PAGE_TRANSITION_CLIENT_REDIRECT,
history::SOURCE_BROWSED, did_replace);
backend_->AddPage(request);
@@ -628,7 +628,7 @@ TEST_F(HistoryBackendTest, DeleteAllThenAddData) {
GURL url("http://www.google.com/");
HistoryAddPageArgs request(url, visit_time, NULL, 0, GURL(),
history::RedirectList(),
- content::PAGE_TRANSITION_KEYWORD_GENERATED,
+ ui::PAGE_TRANSITION_KEYWORD_GENERATED,
history::SOURCE_BROWSED, false);
backend_->AddPage(request);
@@ -771,7 +771,7 @@ TEST_F(HistoryBackendTest, KeywordGenerated) {
Time visit_time = Time::Now() - base::TimeDelta::FromDays(1);
HistoryAddPageArgs request(url, visit_time, NULL, 0, GURL(),
history::RedirectList(),
- content::PAGE_TRANSITION_KEYWORD_GENERATED,
+ ui::PAGE_TRANSITION_KEYWORD_GENERATED,
history::SOURCE_BROWSED, false);
backend_->AddPage(request);
@@ -823,21 +823,21 @@ TEST_F(HistoryBackendTest, ClientRedirect) {
GURL url_a("http://google.com/a");
AddClientRedirect(GURL(), url_a, false, base::Time(),
&transition1, &transition2);
- EXPECT_TRUE(transition2 & content::PAGE_TRANSITION_CHAIN_END);
+ EXPECT_TRUE(transition2 & ui::PAGE_TRANSITION_CHAIN_END);
// User initiated redirect to page B.
GURL url_b("http://google.com/b");
AddClientRedirect(url_a, url_b, false, base::Time(),
&transition1, &transition2);
- EXPECT_TRUE(transition1 & content::PAGE_TRANSITION_CHAIN_END);
- EXPECT_TRUE(transition2 & content::PAGE_TRANSITION_CHAIN_END);
+ EXPECT_TRUE(transition1 & ui::PAGE_TRANSITION_CHAIN_END);
+ EXPECT_TRUE(transition2 & ui::PAGE_TRANSITION_CHAIN_END);
// Non-user initiated redirect to page C.
GURL url_c("http://google.com/c");
AddClientRedirect(url_b, url_c, true, base::Time(),
&transition1, &transition2);
- EXPECT_FALSE(transition1 & content::PAGE_TRANSITION_CHAIN_END);
- EXPECT_TRUE(transition2 & content::PAGE_TRANSITION_CHAIN_END);
+ EXPECT_FALSE(transition1 & ui::PAGE_TRANSITION_CHAIN_END);
+ EXPECT_TRUE(transition2 & ui::PAGE_TRANSITION_CHAIN_END);
}
TEST_F(HistoryBackendTest, AddPagesWithDetails) {
@@ -1106,8 +1106,8 @@ TEST_F(HistoryBackendTest, StripUsernamePasswordTest) {
// Visit the url with username, password.
backend_->AddPageVisit(url, base::Time::Now(), 0,
- content::PageTransitionFromInt(
- content::PageTransitionGetQualifier(content::PAGE_TRANSITION_TYPED)),
+ ui::PageTransitionFromInt(
+ ui::PageTransitionGetQualifier(ui::PAGE_TRANSITION_TYPED)),
history::SOURCE_BROWSED);
// Fetch the row information about stripped url from history db.
@@ -1129,15 +1129,15 @@ TEST_F(HistoryBackendTest, AddPageVisitSource) {
// Assume visiting the url from an externsion.
backend_->AddPageVisit(
- url, base::Time::Now(), 0, content::PAGE_TRANSITION_TYPED,
+ url, base::Time::Now(), 0, ui::PAGE_TRANSITION_TYPED,
history::SOURCE_EXTENSION);
// Assume the url is imported from Firefox.
backend_->AddPageVisit(url, base::Time::Now(), 0,
- content::PAGE_TRANSITION_TYPED,
+ ui::PAGE_TRANSITION_TYPED,
history::SOURCE_FIREFOX_IMPORTED);
// Assume this url is also synced.
backend_->AddPageVisit(url, base::Time::Now(), 0,
- content::PAGE_TRANSITION_TYPED,
+ ui::PAGE_TRANSITION_TYPED,
history::SOURCE_SYNCED);
// Fetch the row information about the url from history db.
@@ -1183,15 +1183,15 @@ TEST_F(HistoryBackendTest, AddPageVisitNotLastVisit) {
// Visit the url with recent time.
backend_->AddPageVisit(url, recent_time, 0,
- content::PageTransitionFromInt(
- content::PageTransitionGetQualifier(content::PAGE_TRANSITION_TYPED)),
+ ui::PageTransitionFromInt(
+ ui::PageTransitionGetQualifier(ui::PAGE_TRANSITION_TYPED)),
history::SOURCE_BROWSED);
// Add to the url a visit with older time (could be syncing from another
// client, etc.).
backend_->AddPageVisit(url, older_time, 0,
- content::PageTransitionFromInt(
- content::PageTransitionGetQualifier(content::PAGE_TRANSITION_TYPED)),
+ ui::PageTransitionFromInt(
+ ui::PageTransitionGetQualifier(ui::PAGE_TRANSITION_TYPED)),
history::SOURCE_SYNCED);
// Fetch the row information about url from history db.
@@ -1218,11 +1218,11 @@ TEST_F(HistoryBackendTest, AddPageVisitFiresNotificationWithCorrectDetails) {
// Visit two distinct URLs, the second one twice.
backend_->AddPageVisit(url1, base::Time::Now(), 0,
- content::PAGE_TRANSITION_LINK,
+ ui::PAGE_TRANSITION_LINK,
history::SOURCE_BROWSED);
for (int i = 0; i < 2; ++i) {
backend_->AddPageVisit(url2, base::Time::Now(), 0,
- content::PAGE_TRANSITION_TYPED,
+ ui::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED);
}
@@ -1237,8 +1237,8 @@ TEST_F(HistoryBackendTest, AddPageVisitFiresNotificationWithCorrectDetails) {
broadcasted_notifications()[0].first);
const URLVisitedDetails* details = static_cast<const URLVisitedDetails*>(
broadcasted_notifications()[0].second);
- EXPECT_EQ(content::PAGE_TRANSITION_LINK,
- content::PageTransitionStripQualifier(details->transition));
+ EXPECT_EQ(ui::PAGE_TRANSITION_LINK,
+ ui::PageTransitionStripQualifier(details->transition));
EXPECT_EQ(stored_row1.id(), details->row.id());
EXPECT_EQ(stored_row1.url(), details->row.url());
@@ -1250,8 +1250,8 @@ TEST_F(HistoryBackendTest, AddPageVisitFiresNotificationWithCorrectDetails) {
broadcasted_notifications()[2].first);
details = static_cast<const URLVisitedDetails*>(
broadcasted_notifications()[2].second);
- EXPECT_EQ(content::PAGE_TRANSITION_TYPED,
- content::PageTransitionStripQualifier(details->transition));
+ EXPECT_EQ(ui::PAGE_TRANSITION_TYPED,
+ ui::PageTransitionStripQualifier(details->transition));
EXPECT_EQ(stored_row2.id(), details->row.id());
EXPECT_EQ(stored_row2.url(), details->row.url());
}
@@ -1264,19 +1264,19 @@ TEST_F(HistoryBackendTest, AddPageArgsSource) {
// Assume this page is browsed by user.
HistoryAddPageArgs request1(url, base::Time::Now(), NULL, 0, GURL(),
history::RedirectList(),
- content::PAGE_TRANSITION_KEYWORD_GENERATED,
+ ui::PAGE_TRANSITION_KEYWORD_GENERATED,
history::SOURCE_BROWSED, false);
backend_->AddPage(request1);
// Assume this page is synced.
HistoryAddPageArgs request2(url, base::Time::Now(), NULL, 0, GURL(),
history::RedirectList(),
- content::PAGE_TRANSITION_LINK,
+ ui::PAGE_TRANSITION_LINK,
history::SOURCE_SYNCED, false);
backend_->AddPage(request2);
// Assume this page is browsed again.
HistoryAddPageArgs request3(url, base::Time::Now(), NULL, 0, GURL(),
history::RedirectList(),
- content::PAGE_TRANSITION_TYPED,
+ ui::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED, false);
backend_->AddPage(request3);
@@ -1299,18 +1299,18 @@ TEST_F(HistoryBackendTest, AddVisitsSource) {
std::vector<VisitInfo> visits1, visits2;
visits1.push_back(VisitInfo(
Time::Now() - base::TimeDelta::FromDays(5),
- content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
visits1.push_back(VisitInfo(
Time::Now() - base::TimeDelta::FromDays(1),
- content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
visits1.push_back(VisitInfo(
- Time::Now(), content::PAGE_TRANSITION_LINK));
+ Time::Now(), ui::PAGE_TRANSITION_LINK));
GURL url2("http://www.example.com");
visits2.push_back(VisitInfo(
Time::Now() - base::TimeDelta::FromDays(10),
- content::PAGE_TRANSITION_LINK));
- visits2.push_back(VisitInfo(Time::Now(), content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
+ visits2.push_back(VisitInfo(Time::Now(), ui::PAGE_TRANSITION_LINK));
// Clear all history.
backend_->DeleteAllHistory();
@@ -1346,12 +1346,12 @@ TEST_F(HistoryBackendTest, GetMostRecentVisits) {
std::vector<VisitInfo> visits1;
visits1.push_back(VisitInfo(
Time::Now() - base::TimeDelta::FromDays(5),
- content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
visits1.push_back(VisitInfo(
Time::Now() - base::TimeDelta::FromDays(1),
- content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
visits1.push_back(VisitInfo(
- Time::Now(), content::PAGE_TRANSITION_LINK));
+ Time::Now(), ui::PAGE_TRANSITION_LINK));
// Clear all history.
backend_->DeleteAllHistory();
@@ -1377,13 +1377,13 @@ TEST_F(HistoryBackendTest, RemoveVisitsTransitions) {
GURL url1("http://www.cnn.com");
VisitInfo typed_visit(
Time::Now() - base::TimeDelta::FromDays(6),
- content::PAGE_TRANSITION_TYPED);
+ ui::PAGE_TRANSITION_TYPED);
VisitInfo reload_visit(
Time::Now() - base::TimeDelta::FromDays(5),
- content::PAGE_TRANSITION_RELOAD);
+ ui::PAGE_TRANSITION_RELOAD);
VisitInfo link_visit(
Time::Now() - base::TimeDelta::FromDays(4),
- content::PAGE_TRANSITION_LINK);
+ ui::PAGE_TRANSITION_LINK);
std::vector<VisitInfo> visits_to_add;
visits_to_add.push_back(typed_visit);
visits_to_add.push_back(reload_visit);
@@ -1430,15 +1430,15 @@ TEST_F(HistoryBackendTest, RemoveVisitsSource) {
std::vector<VisitInfo> visits1, visits2;
visits1.push_back(VisitInfo(
Time::Now() - base::TimeDelta::FromDays(5),
- content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
visits1.push_back(VisitInfo(Time::Now(),
- content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
GURL url2("http://www.example.com");
visits2.push_back(VisitInfo(
Time::Now() - base::TimeDelta::FromDays(10),
- content::PAGE_TRANSITION_LINK));
- visits2.push_back(VisitInfo(Time::Now(), content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
+ visits2.push_back(VisitInfo(Time::Now(), ui::PAGE_TRANSITION_LINK));
// Clear all history.
backend_->DeleteAllHistory();
@@ -2543,10 +2543,10 @@ TEST_F(HistoryBackendTest, QueryFilteredURLs) {
base::TimeDelta one_hour = base::TimeDelta::FromHours(1);
base::TimeDelta one_day = base::TimeDelta::FromDays(1);
- const content::PageTransition kTypedTransition =
- content::PAGE_TRANSITION_TYPED;
- const content::PageTransition kKeywordGeneratedTransition =
- content::PAGE_TRANSITION_KEYWORD_GENERATED;
+ const ui::PageTransition kTypedTransition =
+ ui::PAGE_TRANSITION_TYPED;
+ const ui::PageTransition kKeywordGeneratedTransition =
+ ui::PAGE_TRANSITION_KEYWORD_GENERATED;
const char* redirect_sequence[2];
redirect_sequence[1] = NULL;
@@ -2682,11 +2682,11 @@ TEST_F(HistoryBackendTest, UpdateVisitDuration) {
std::vector<VisitInfo> visit_info1, visit_info2;
Time start_ts = Time::Now() - base::TimeDelta::FromDays(5);
Time end_ts = start_ts + base::TimeDelta::FromDays(2);
- visit_info1.push_back(VisitInfo(start_ts, content::PAGE_TRANSITION_LINK));
+ visit_info1.push_back(VisitInfo(start_ts, ui::PAGE_TRANSITION_LINK));
GURL url2("http://www.example.com");
visit_info2.push_back(VisitInfo(Time::Now() - base::TimeDelta::FromDays(10),
- content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
// Clear all history.
backend_->DeleteAllHistory();
@@ -2972,7 +2972,7 @@ TEST_F(HistoryBackendTest, RemoveNotification) {
service->AddPage(
url, base::Time::Now(), NULL, 1, GURL(), RedirectList(),
- content::PAGE_TRANSITION_TYPED, SOURCE_BROWSED, false);
+ ui::PAGE_TRANSITION_TYPED, SOURCE_BROWSED, false);
// This won't actually delete the URL, rather it'll empty out the visits.
// This triggers blocking on the BookmarkModel.
diff --git a/chrome/browser/history/history_notifications.cc b/chrome/browser/history/history_notifications.cc
index 86c859f..2f30a3b 100644
--- a/chrome/browser/history/history_notifications.cc
+++ b/chrome/browser/history/history_notifications.cc
@@ -7,7 +7,7 @@
namespace history {
URLVisitedDetails::URLVisitedDetails()
- : transition(content::PAGE_TRANSITION_LINK) {}
+ : transition(ui::PAGE_TRANSITION_LINK) {}
URLVisitedDetails::~URLVisitedDetails() {}
diff --git a/chrome/browser/history/history_notifications.h b/chrome/browser/history/history_notifications.h
index 2eb4fa7..3386b2f 100644
--- a/chrome/browser/history/history_notifications.h
+++ b/chrome/browser/history/history_notifications.h
@@ -21,7 +21,7 @@ struct URLVisitedDetails : public HistoryDetails {
URLVisitedDetails();
virtual ~URLVisitedDetails();
- content::PageTransition transition;
+ ui::PageTransition transition;
// The affected URLRow. The ID will be set to the value that is currently in
// effect in the main history database.
diff --git a/chrome/browser/history/history_querying_unittest.cc b/chrome/browser/history/history_querying_unittest.cc
index d5b1c04..b7a9b25 100644
--- a/chrome/browser/history/history_querying_unittest.cc
+++ b/chrome/browser/history/history_querying_unittest.cc
@@ -154,7 +154,7 @@ class HistoryQueryTest : public testing::Test {
GURL url(entry.url);
history_->AddPage(url, entry.time, context_id, page_id_++, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_LINK,
+ history::RedirectList(), ui::PAGE_TRANSITION_LINK,
history::SOURCE_BROWSED, false);
history_->SetPageTitle(url, base::UTF8ToUTF16(entry.title));
}
diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc
index fd4c2d9..4c61734 100644
--- a/chrome/browser/history/history_service.cc
+++ b/chrome/browser/history/history_service.cc
@@ -370,7 +370,7 @@ void HistoryService::AddPage(const GURL& url,
int32 page_id,
const GURL& referrer,
const history::RedirectList& redirects,
- content::PageTransition transition,
+ ui::PageTransition transition,
history::VisitSource visit_source,
bool did_replace_entry) {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -387,7 +387,7 @@ void HistoryService::AddPage(const GURL& url,
AddPage(
history::HistoryAddPageArgs(url, time, NULL, 0, GURL(),
history::RedirectList(),
- content::PAGE_TRANSITION_LINK,
+ ui::PAGE_TRANSITION_LINK,
visit_source, false));
}
diff --git a/chrome/browser/history/history_service.h b/chrome/browser/history/history_service.h
index 9be45da..a7de0cb 100644
--- a/chrome/browser/history/history_service.h
+++ b/chrome/browser/history/history_service.h
@@ -33,9 +33,9 @@
#include "content/public/browser/download_manager_delegate.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
-#include "content/public/common/page_transition_types.h"
#include "sql/init_status.h"
#include "sync/api/syncable_service.h"
+#include "ui/base/page_transition_types.h"
#if defined(OS_ANDROID)
class AndroidHistoryProviderService;
@@ -182,7 +182,7 @@ class HistoryService : public content::NotificationObserver,
int32 page_id,
const GURL& referrer,
const history::RedirectList& redirects,
- content::PageTransition transition,
+ ui::PageTransition transition,
history::VisitSource visit_source,
bool did_replace_entry);
diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc
index 370594e..f0f7960 100644
--- a/chrome/browser/history/history_tab_helper.cc
+++ b/chrome/browser/history/history_tab_helper.cc
@@ -61,7 +61,7 @@ HistoryTabHelper::CreateHistoryAddPageArgs(
params.url, timestamp, web_contents(), params.page_id,
params.referrer.url, params.redirects, params.transition,
history::SOURCE_BROWSED, did_replace_entry);
- if (content::PageTransitionIsMainFrame(params.transition) &&
+ if (ui::PageTransitionIsMainFrame(params.transition) &&
virtual_url != params.url) {
// Hack on the "virtual" URL so that it will appear in history. For some
// types of URLs, we will display a magic URL that is different from where
diff --git a/chrome/browser/history/history_types.cc b/chrome/browser/history/history_types.cc
index 97145ec..5e733cc 100644
--- a/chrome/browser/history/history_types.cc
+++ b/chrome/browser/history/history_types.cc
@@ -17,14 +17,14 @@ VisitRow::VisitRow()
: visit_id(0),
url_id(0),
referring_visit(0),
- transition(content::PAGE_TRANSITION_LINK),
+ transition(ui::PAGE_TRANSITION_LINK),
segment_id(0) {
}
VisitRow::VisitRow(URLID arg_url_id,
base::Time arg_visit_time,
VisitID arg_referring_visit,
- content::PageTransition arg_transition,
+ ui::PageTransition arg_transition,
SegmentID arg_segment_id)
: visit_id(0),
url_id(arg_url_id),
@@ -50,7 +50,7 @@ QueryURLResult::~QueryURLResult() {
HistoryAddPageArgs::HistoryAddPageArgs()
: context_id(NULL),
page_id(0),
- transition(content::PAGE_TRANSITION_LINK),
+ transition(ui::PAGE_TRANSITION_LINK),
visit_source(SOURCE_BROWSED),
did_replace_entry(false) {}
@@ -61,7 +61,7 @@ HistoryAddPageArgs::HistoryAddPageArgs(
int32 page_id,
const GURL& referrer,
const history::RedirectList& redirects,
- content::PageTransition transition,
+ ui::PageTransition transition,
VisitSource source,
bool did_replace_entry)
: url(url),
diff --git a/chrome/browser/history/history_types.h b/chrome/browser/history/history_types.h
index 70946bf..c50856b 100644
--- a/chrome/browser/history/history_types.h
+++ b/chrome/browser/history/history_types.h
@@ -6,7 +6,7 @@
#define CHROME_BROWSER_HISTORY_HISTORY_TYPES_H_
#include "components/history/core/browser/history_types.h"
-#include "content/public/common/page_transition_types.h"
+#include "ui/base/page_transition_types.h"
namespace content {
class WebContents;
@@ -30,7 +30,7 @@ class VisitRow {
VisitRow(URLID arg_url_id,
base::Time arg_visit_time,
VisitID arg_referring_visit,
- content::PageTransition arg_transition,
+ ui::PageTransition arg_transition,
SegmentID arg_segment_id);
~VisitRow();
@@ -47,7 +47,7 @@ class VisitRow {
VisitID referring_visit;
// A combination of bits from PageTransition.
- content::PageTransition transition;
+ ui::PageTransition transition;
// The segment id (see visitsegment_database.*).
// If 0, the segment id is null in the table.
@@ -72,7 +72,7 @@ typedef std::vector<VisitRow> VisitVector;
// The basic information associated with a visit (timestamp, type of visit),
// used by HistoryBackend::AddVisits() to create new visits for a URL.
-typedef std::pair<base::Time, content::PageTransition> VisitInfo;
+typedef std::pair<base::Time, ui::PageTransition> VisitInfo;
// QueryURLResult -------------------------------------------------------------
@@ -96,7 +96,7 @@ struct HistoryAddPageArgs {
//
// HistoryAddPageArgs(
// GURL(), base::Time(), NULL, 0, GURL(),
- // history::RedirectList(), content::PAGE_TRANSITION_LINK,
+ // history::RedirectList(), ui::PAGE_TRANSITION_LINK,
// SOURCE_BROWSED, false)
HistoryAddPageArgs();
HistoryAddPageArgs(const GURL& url,
@@ -105,7 +105,7 @@ struct HistoryAddPageArgs {
int32 page_id,
const GURL& referrer,
const history::RedirectList& redirects,
- content::PageTransition transition,
+ ui::PageTransition transition,
VisitSource source,
bool did_replace_entry);
~HistoryAddPageArgs();
@@ -118,7 +118,7 @@ struct HistoryAddPageArgs {
GURL referrer;
history::RedirectList redirects;
- content::PageTransition transition;
+ ui::PageTransition transition;
VisitSource visit_source;
bool did_replace_entry;
};
@@ -127,7 +127,7 @@ struct HistoryAddPageArgs {
struct BriefVisitInfo {
URLID url_id;
base::Time time;
- content::PageTransition transition;
+ ui::PageTransition transition;
};
// An observer of VisitDatabase.
diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc
index 13b6aa1..a4fdf6b 100644
--- a/chrome/browser/history/history_unittest.cc
+++ b/chrome/browser/history/history_unittest.cc
@@ -1119,7 +1119,7 @@ TEST_F(HistoryTest, AddPage) {
const GURL test_url("http://www.google.com/");
history_service_->AddPage(test_url, base::Time::Now(), NULL, 0, GURL(),
history::RedirectList(),
- content::PAGE_TRANSITION_MANUAL_SUBFRAME,
+ ui::PAGE_TRANSITION_MANUAL_SUBFRAME,
history::SOURCE_BROWSED, false);
EXPECT_TRUE(QueryURL(history_service_.get(), test_url));
EXPECT_EQ(1, query_url_row_.visit_count());
@@ -1128,7 +1128,7 @@ TEST_F(HistoryTest, AddPage) {
// Add the page once from the main frame (should unhide it).
history_service_->AddPage(test_url, base::Time::Now(), NULL, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_LINK,
+ history::RedirectList(), ui::PAGE_TRANSITION_LINK,
history::SOURCE_BROWSED, false);
EXPECT_TRUE(QueryURL(history_service_.get(), test_url));
EXPECT_EQ(2, query_url_row_.visit_count()); // Added twice.
@@ -1151,7 +1151,7 @@ TEST_F(HistoryTest, AddRedirect) {
history_service_->AddPage(
first_redirects.back(), base::Time::Now(),
reinterpret_cast<ContextID>(1), 0, GURL(), first_redirects,
- content::PAGE_TRANSITION_LINK, history::SOURCE_BROWSED, true);
+ ui::PAGE_TRANSITION_LINK, history::SOURCE_BROWSED, true);
// The first page should be added once with a link visit type (because we set
// LINK when we added the original URL, and a referrer of nowhere (0).
@@ -1159,8 +1159,8 @@ TEST_F(HistoryTest, AddRedirect) {
EXPECT_EQ(1, query_url_row_.visit_count());
ASSERT_EQ(1U, query_url_visits_.size());
int64 first_visit = query_url_visits_[0].visit_id;
- EXPECT_EQ(content::PAGE_TRANSITION_LINK |
- content::PAGE_TRANSITION_CHAIN_START,
+ EXPECT_EQ(ui::PAGE_TRANSITION_LINK |
+ ui::PAGE_TRANSITION_CHAIN_START,
query_url_visits_[0].transition);
EXPECT_EQ(0, query_url_visits_[0].referring_visit); // No referrer.
@@ -1170,8 +1170,8 @@ TEST_F(HistoryTest, AddRedirect) {
EXPECT_EQ(1, query_url_row_.visit_count());
ASSERT_EQ(1U, query_url_visits_.size());
int64 second_visit = query_url_visits_[0].visit_id;
- EXPECT_EQ(content::PAGE_TRANSITION_SERVER_REDIRECT |
- content::PAGE_TRANSITION_CHAIN_END,
+ EXPECT_EQ(ui::PAGE_TRANSITION_SERVER_REDIRECT |
+ ui::PAGE_TRANSITION_CHAIN_END,
query_url_visits_[0].transition);
EXPECT_EQ(first_visit, query_url_visits_[0].referring_visit);
@@ -1190,9 +1190,9 @@ TEST_F(HistoryTest, AddRedirect) {
history_service_->AddPage(second_redirects[1], base::Time::Now(),
reinterpret_cast<ContextID>(1), 1,
second_redirects[0], second_redirects,
- static_cast<content::PageTransition>(
- content::PAGE_TRANSITION_LINK |
- content::PAGE_TRANSITION_CLIENT_REDIRECT),
+ ui::PageTransitionFromInt(
+ ui::PAGE_TRANSITION_LINK |
+ ui::PAGE_TRANSITION_CLIENT_REDIRECT),
history::SOURCE_BROWSED, true);
// The last page (source of the client redirect) should NOT have an
@@ -1205,8 +1205,8 @@ TEST_F(HistoryTest, AddRedirect) {
EXPECT_TRUE(QueryURL(history_service_.get(), second_redirects[1]));
EXPECT_EQ(1, query_url_row_.visit_count());
ASSERT_EQ(1U, query_url_visits_.size());
- EXPECT_EQ(content::PAGE_TRANSITION_CLIENT_REDIRECT |
- content::PAGE_TRANSITION_CHAIN_END,
+ EXPECT_EQ(ui::PAGE_TRANSITION_CLIENT_REDIRECT |
+ ui::PAGE_TRANSITION_CHAIN_END,
query_url_visits_[0].transition);
EXPECT_EQ(second_visit, query_url_visits_[0].referring_visit);
}
@@ -1219,14 +1219,14 @@ TEST_F(HistoryTest, MakeIntranetURLsTyped) {
const GURL test_url("http://intranet_host/path");
history_service_->AddPage(
test_url, base::Time::Now(), NULL, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_LINK,
+ history::RedirectList(), ui::PAGE_TRANSITION_LINK,
history::SOURCE_BROWSED, false);
EXPECT_TRUE(QueryURL(history_service_.get(), test_url));
EXPECT_EQ(1, query_url_row_.visit_count());
EXPECT_EQ(1, query_url_row_.typed_count());
ASSERT_EQ(1U, query_url_visits_.size());
- EXPECT_EQ(content::PAGE_TRANSITION_TYPED,
- content::PageTransitionStripQualifier(query_url_visits_[0].transition));
+ EXPECT_EQ(ui::PAGE_TRANSITION_TYPED,
+ ui::PageTransitionStripQualifier(query_url_visits_[0].transition));
// Add more visits on the same host. None of these should be promoted since
// there is already a typed visit.
@@ -1235,66 +1235,66 @@ TEST_F(HistoryTest, MakeIntranetURLsTyped) {
const GURL test_url2("http://intranet_host/different_path");
history_service_->AddPage(
test_url2, base::Time::Now(), NULL, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_LINK,
+ history::RedirectList(), ui::PAGE_TRANSITION_LINK,
history::SOURCE_BROWSED, false);
EXPECT_TRUE(QueryURL(history_service_.get(), test_url2));
EXPECT_EQ(1, query_url_row_.visit_count());
EXPECT_EQ(0, query_url_row_.typed_count());
ASSERT_EQ(1U, query_url_visits_.size());
- EXPECT_EQ(content::PAGE_TRANSITION_LINK,
- content::PageTransitionStripQualifier(query_url_visits_[0].transition));
+ EXPECT_EQ(ui::PAGE_TRANSITION_LINK,
+ ui::PageTransitionStripQualifier(query_url_visits_[0].transition));
// No path.
const GURL test_url3("http://intranet_host/");
history_service_->AddPage(
test_url3, base::Time::Now(), NULL, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_LINK,
+ history::RedirectList(), ui::PAGE_TRANSITION_LINK,
history::SOURCE_BROWSED, false);
EXPECT_TRUE(QueryURL(history_service_.get(), test_url3));
EXPECT_EQ(1, query_url_row_.visit_count());
EXPECT_EQ(0, query_url_row_.typed_count());
ASSERT_EQ(1U, query_url_visits_.size());
- EXPECT_EQ(content::PAGE_TRANSITION_LINK,
- content::PageTransitionStripQualifier(query_url_visits_[0].transition));
+ EXPECT_EQ(ui::PAGE_TRANSITION_LINK,
+ ui::PageTransitionStripQualifier(query_url_visits_[0].transition));
// Different scheme.
const GURL test_url4("https://intranet_host/");
history_service_->AddPage(
test_url4, base::Time::Now(), NULL, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_LINK,
+ history::RedirectList(), ui::PAGE_TRANSITION_LINK,
history::SOURCE_BROWSED, false);
EXPECT_TRUE(QueryURL(history_service_.get(), test_url4));
EXPECT_EQ(1, query_url_row_.visit_count());
EXPECT_EQ(0, query_url_row_.typed_count());
ASSERT_EQ(1U, query_url_visits_.size());
- EXPECT_EQ(content::PAGE_TRANSITION_LINK,
- content::PageTransitionStripQualifier(query_url_visits_[0].transition));
+ EXPECT_EQ(ui::PAGE_TRANSITION_LINK,
+ ui::PageTransitionStripQualifier(query_url_visits_[0].transition));
// Different transition.
const GURL test_url5("http://intranet_host/another_path");
history_service_->AddPage(
test_url5, base::Time::Now(), NULL, 0, GURL(),
history::RedirectList(),
- content::PAGE_TRANSITION_AUTO_BOOKMARK,
+ ui::PAGE_TRANSITION_AUTO_BOOKMARK,
history::SOURCE_BROWSED, false);
EXPECT_TRUE(QueryURL(history_service_.get(), test_url5));
EXPECT_EQ(1, query_url_row_.visit_count());
EXPECT_EQ(0, query_url_row_.typed_count());
ASSERT_EQ(1U, query_url_visits_.size());
- EXPECT_EQ(content::PAGE_TRANSITION_AUTO_BOOKMARK,
- content::PageTransitionStripQualifier(query_url_visits_[0].transition));
+ EXPECT_EQ(ui::PAGE_TRANSITION_AUTO_BOOKMARK,
+ ui::PageTransitionStripQualifier(query_url_visits_[0].transition));
// Original URL.
history_service_->AddPage(
test_url, base::Time::Now(), NULL, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_LINK,
+ history::RedirectList(), ui::PAGE_TRANSITION_LINK,
history::SOURCE_BROWSED, false);
EXPECT_TRUE(QueryURL(history_service_.get(), test_url));
EXPECT_EQ(2, query_url_row_.visit_count());
EXPECT_EQ(1, query_url_row_.typed_count());
ASSERT_EQ(2U, query_url_visits_.size());
- EXPECT_EQ(content::PAGE_TRANSITION_LINK,
- content::PageTransitionStripQualifier(query_url_visits_[1].transition));
+ EXPECT_EQ(ui::PAGE_TRANSITION_LINK,
+ ui::PageTransitionStripQualifier(query_url_visits_[1].transition));
}
TEST_F(HistoryTest, Typed) {
@@ -1306,7 +1306,7 @@ TEST_F(HistoryTest, Typed) {
const GURL test_url("http://www.google.com/");
history_service_->AddPage(
test_url, base::Time::Now(), context_id, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_TYPED,
+ history::RedirectList(), ui::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED, false);
EXPECT_TRUE(QueryURL(history_service_.get(), test_url));
@@ -1317,7 +1317,7 @@ TEST_F(HistoryTest, Typed) {
// Add the page again not typed.
history_service_->AddPage(
test_url, base::Time::Now(), context_id, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_LINK,
+ history::RedirectList(), ui::PAGE_TRANSITION_LINK,
history::SOURCE_BROWSED, false);
EXPECT_TRUE(QueryURL(history_service_.get(), test_url));
@@ -1328,7 +1328,7 @@ TEST_F(HistoryTest, Typed) {
// Add the page again as a generated URL.
history_service_->AddPage(
test_url, base::Time::Now(), context_id, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_GENERATED,
+ history::RedirectList(), ui::PAGE_TRANSITION_GENERATED,
history::SOURCE_BROWSED, false);
EXPECT_TRUE(QueryURL(history_service_.get(), test_url));
@@ -1339,7 +1339,7 @@ TEST_F(HistoryTest, Typed) {
// Add the page again as a reload.
history_service_->AddPage(
test_url, base::Time::Now(), context_id, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_RELOAD,
+ history::RedirectList(), ui::PAGE_TRANSITION_RELOAD,
history::SOURCE_BROWSED, false);
EXPECT_TRUE(QueryURL(history_service_.get(), test_url));
@@ -1391,11 +1391,11 @@ TEST_F(HistoryTest, MostVisitedURLs) {
// Add two pages.
history_service_->AddPage(
url0, base::Time::Now(), context_id, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_TYPED,
+ history::RedirectList(), ui::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED, false);
history_service_->AddPage(
url1, base::Time::Now(), context_id, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_TYPED,
+ history::RedirectList(), ui::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED, false);
history_service_->QueryMostVisitedURLs(
20,
@@ -1412,7 +1412,7 @@ TEST_F(HistoryTest, MostVisitedURLs) {
// Add another page.
history_service_->AddPage(
url2, base::Time::Now(), context_id, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_TYPED,
+ history::RedirectList(), ui::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED, false);
history_service_->QueryMostVisitedURLs(
20,
@@ -1430,7 +1430,7 @@ TEST_F(HistoryTest, MostVisitedURLs) {
// Revisit url2, making it the top URL.
history_service_->AddPage(
url2, base::Time::Now(), context_id, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_TYPED,
+ history::RedirectList(), ui::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED, false);
history_service_->QueryMostVisitedURLs(
20,
@@ -1448,7 +1448,7 @@ TEST_F(HistoryTest, MostVisitedURLs) {
// Revisit url1, making it the top URL.
history_service_->AddPage(
url1, base::Time::Now(), context_id, 0, GURL(),
- history::RedirectList(), content::PAGE_TRANSITION_TYPED,
+ history::RedirectList(), ui::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED, false);
history_service_->QueryMostVisitedURLs(
20,
@@ -1471,7 +1471,7 @@ TEST_F(HistoryTest, MostVisitedURLs) {
// Visit url4 using redirects.
history_service_->AddPage(
url4, base::Time::Now(), context_id, 0, GURL(),
- redirects, content::PAGE_TRANSITION_TYPED,
+ redirects, ui::PAGE_TRANSITION_TYPED,
history::SOURCE_BROWSED, false);
history_service_->QueryMostVisitedURLs(
20,
@@ -1576,7 +1576,7 @@ TEST_F(HistoryTest, ProcessLocalDeleteDirectiveSyncOnline) {
base::Time::UnixEpoch() + base::TimeDelta::FromMicroseconds(i);
history_service_->AddPage(test_url, t, NULL, 0, GURL(),
history::RedirectList(),
- content::PAGE_TRANSITION_LINK,
+ ui::PAGE_TRANSITION_LINK,
history::SOURCE_BROWSED, false);
}
@@ -1641,7 +1641,7 @@ TEST_F(HistoryTest, ProcessGlobalIdDeleteDirective) {
base::Time::UnixEpoch() + base::TimeDelta::FromMicroseconds(i);
history_service_->AddPage(test_url, t, NULL, 0, GURL(),
history::RedirectList(),
- content::PAGE_TRANSITION_LINK,
+ ui::PAGE_TRANSITION_LINK,
history::SOURCE_BROWSED, false);
}
@@ -1732,7 +1732,7 @@ TEST_F(HistoryTest, ProcessTimeRangeDeleteDirective) {
base::Time::UnixEpoch() + base::TimeDelta::FromMicroseconds(i);
history_service_->AddPage(test_url, t, NULL, 0, GURL(),
history::RedirectList(),
- content::PAGE_TRANSITION_LINK,
+ ui::PAGE_TRANSITION_LINK,
history::SOURCE_BROWSED, false);
}
diff --git a/chrome/browser/history/in_memory_url_index_cache.proto b/chrome/browser/history/in_memory_url_index_cache.proto
index 3a39e74..df2de1b 100644
--- a/chrome/browser/history/in_memory_url_index_cache.proto
+++ b/chrome/browser/history/in_memory_url_index_cache.proto
@@ -57,7 +57,7 @@ message InMemoryURLIndexCacheItem {
message HistoryInfoMapEntry {
message VisitInfo {
required int64 visit_time = 1;
- // Corresponds to content::PageTransition.
+ // Corresponds to ui::PageTransition.
required uint64 transition_type = 2;
}
required int64 history_id = 1;
diff --git a/chrome/browser/history/scored_history_match.cc b/chrome/browser/history/scored_history_match.cc
index a5270f4..1f1184c 100644
--- a/chrome/browser/history/scored_history_match.cc
+++ b/chrome/browser/history/scored_history_match.cc
@@ -531,7 +531,7 @@ float ScoredHistoryMatch::GetFrequency(const base::Time& now,
float summed_visit_points = 0;
for (size_t i = 0; i < std::min(visits.size(), kMaxVisitsToScore); ++i) {
int value_of_transition =
- (visits[i].second == content::PAGE_TRANSITION_TYPED) ? 20 : 1;
+ (visits[i].second == ui::PAGE_TRANSITION_TYPED) ? 20 : 1;
if (bookmarked)
value_of_transition = std::max(value_of_transition, bookmark_value_);
const float bucket_weight =
diff --git a/chrome/browser/history/scored_history_match_unittest.cc b/chrome/browser/history/scored_history_match_unittest.cc
index b653a9b..4989966 100644
--- a/chrome/browser/history/scored_history_match_unittest.cc
+++ b/chrome/browser/history/scored_history_match_unittest.cc
@@ -25,7 +25,7 @@ VisitInfoVector CreateVisitInfoVector(int num_visits,
for (int i = 0; i < num_visits; ++i) {
visits.push_back(
std::make_pair(now - base::TimeDelta::FromDays(i * frequency),
- content::PAGE_TRANSITION_LINK));
+ ui::PAGE_TRANSITION_LINK));
}
return visits;
}
@@ -122,7 +122,7 @@ TEST_F(ScoredHistoryMatchTest, Scoring) {
WordStarts one_word_no_offset(1, 0u);
VisitInfoVector visits_a = CreateVisitInfoVector(3, 30, now);
// Mark one visit as typed.
- visits_a[0].second = content::PAGE_TRANSITION_TYPED;
+ visits_a[0].second = ui::PAGE_TRANSITION_TYPED;
ScoredHistoryMatch scored_a(row_a, visits_a, std::string(),
ASCIIToUTF16("abc"), Make1Term("abc"),
one_word_no_offset, word_starts_a, now, NULL);
@@ -132,7 +132,7 @@ TEST_F(ScoredHistoryMatchTest, Scoring) {
RowWordStarts word_starts_b;
PopulateWordStarts(row_b, &word_starts_b);
VisitInfoVector visits_b = CreateVisitInfoVector(10, 30, now);
- visits_b[0].second = content::PAGE_TRANSITION_TYPED;
+ visits_b[0].second = ui::PAGE_TRANSITION_TYPED;
ScoredHistoryMatch scored_b(row_b, visits_b, std::string(),
ASCIIToUTF16("abc"), Make1Term("abc"),
one_word_no_offset, word_starts_b, now, NULL);
@@ -143,7 +143,7 @@ TEST_F(ScoredHistoryMatchTest, Scoring) {
RowWordStarts word_starts_c;
PopulateWordStarts(row_c, &word_starts_c);
VisitInfoVector visits_c = CreateVisitInfoVector(3, 10, now);
- visits_c[0].second = content::PAGE_TRANSITION_TYPED;
+ visits_c[0].second = ui::PAGE_TRANSITION_TYPED;
ScoredHistoryMatch scored_c(row_c, visits_c, std::string(),
ASCIIToUTF16("abc"), Make1Term("abc"),
one_word_no_offset, word_starts_c, now, NULL);
@@ -154,9 +154,9 @@ TEST_F(ScoredHistoryMatchTest, Scoring) {
RowWordStarts word_starts_d;
PopulateWordStarts(row_d, &word_starts_d);
VisitInfoVector visits_d = CreateVisitInfoVector(3, 30, now);
- visits_d[0].second = content::PAGE_TRANSITION_TYPED;
- visits_d[1].second = content::PAGE_TRANSITION_TYPED;
- visits_d[2].second = content::PAGE_TRANSITION_TYPED;
+ visits_d[0].second = ui::PAGE_TRANSITION_TYPED;
+ visits_d[1].second = ui::PAGE_TRANSITION_TYPED;
+ visits_d[2].second = ui::PAGE_TRANSITION_TYPED;
ScoredHistoryMatch scored_d(row_d, visits_d, std::string(),
ASCIIToUTF16("abc"), Make1Term("abc"),
one_word_no_offset, word_starts_d, now, NULL);
diff --git a/chrome/browser/history/shortcuts_database.cc b/chrome/browser/history/shortcuts_database.cc
index 3094b58..ec4c097 100644
--- a/chrome/browser/history/shortcuts_database.cc
+++ b/chrome/browser/history/shortcuts_database.cc
@@ -11,10 +11,10 @@
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "components/omnibox/autocomplete_match_type.h"
-#include "content/public/common/page_transition_types.h"
#include "sql/meta_table.h"
#include "sql/statement.h"
#include "sql/transaction.h"
+#include "ui/base/page_transition_types.h"
// Helpers --------------------------------------------------------------------
@@ -243,7 +243,7 @@ bool ShortcutsDatabase::EnsureTable() {
"ADD COLUMN transition INTEGER") &&
db_.Execute(base::StringPrintf(
"UPDATE omni_box_shortcuts SET transition = %d",
- static_cast<int>(content::PAGE_TRANSITION_TYPED)).c_str()) &&
+ static_cast<int>(ui::PAGE_TRANSITION_TYPED)).c_str()) &&
db_.Execute("ALTER TABLE omni_box_shortcuts ADD COLUMN type INTEGER") &&
db_.Execute(base::StringPrintf(
"UPDATE omni_box_shortcuts SET type = %d",
diff --git a/chrome/browser/history/shortcuts_database_unittest.cc b/chrome/browser/history/shortcuts_database_unittest.cc
index 7721f76..52324c3 100644
--- a/chrome/browser/history/shortcuts_database_unittest.cc
+++ b/chrome/browser/history/shortcuts_database_unittest.cc
@@ -13,11 +13,10 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/testing_profile.h"
#include "components/omnibox/autocomplete_match_type.h"
-#include "content/public/common/page_transition_types.h"
#include "sql/statement.h"
#include "sql/test/test_helpers.h"
-
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/base/page_transition_types.h"
using base::ASCIIToUTF16;
@@ -34,7 +33,7 @@ struct ShortcutsDatabaseTestInfo {
std::string contents_class;
std::string description;
std::string description_class;
- content::PageTransition transition;
+ ui::PageTransition transition;
AutocompleteMatchType::Type type;
std::string keyword;
int days_from_now;
@@ -42,17 +41,17 @@ struct ShortcutsDatabaseTestInfo {
} shortcut_test_db[] = {
{ "BD85DBA2-8C29-49F9-84AE-48E1E90880DF", "goog", "www.google.com",
"http://www.google.com/", "Google", "0,1,4,0", "Google", "0,1",
- content::PAGE_TRANSITION_GENERATED, AutocompleteMatchType::SEARCH_HISTORY,
+ ui::PAGE_TRANSITION_GENERATED, AutocompleteMatchType::SEARCH_HISTORY,
"google.com", 1, 100, },
{ "BD85DBA2-8C29-49F9-84AE-48E1E90880E0", "slash", "slashdot.org",
"http://slashdot.org/", "slashdot.org", "0,1",
"Slashdot - News for nerds, stuff that matters", "0,0",
- content::PAGE_TRANSITION_TYPED, AutocompleteMatchType::HISTORY_URL, "", 0,
+ ui::PAGE_TRANSITION_TYPED, AutocompleteMatchType::HISTORY_URL, "", 0,
100},
{ "BD85DBA2-8C29-49F9-84AE-48E1E90880E1", "news", "slashdot.org",
"http://slashdot.org/", "slashdot.org", "0,1",
"Slashdot - News for nerds, stuff that matters", "0,0",
- content::PAGE_TRANSITION_LINK, AutocompleteMatchType::HISTORY_TITLE, "", 0,
+ ui::PAGE_TRANSITION_LINK, AutocompleteMatchType::HISTORY_TITLE, "", 0,
5},
};
@@ -258,8 +257,8 @@ TEST(ShortcutsDatabaseMigrationTest, MigrateTableAddFillIntoEdit) {
EXPECT_EQ(statement.ColumnString(1), statement.ColumnString(0));
// The other three columns have default values.
- EXPECT_EQ(content::PAGE_TRANSITION_TYPED,
- static_cast<content::PageTransition>(statement.ColumnInt(2)));
+ EXPECT_EQ(ui::PAGE_TRANSITION_TYPED,
+ ui::PageTransitionFromInt(statement.ColumnInt(2)));
EXPECT_EQ(AutocompleteMatchType::HISTORY_TITLE,
static_cast<AutocompleteMatchType::Type>(statement.ColumnInt(3)));
EXPECT_TRUE(statement.ColumnString(4).empty());
diff --git a/chrome/browser/history/top_sites_impl_unittest.cc b/chrome/browser/history/top_sites_impl_unittest.cc
index 9cd07aa..168aa73 100644
--- a/chrome/browser/history/top_sites_impl_unittest.cc
+++ b/chrome/browser/history/top_sites_impl_unittest.cc
@@ -281,7 +281,7 @@ class TopSitesImplTest : public HistoryUnitTestBase {
redirects.push_back(url);
history_service()->AddPage(
url, base::Time::Now(), reinterpret_cast<ContextID>(1), 0, GURL(),
- redirects, content::PAGE_TRANSITION_TYPED, history::SOURCE_BROWSED,
+ redirects, ui::PAGE_TRANSITION_TYPED, history::SOURCE_BROWSED,
false);
}
@@ -291,7 +291,7 @@ class TopSitesImplTest : public HistoryUnitTestBase {
redirects.push_back(url);
history_service()->AddPage(
url, base::Time::Now(), reinterpret_cast<ContextID>(1), 0, GURL(),
- redirects, content::PAGE_TRANSITION_TYPED, history::SOURCE_BROWSED,
+ redirects, ui::PAGE_TRANSITION_TYPED, history::SOURCE_BROWSED,
false);
history_service()->SetPageTitle(url, title);
}
@@ -303,7 +303,7 @@ class TopSitesImplTest : public HistoryUnitTestBase {
base::Time time) {
history_service()->AddPage(
url, time, reinterpret_cast<ContextID>(1), 0, GURL(),
- redirects, content::PAGE_TRANSITION_TYPED, history::SOURCE_BROWSED,
+ redirects, ui::PAGE_TRANSITION_TYPED, history::SOURCE_BROWSED,
false);
history_service()->SetPageTitle(url, title);
}
diff --git a/chrome/browser/history/typed_url_syncable_service.cc b/chrome/browser/history/typed_url_syncable_service.cc
index d3f8d54..57719f1 100644
--- a/chrome/browser/history/typed_url_syncable_service.cc
+++ b/chrome/browser/history/typed_url_syncable_service.cc
@@ -151,7 +151,7 @@ void TypedUrlSyncableService::OnUrlsModified(URLRows* changed_urls) {
sync_processor_->ProcessSyncChanges(FROM_HERE, changes);
}
-void TypedUrlSyncableService::OnUrlVisited(content::PageTransition transition,
+void TypedUrlSyncableService::OnUrlVisited(ui::PageTransition transition,
URLRow* row) {
DCHECK(expected_loop_ == base::MessageLoop::current());
DCHECK(row);
@@ -245,13 +245,13 @@ bool TypedUrlSyncableService::ShouldIgnoreUrl(const GURL& url) {
}
bool TypedUrlSyncableService::ShouldSyncVisit(
- content::PageTransition page_transition,
+ ui::PageTransition page_transition,
URLRow* row) {
if (!row)
return false;
int typed_count = row->typed_count();
- content::PageTransition transition = static_cast<content::PageTransition>(
- page_transition & content::PAGE_TRANSITION_CORE_MASK);
+ ui::PageTransition transition = ui::PageTransitionFromInt(
+ page_transition & ui::PAGE_TRANSITION_CORE_MASK);
// Just use an ad-hoc criteria to determine whether to ignore this
// notification. For most users, the distribution of visits is roughly a bell
@@ -260,7 +260,7 @@ bool TypedUrlSyncableService::ShouldSyncVisit(
// suggestions. But there are relatively few URLs with > 10 visits, and those
// tend to be more broadly distributed such that there's no need to sync up
// every visit to preserve their relative ordering.
- return (transition == content::PAGE_TRANSITION_TYPED &&
+ return (transition == ui::PAGE_TRANSITION_TYPED &&
typed_count > 0 &&
(typed_count < kTypedUrlVisitThrottleThreshold ||
(typed_count % kTypedUrlVisitThrottleMultiple) == 0));
@@ -345,13 +345,13 @@ void TypedUrlSyncableService::WriteToTypedUrlSpecifics(
// Walk the passed-in visit vector and count the # of typed visits.
for (VisitVector::const_iterator visit = visits.begin();
visit != visits.end(); ++visit) {
- content::PageTransition transition = content::PageTransitionFromInt(
- visit->transition & content::PAGE_TRANSITION_CORE_MASK);
+ ui::PageTransition transition = ui::PageTransitionFromInt(
+ visit->transition & ui::PAGE_TRANSITION_CORE_MASK);
// We ignore reload visits.
- if (transition == content::PAGE_TRANSITION_RELOAD)
+ if (transition == ui::PAGE_TRANSITION_RELOAD)
continue;
++total;
- if (transition == content::PAGE_TRANSITION_TYPED)
+ if (transition == ui::PAGE_TRANSITION_TYPED)
++typed_count;
}
// We should have at least one typed visit. This can sometimes happen if
@@ -370,20 +370,20 @@ void TypedUrlSyncableService::WriteToTypedUrlSpecifics(
for (VisitVector::const_iterator visit = visits.begin();
visit != visits.end(); ++visit) {
- content::PageTransition transition = content::PageTransitionFromInt(
- visit->transition & content::PAGE_TRANSITION_CORE_MASK);
+ ui::PageTransition transition =
+ ui::PageTransitionStripQualifier(visit->transition);
// Skip reload visits.
- if (transition == content::PAGE_TRANSITION_RELOAD)
+ if (transition == ui::PAGE_TRANSITION_RELOAD)
continue;
// If we only have room for typed visits, then only add typed visits.
- if (only_typed && transition != content::PAGE_TRANSITION_TYPED)
+ if (only_typed && transition != ui::PAGE_TRANSITION_TYPED)
continue;
if (skip_count > 0) {
// We have too many entries to fit, so we need to skip the oldest ones.
// Only skip typed URLs if there are too many typed URLs to fit.
- if (only_typed || transition != content::PAGE_TRANSITION_TYPED) {
+ if (only_typed || transition != ui::PAGE_TRANSITION_TYPED) {
--skip_count;
continue;
}
@@ -400,7 +400,7 @@ void TypedUrlSyncableService::WriteToTypedUrlSpecifics(
// it's not legal to have an empty visit array (yet another workaround
// for http://crbug.com/84258).
typed_url->add_visits(url.last_visit().ToInternalValue());
- typed_url->add_visit_transitions(content::PAGE_TRANSITION_RELOAD);
+ typed_url->add_visit_transitions(ui::PAGE_TRANSITION_RELOAD);
}
CHECK_GT(typed_url->visits_size(), 0);
CHECK_LE(typed_url->visits_size(), kMaxTypedUrlVisits);
@@ -426,7 +426,7 @@ bool TypedUrlSyncableService::FixupURLAndGetVisits(
if (visits->empty()) {
DVLOG(1) << "Found empty visits for URL: " << url->url();
VisitRow visit(
- url->id(), url->last_visit(), 0, content::PAGE_TRANSITION_TYPED, 0);
+ url->id(), url->last_visit(), 0, ui::PAGE_TRANSITION_TYPED, 0);
visits->push_back(visit);
}
diff --git a/chrome/browser/history/typed_url_syncable_service.h b/chrome/browser/history/typed_url_syncable_service.h
index b696db8..c1b835f 100644
--- a/chrome/browser/history/typed_url_syncable_service.h
+++ b/chrome/browser/history/typed_url_syncable_service.h
@@ -10,12 +10,12 @@
#include "chrome/browser/history/history_notifications.h"
#include "chrome/browser/history/history_types.h"
-#include "content/public/common/page_transition_types.h"
#include "sync/api/sync_change.h"
#include "sync/api/sync_data.h"
#include "sync/api/sync_error.h"
#include "sync/api/sync_error_factory.h"
#include "sync/api/syncable_service.h"
+#include "ui/base/page_transition_types.h"
class GURL;
class TypedUrlSyncableServiceTest;
@@ -57,7 +57,7 @@ class TypedUrlSyncableService : public syncer::SyncableService {
// Called directly by HistoryBackend when local url data changes.
void OnUrlsModified(URLRows* changed_urls);
- void OnUrlVisited(content::PageTransition transition, URLRow* row);
+ void OnUrlVisited(ui::PageTransition transition, URLRow* row);
void OnUrlsDeleted(bool all_history, bool expired, URLRows* rows);
protected:
@@ -86,7 +86,7 @@ class TypedUrlSyncableService : public syncer::SyncableService {
// notification. We use this to throttle the number of sync changes we send
// to the server so we don't hit the server for every
// single typed URL visit.
- bool ShouldSyncVisit(content::PageTransition transition, URLRow* row);
+ bool ShouldSyncVisit(ui::PageTransition transition, URLRow* row);
// Utility routine that either updates an existing sync node or creates a
// new one for the passed |typed_url| if one does not already exist. Returns
diff --git a/chrome/browser/history/typed_url_syncable_service_unittest.cc b/chrome/browser/history/typed_url_syncable_service_unittest.cc
index 5ff477d..8f3b912 100644
--- a/chrome/browser/history/typed_url_syncable_service_unittest.cc
+++ b/chrome/browser/history/typed_url_syncable_service_unittest.cc
@@ -103,12 +103,12 @@ class TypedUrlSyncableServiceTest : public testing::Test {
static void AddNewestVisit(URLRow* url,
VisitVector* visits,
- content::PageTransition transition,
+ ui::PageTransition transition,
int64 visit_time);
static void AddOldestVisit(URLRow* url,
VisitVector* visits,
- content::PageTransition transition,
+ ui::PageTransition transition,
int64 visit_time);
static bool URLsEqual(URLRow& row,
@@ -166,12 +166,12 @@ URLRow TypedUrlSyncableServiceTest::MakeTypedUrlRow(
// Add a typed visit for time |last_visit|.
visits->insert(first,
VisitRow(history_url.id(), last_visit_time, 0,
- content::PAGE_TRANSITION_TYPED, 0));
+ ui::PAGE_TRANSITION_TYPED, 0));
} else {
// Add a non-typed visit for time |last_visit|.
visits->insert(first,
VisitRow(history_url.id(), last_visit_time, 0,
- content::PAGE_TRANSITION_RELOAD, 0));
+ ui::PAGE_TRANSITION_RELOAD, 0));
}
history_url.set_visit_count(visits->size());
@@ -181,13 +181,13 @@ URLRow TypedUrlSyncableServiceTest::MakeTypedUrlRow(
void TypedUrlSyncableServiceTest::AddNewestVisit(
URLRow* url,
VisitVector* visits,
- content::PageTransition transition,
+ ui::PageTransition transition,
int64 visit_time) {
base::Time time = base::Time::FromInternalValue(visit_time);
visits->insert(visits->begin(),
VisitRow(url->id(), time, 0, transition, 0));
- if (transition == content::PAGE_TRANSITION_TYPED) {
+ if (transition == ui::PAGE_TRANSITION_TYPED) {
url->set_typed_count(url->typed_count() + 1);
}
@@ -198,12 +198,12 @@ void TypedUrlSyncableServiceTest::AddNewestVisit(
void TypedUrlSyncableServiceTest::AddOldestVisit(
URLRow* url,
VisitVector* visits,
- content::PageTransition transition,
+ ui::PageTransition transition,
int64 visit_time) {
base::Time time = base::Time::FromInternalValue(visit_time);
visits->push_back(VisitRow(url->id(), time, 0, transition, 0));
- if (transition == content::PAGE_TRANSITION_TYPED) {
+ if (transition == ui::PAGE_TRANSITION_TYPED) {
url->set_typed_count(url->typed_count() + 1);
}
@@ -311,7 +311,7 @@ TEST_F(TypedUrlSyncableServiceTest, UpdateLocalTypedUrlAndSync) {
VisitVector visits = visit_vectors.front();
URLRows changed_urls;
- AddNewestVisit(&url_row, &visits, content::PAGE_TRANSITION_TYPED, 7);
+ AddNewestVisit(&url_row, &visits, ui::PAGE_TRANSITION_TYPED, 7);
static_cast<TestHistoryBackend*>(fake_history_backend_.get())->
SetVisitsForUrl(url_row.id(), &visits);
changed_urls.push_back(url_row);
@@ -363,11 +363,11 @@ TEST_F(TypedUrlSyncableServiceTest, LinkVisitLocalTypedUrlAndSync) {
VisitVector visits = visit_vectors.front();
// Update the URL row, adding a non-typed visit to the visit vector.
- AddNewestVisit(&url_row, &visits, content::PAGE_TRANSITION_LINK, 6);
+ AddNewestVisit(&url_row, &visits, ui::PAGE_TRANSITION_LINK, 6);
static_cast<TestHistoryBackend*>(fake_history_backend_.get())->
SetVisitsForUrl(url_row.id(), &visits);
- content::PageTransition transition = content::PAGE_TRANSITION_LINK;
+ ui::PageTransition transition = ui::PAGE_TRANSITION_LINK;
// Notify typed url sync service of non-typed visit, expect no change.
typed_url_sync_service_->OnUrlVisited(transition, &url_row);
ASSERT_EQ(0u, changes.size());
@@ -387,14 +387,14 @@ TEST_F(TypedUrlSyncableServiceTest, TypedVisitLocalTypedUrlAndSync) {
VisitVector visits = visit_vectors.front();
// Update the URL row, adding another typed visit to the visit vector.
- AddOldestVisit(&url_row, &visits, content::PAGE_TRANSITION_LINK, 1);
- AddNewestVisit(&url_row, &visits, content::PAGE_TRANSITION_LINK, 6);
- AddNewestVisit(&url_row, &visits, content::PAGE_TRANSITION_TYPED, 7);
+ AddOldestVisit(&url_row, &visits, ui::PAGE_TRANSITION_LINK, 1);
+ AddNewestVisit(&url_row, &visits, ui::PAGE_TRANSITION_LINK, 6);
+ AddNewestVisit(&url_row, &visits, ui::PAGE_TRANSITION_TYPED, 7);
static_cast<TestHistoryBackend*>(fake_history_backend_.get())->
SetVisitsForUrl(url_row.id(), &visits);
// Notify typed url sync service of typed visit.
- content::PageTransition transition = content::PAGE_TRANSITION_TYPED;
+ ui::PageTransition transition = ui::PAGE_TRANSITION_TYPED;
typed_url_sync_service_->OnUrlVisited(transition, &url_row);
ASSERT_EQ(1u, changes.size());
@@ -541,17 +541,17 @@ TEST_F(TypedUrlSyncableServiceTest, MaxVisitLocalTypedUrlAndSync) {
// non-typed visits are expected to be skipped.
int i = 1;
for (; i <= kMaxTypedUrlVisits - 20; ++i)
- AddNewestVisit(&url_row, &visits, content::PAGE_TRANSITION_TYPED, i);
+ AddNewestVisit(&url_row, &visits, ui::PAGE_TRANSITION_TYPED, i);
for (; i <= kMaxTypedUrlVisits; ++i)
- AddNewestVisit(&url_row, &visits, content::PAGE_TRANSITION_LINK, i);
+ AddNewestVisit(&url_row, &visits, ui::PAGE_TRANSITION_LINK, i);
for (; i <= kMaxTypedUrlVisits + 10; ++i)
- AddNewestVisit(&url_row, &visits, content::PAGE_TRANSITION_TYPED, i);
+ AddNewestVisit(&url_row, &visits, ui::PAGE_TRANSITION_TYPED, i);
static_cast<TestHistoryBackend*>(fake_history_backend_.get())->
SetVisitsForUrl(url_row.id(), &visits);
// Notify typed url sync service of typed visit.
- content::PageTransition transition = content::PAGE_TRANSITION_TYPED;
+ ui::PageTransition transition = ui::PAGE_TRANSITION_TYPED;
typed_url_sync_service_->OnUrlVisited(transition, &url_row);
const syncer::SyncChangeList& changes = fake_change_processor_->changes();
@@ -568,7 +568,7 @@ TEST_F(TypedUrlSyncableServiceTest, MaxVisitLocalTypedUrlAndSync) {
int num_other_visits_synced = 0;
int r = url_specifics.visits_size() - 1;
for (int i = 0; i < url_specifics.visits_size(); ++i, --r) {
- if (url_specifics.visit_transitions(i) == content::PAGE_TRANSITION_TYPED) {
+ if (url_specifics.visit_transitions(i) == ui::PAGE_TRANSITION_TYPED) {
++num_typed_visits_synced;
} else {
++num_other_visits_synced;
@@ -592,13 +592,13 @@ TEST_F(TypedUrlSyncableServiceTest, ThrottleVisitLocalTypedUrlSync) {
// Add enough visits to the url so that typed count is above the throttle
// limit, and not right on the interval that gets synced.
for (int i = 1; i < 42; ++i)
- AddNewestVisit(&url_row, &visits, content::PAGE_TRANSITION_TYPED, i);
+ AddNewestVisit(&url_row, &visits, ui::PAGE_TRANSITION_TYPED, i);
static_cast<TestHistoryBackend*>(fake_history_backend_.get())->
SetVisitsForUrl(url_row.id(), &visits);
// Notify typed url sync service of typed visit.
- content::PageTransition transition = content::PAGE_TRANSITION_TYPED;
+ ui::PageTransition transition = ui::PAGE_TRANSITION_TYPED;
typed_url_sync_service_->OnUrlVisited(transition, &url_row);
// Should throttle, so sync and local cache should not update.
diff --git a/chrome/browser/history/url_index_private_data.cc b/chrome/browser/history/url_index_private_data.cc
index 232bc1f..b2aea16 100644
--- a/chrome/browser/history/url_index_private_data.cc
+++ b/chrome/browser/history/url_index_private_data.cc
@@ -1182,8 +1182,7 @@ bool URLIndexPrivateData::RestoreHistoryInfoMap(
for (int i = 0; i < iter->visits_size(); ++i) {
visits.push_back(std::make_pair(
base::Time::FromInternalValue(iter->visits(i).visit_time()),
- static_cast<content::PageTransition>(iter->visits(i).
- transition_type())));
+ ui::PageTransitionFromInt(iter->visits(i).transition_type())));
}
history_info_map_[history_id].visits = visits;
}
diff --git a/chrome/browser/history/visit_database.cc b/chrome/browser/history/visit_database.cc
index b2a4695..9a14490 100644
--- a/chrome/browser/history/visit_database.cc
+++ b/chrome/browser/history/visit_database.cc
@@ -14,8 +14,8 @@
#include "chrome/browser/history/visit_filter.h"
#include "chrome/common/url_constants.h"
#include "components/history/core/browser/url_database.h"
-#include "content/public/common/page_transition_types.h"
#include "sql/statement.h"
+#include "ui/base/page_transition_types.h"
namespace history {
@@ -87,7 +87,7 @@ void VisitDatabase::FillVisitRow(sql::Statement& statement, VisitRow* visit) {
visit->url_id = statement.ColumnInt64(1);
visit->visit_time = base::Time::FromInternalValue(statement.ColumnInt64(2));
visit->referring_visit = statement.ColumnInt64(3);
- visit->transition = content::PageTransitionFromInt(statement.ColumnInt(4));
+ visit->transition = ui::PageTransitionFromInt(statement.ColumnInt(4));
visit->segment_id = statement.ColumnInt64(5);
visit->visit_duration =
base::TimeDelta::FromInternalValue(statement.ColumnInt64(6));
@@ -271,11 +271,11 @@ bool VisitDatabase::GetVisibleVisitsForURL(URLID url_id,
statement.BindInt64(0, url_id);
statement.BindInt64(1, options.EffectiveBeginTime());
statement.BindInt64(2, options.EffectiveEndTime());
- statement.BindInt(3, content::PAGE_TRANSITION_CHAIN_END);
- statement.BindInt(4, content::PAGE_TRANSITION_CORE_MASK);
- statement.BindInt(5, content::PAGE_TRANSITION_AUTO_SUBFRAME);
- statement.BindInt(6, content::PAGE_TRANSITION_MANUAL_SUBFRAME);
- statement.BindInt(7, content::PAGE_TRANSITION_KEYWORD_GENERATED);
+ statement.BindInt(3, ui::PAGE_TRANSITION_CHAIN_END);
+ statement.BindInt(4, ui::PAGE_TRANSITION_CORE_MASK);
+ statement.BindInt(5, ui::PAGE_TRANSITION_AUTO_SUBFRAME);
+ statement.BindInt(6, ui::PAGE_TRANSITION_MANUAL_SUBFRAME);
+ statement.BindInt(7, ui::PAGE_TRANSITION_KEYWORD_GENERATED);
return FillVisitVectorWithOptions(statement, options, visits);
}
@@ -323,7 +323,7 @@ bool VisitDatabase::GetVisitsInRangeForTransition(
base::Time begin_time,
base::Time end_time,
int max_results,
- content::PageTransition transition,
+ ui::PageTransition transition,
VisitVector* visits) {
DCHECK(visits);
visits->clear();
@@ -338,7 +338,7 @@ bool VisitDatabase::GetVisitsInRangeForTransition(
int64 end = end_time.ToInternalValue();
statement.BindInt64(0, begin_time.ToInternalValue());
statement.BindInt64(1, end ? end : std::numeric_limits<int64>::max());
- statement.BindInt(2, content::PAGE_TRANSITION_CORE_MASK);
+ statement.BindInt(2, ui::PAGE_TRANSITION_CORE_MASK);
statement.BindInt(3, transition);
statement.BindInt64(4,
max_results ? max_results : std::numeric_limits<int64>::max());
@@ -361,11 +361,11 @@ bool VisitDatabase::GetVisibleVisitsInRange(const QueryOptions& options,
statement.BindInt64(0, options.EffectiveBeginTime());
statement.BindInt64(1, options.EffectiveEndTime());
- statement.BindInt(2, content::PAGE_TRANSITION_CHAIN_END);
- statement.BindInt(3, content::PAGE_TRANSITION_CORE_MASK);
- statement.BindInt(4, content::PAGE_TRANSITION_AUTO_SUBFRAME);
- statement.BindInt(5, content::PAGE_TRANSITION_MANUAL_SUBFRAME);
- statement.BindInt(6, content::PAGE_TRANSITION_KEYWORD_GENERATED);
+ statement.BindInt(2, ui::PAGE_TRANSITION_CHAIN_END);
+ statement.BindInt(3, ui::PAGE_TRANSITION_CORE_MASK);
+ statement.BindInt(4, ui::PAGE_TRANSITION_AUTO_SUBFRAME);
+ statement.BindInt(5, ui::PAGE_TRANSITION_MANUAL_SUBFRAME);
+ statement.BindInt(6, ui::PAGE_TRANSITION_KEYWORD_GENERATED);
return FillVisitVectorWithOptions(statement, options, visits);
}
@@ -387,10 +387,10 @@ void VisitDatabase::GetDirectVisitsDuringTimes(const VisitFilter& time_filter,
statement.BindInt64(0, it->first.ToInternalValue());
statement.BindInt64(1, it->second.ToInternalValue());
- statement.BindInt(2, content::PAGE_TRANSITION_CHAIN_START);
- statement.BindInt(3, content::PAGE_TRANSITION_CORE_MASK);
- statement.BindInt(4, content::PAGE_TRANSITION_TYPED);
- statement.BindInt(5, content::PAGE_TRANSITION_AUTO_BOOKMARK);
+ statement.BindInt(2, ui::PAGE_TRANSITION_CHAIN_START);
+ statement.BindInt(3, ui::PAGE_TRANSITION_CORE_MASK);
+ statement.BindInt(4, ui::PAGE_TRANSITION_TYPED);
+ statement.BindInt(5, ui::PAGE_TRANSITION_AUTO_BOOKMARK);
while (statement.Step()) {
VisitRow visit;
@@ -451,7 +451,7 @@ bool VisitDatabase::GetRedirectFromVisit(VisitID from_visit,
"WHERE v.from_visit = ? "
"AND (v.transition & ?) != 0")); // IS_REDIRECT_MASK
statement.BindInt64(0, from_visit);
- statement.BindInt(1, content::PAGE_TRANSITION_IS_REDIRECT_MASK);
+ statement.BindInt(1, ui::PAGE_TRANSITION_IS_REDIRECT_MASK);
if (!statement.Step())
return false; // No redirect from this visit. (Or SQL error)
@@ -516,11 +516,11 @@ bool VisitDatabase::GetVisibleVisitCountToHost(const GURL& url,
statement.BindString(0, host_query_min);
statement.BindString(1,
host_query_min.substr(0, host_query_min.size() - 1) + '0');
- statement.BindInt(2, content::PAGE_TRANSITION_CHAIN_END);
- statement.BindInt(3, content::PAGE_TRANSITION_CORE_MASK);
- statement.BindInt(4, content::PAGE_TRANSITION_AUTO_SUBFRAME);
- statement.BindInt(5, content::PAGE_TRANSITION_MANUAL_SUBFRAME);
- statement.BindInt(6, content::PAGE_TRANSITION_KEYWORD_GENERATED);
+ statement.BindInt(2, ui::PAGE_TRANSITION_CHAIN_END);
+ statement.BindInt(3, ui::PAGE_TRANSITION_CORE_MASK);
+ statement.BindInt(4, ui::PAGE_TRANSITION_AUTO_SUBFRAME);
+ statement.BindInt(5, ui::PAGE_TRANSITION_MANUAL_SUBFRAME);
+ statement.BindInt(6, ui::PAGE_TRANSITION_KEYWORD_GENERATED);
if (!statement.Step()) {
// We've never been to this page before.
@@ -617,7 +617,7 @@ void VisitDatabase::GetBriefVisitInfoOfMostRecentVisits(
BriefVisitInfo info;
info.url_id = statement.ColumnInt64(0);
info.time = base::Time::FromInternalValue(statement.ColumnInt64(1));
- info.transition = content::PageTransitionFromInt(statement.ColumnInt(2));
+ info.transition = ui::PageTransitionFromInt(statement.ColumnInt(2));
result_vector->push_back(info);
}
}
diff --git a/chrome/browser/history/visit_database.h b/chrome/browser/history/visit_database.h
index e00f509..b8a175e 100644
--- a/chrome/browser/history/visit_database.h
+++ b/chrome/browser/history/visit_database.h
@@ -100,7 +100,7 @@ class VisitDatabase {
bool GetVisitsInRangeForTransition(base::Time begin_time,
base::Time end_time,
int max_results,
- content::PageTransition transition,
+ ui::PageTransition transition,
VisitVector* visits);
// Fills all visits in the given time range into the given vector that should
diff --git a/chrome/browser/history/visit_database_unittest.cc b/chrome/browser/history/visit_database_unittest.cc
index 28c68dc..a47e05e 100644
--- a/chrome/browser/history/visit_database_unittest.cc
+++ b/chrome/browser/history/visit_database_unittest.cc
@@ -71,19 +71,19 @@ class VisitDatabaseTest : public PlatformTest,
TEST_F(VisitDatabaseTest, Add) {
// Add one visit.
- VisitRow visit_info1(1, Time::Now(), 0, content::PAGE_TRANSITION_LINK, 0);
+ VisitRow visit_info1(1, Time::Now(), 0, ui::PAGE_TRANSITION_LINK, 0);
EXPECT_TRUE(AddVisit(&visit_info1, SOURCE_BROWSED));
// Add second visit for the same page.
VisitRow visit_info2(visit_info1.url_id,
visit_info1.visit_time + TimeDelta::FromSeconds(1), 1,
- content::PAGE_TRANSITION_TYPED, 0);
+ ui::PAGE_TRANSITION_TYPED, 0);
EXPECT_TRUE(AddVisit(&visit_info2, SOURCE_BROWSED));
// Add third visit for a different page.
VisitRow visit_info3(2,
visit_info1.visit_time + TimeDelta::FromSeconds(2), 0,
- content::PAGE_TRANSITION_LINK, 0);
+ ui::PAGE_TRANSITION_LINK, 0);
EXPECT_TRUE(AddVisit(&visit_info3, SOURCE_BROWSED));
// Query the first two.
@@ -102,17 +102,17 @@ TEST_F(VisitDatabaseTest, Delete) {
// should link them.
static const int kTime1 = 1000;
VisitRow visit_info1(1, Time::FromInternalValue(kTime1), 0,
- content::PAGE_TRANSITION_LINK, 0);
+ ui::PAGE_TRANSITION_LINK, 0);
EXPECT_TRUE(AddVisit(&visit_info1, SOURCE_BROWSED));
static const int kTime2 = kTime1 + 1;
VisitRow visit_info2(1, Time::FromInternalValue(kTime2),
- visit_info1.visit_id, content::PAGE_TRANSITION_LINK, 0);
+ visit_info1.visit_id, ui::PAGE_TRANSITION_LINK, 0);
EXPECT_TRUE(AddVisit(&visit_info2, SOURCE_BROWSED));
static const int kTime3 = kTime2 + 1;
VisitRow visit_info3(1, Time::FromInternalValue(kTime3),
- visit_info2.visit_id, content::PAGE_TRANSITION_LINK, 0);
+ visit_info2.visit_id, ui::PAGE_TRANSITION_LINK, 0);
EXPECT_TRUE(AddVisit(&visit_info3, SOURCE_BROWSED));
// First make sure all the visits are there.
@@ -138,13 +138,13 @@ TEST_F(VisitDatabaseTest, Delete) {
TEST_F(VisitDatabaseTest, Update) {
// Make something in the database.
- VisitRow original(1, Time::Now(), 23, content::PageTransitionFromInt(0), 19);
+ VisitRow original(1, Time::Now(), 23, ui::PageTransitionFromInt(0), 19);
AddVisit(&original, SOURCE_BROWSED);
// Mutate that row.
VisitRow modification(original);
modification.url_id = 2;
- modification.transition = content::PAGE_TRANSITION_TYPED;
+ modification.transition = ui::PAGE_TRANSITION_TYPED;
modification.visit_time = Time::Now() + TimeDelta::FromDays(1);
modification.referring_visit = 9292;
UpdateVisitRow(modification);
@@ -166,48 +166,48 @@ std::vector<VisitRow> GetTestVisitRows() {
// Add one visit.
VisitRow visit_info1(1, base_time + TimeDelta::FromMinutes(1), 0,
- static_cast<content::PageTransition>(
- content::PAGE_TRANSITION_LINK |
- content::PAGE_TRANSITION_CHAIN_START |
- content::PAGE_TRANSITION_CHAIN_END),
+ ui::PageTransitionFromInt(
+ ui::PAGE_TRANSITION_LINK |
+ ui::PAGE_TRANSITION_CHAIN_START |
+ ui::PAGE_TRANSITION_CHAIN_END),
0);
visit_info1.visit_id = 1;
// Add second visit for the same page.
VisitRow visit_info2(visit_info1.url_id,
visit_info1.visit_time + TimeDelta::FromSeconds(1), 1,
- static_cast<content::PageTransition>(
- content::PAGE_TRANSITION_TYPED |
- content::PAGE_TRANSITION_CHAIN_START |
- content::PAGE_TRANSITION_CHAIN_END),
+ ui::PageTransitionFromInt(
+ ui::PAGE_TRANSITION_TYPED |
+ ui::PAGE_TRANSITION_CHAIN_START |
+ ui::PAGE_TRANSITION_CHAIN_END),
0);
visit_info2.visit_id = 2;
// Add third visit for a different page.
VisitRow visit_info3(2,
visit_info1.visit_time + TimeDelta::FromSeconds(2), 0,
- static_cast<content::PageTransition>(
- content::PAGE_TRANSITION_LINK |
- content::PAGE_TRANSITION_CHAIN_START),
+ ui::PageTransitionFromInt(
+ ui::PAGE_TRANSITION_LINK |
+ ui::PAGE_TRANSITION_CHAIN_START),
0);
visit_info3.visit_id = 3;
// Add a redirect visit from the last page.
VisitRow visit_info4(3,
visit_info1.visit_time + TimeDelta::FromSeconds(3), visit_info3.visit_id,
- static_cast<content::PageTransition>(
- content::PAGE_TRANSITION_SERVER_REDIRECT |
- content::PAGE_TRANSITION_CHAIN_END),
+ ui::PageTransitionFromInt(
+ ui::PAGE_TRANSITION_SERVER_REDIRECT |
+ ui::PAGE_TRANSITION_CHAIN_END),
0);
visit_info4.visit_id = 4;
// Add a subframe visit.
VisitRow visit_info5(4,
visit_info1.visit_time + TimeDelta::FromSeconds(4), visit_info4.visit_id,
- static_cast<content::PageTransition>(
- content::PAGE_TRANSITION_AUTO_SUBFRAME |
- content::PAGE_TRANSITION_CHAIN_START |
- content::PAGE_TRANSITION_CHAIN_END),
+ ui::PageTransitionFromInt(
+ ui::PAGE_TRANSITION_AUTO_SUBFRAME |
+ ui::PAGE_TRANSITION_CHAIN_START |
+ ui::PAGE_TRANSITION_CHAIN_END),
0);
visit_info5.visit_id = 5;
@@ -215,10 +215,10 @@ std::vector<VisitRow> GetTestVisitRows() {
// later than visit 2.
VisitRow visit_info6(visit_info1.url_id,
visit_info2.visit_time + TimeDelta::FromDays(1), 1,
- static_cast<content::PageTransition>(
- content::PAGE_TRANSITION_TYPED |
- content::PAGE_TRANSITION_CHAIN_START |
- content::PAGE_TRANSITION_CHAIN_END),
+ ui::PageTransitionFromInt(
+ ui::PAGE_TRANSITION_TYPED |
+ ui::PAGE_TRANSITION_CHAIN_START |
+ ui::PAGE_TRANSITION_CHAIN_END),
0);
visit_info6.visit_id = 6;
@@ -355,13 +355,13 @@ TEST_F(VisitDatabaseTest, GetVisibleVisitsInRange) {
TEST_F(VisitDatabaseTest, VisitSource) {
// Add visits.
- VisitRow visit_info1(111, Time::Now(), 0, content::PAGE_TRANSITION_LINK, 0);
+ VisitRow visit_info1(111, Time::Now(), 0, ui::PAGE_TRANSITION_LINK, 0);
ASSERT_TRUE(AddVisit(&visit_info1, SOURCE_BROWSED));
- VisitRow visit_info2(112, Time::Now(), 1, content::PAGE_TRANSITION_TYPED, 0);
+ VisitRow visit_info2(112, Time::Now(), 1, ui::PAGE_TRANSITION_TYPED, 0);
ASSERT_TRUE(AddVisit(&visit_info2, SOURCE_SYNCED));
- VisitRow visit_info3(113, Time::Now(), 0, content::PAGE_TRANSITION_TYPED, 0);
+ VisitRow visit_info3(113, Time::Now(), 0, ui::PAGE_TRANSITION_TYPED, 0);
ASSERT_TRUE(AddVisit(&visit_info3, SOURCE_EXTENSION));
// Query each visit.