summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-19 21:14:50 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-19 21:14:50 +0000
commitc96d2673e03f87d0a39efe047df517a87fdd9ec7 (patch)
tree75e2362bcae09b90598fa2c17a19c6ad5c9306bf /chrome/browser/autocomplete
parent041591e177a759271eaf6b334a87f678bb2e9d62 (diff)
downloadchromium_src-c96d2673e03f87d0a39efe047df517a87fdd9ec7.zip
chromium_src-c96d2673e03f87d0a39efe047df517a87fdd9ec7.tar.gz
chromium_src-c96d2673e03f87d0a39efe047df517a87fdd9ec7.tar.bz2
Revert 56742 - A new field to describe the sources of history urls(visits) is added. This field is recorded in visit_database.
So far, it can tell imported, synchronized, entension added or other(mainly testing) entries from user browsed entries. In the future, history extension API may allow queries to combinate with this criterion. BUG=none TEST=Unit tests are already included. Please test the web browser with history from previous versions to make sure the migration could be done properly. Also try to import or sync some history and inspect the sources added to the visit_source table in hitory database are correct. Original review=http://codereview.chromium.org/2906004/show Patch by weili@google.com TBR=brettw@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56754 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc3
-rw-r--r--chrome/browser/autocomplete/history_contents_provider_unittest.cc3
-rw-r--r--chrome/browser/autocomplete/history_url_provider_unittest.cc9
-rw-r--r--chrome/browser/autocomplete/search_provider_unittest.cc6
4 files changed, 7 insertions, 14 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc b/chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc
index e1dc676..6452f2f 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc
@@ -233,8 +233,7 @@ class AutocompleteEditViewTest : public InProcessBrowserTest,
Time t = Time::Now() - TimeDelta::FromHours(i + 1);
history_service->AddPageWithDetails(url, UTF8ToUTF16(cur.title),
cur.visit_count,
- cur.typed_count, t, false,
- history::SOURCE_BROWSED);
+ cur.typed_count, t, false);
history_service->SetPageContents(url, UTF8ToUTF16(cur.body));
if (cur.starred) {
bookmark_model->SetURLStarred(url, string16(), true);
diff --git a/chrome/browser/autocomplete/history_contents_provider_unittest.cc b/chrome/browser/autocomplete/history_contents_provider_unittest.cc
index 21e91fa..9212bce 100644
--- a/chrome/browser/autocomplete/history_contents_provider_unittest.cc
+++ b/chrome/browser/autocomplete/history_contents_provider_unittest.cc
@@ -73,8 +73,7 @@ class HistoryContentsProviderTest : public testing::Test,
Time t = Time::Now() - TimeDelta::FromDays(arraysize(test_entries) + i);
history_service->AddPage(url, t, id_scope, i, GURL(),
- PageTransition::LINK, history::RedirectList(),
- history::SOURCE_BROWSED, false);
+ PageTransition::LINK, history::RedirectList(), false);
history_service->SetPageTitle(url, UTF8ToUTF16(test_entries[i].title));
history_service->SetPageContents(url, UTF8ToUTF16(test_entries[i].body));
}
diff --git a/chrome/browser/autocomplete/history_url_provider_unittest.cc b/chrome/browser/autocomplete/history_url_provider_unittest.cc
index 393cd62..d3ab9c3 100644
--- a/chrome/browser/autocomplete/history_url_provider_unittest.cc
+++ b/chrome/browser/autocomplete/history_url_provider_unittest.cc
@@ -175,8 +175,7 @@ void HistoryURLProviderTest::FillData() {
const GURL current_url(cur.url);
history_service_->AddPageWithDetails(current_url, UTF8ToUTF16(cur.title),
cur.visit_count, cur.typed_count,
- visit_time, false,
- history::SOURCE_BROWSED);
+ visit_time, false);
}
}
@@ -316,8 +315,7 @@ TEST_F(HistoryURLProviderTest, CullRedirects) {
history_service_->AddPageWithDetails(GURL(redirect[i].url),
UTF8ToUTF16("Title"),
redirect[i].count, redirect[i].count,
- Time::Now(), false,
- history::SOURCE_BROWSED);
+ Time::Now(), false);
}
// Create a B->C->A redirect chain, but set the visit counts such that they
@@ -329,8 +327,7 @@ TEST_F(HistoryURLProviderTest, CullRedirects) {
redirects_to_a.push_back(GURL(redirect[2].url));
redirects_to_a.push_back(GURL(redirect[0].url));
history_service_->AddPage(GURL(redirect[0].url), NULL, 0, GURL(),
- PageTransition::TYPED, redirects_to_a,
- history::SOURCE_BROWSED, true);
+ PageTransition::TYPED, redirects_to_a, true);
// Because all the results are part of a redirect chain with other results,
// all but the first one (A) should be culled. We should get the default
diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc
index da2c67e..0062657b 100644
--- a/chrome/browser/autocomplete/search_provider_unittest.cc
+++ b/chrome/browser/autocomplete/search_provider_unittest.cc
@@ -109,8 +109,7 @@ void SearchProviderTest::SetUp() {
term1_url_ = GURL(default_t_url_->url()->ReplaceSearchTerms(
*default_t_url_, UTF16ToWide(term1_), 0, std::wstring()));
history->AddPageWithDetails(term1_url_, string16(), 1, 1,
- base::Time::Now(), false,
- history::SOURCE_BROWSED);
+ base::Time::Now(), false);
history->SetKeywordSearchTermsForURL(term1_url_, default_t_url_->id(),
term1_);
@@ -127,8 +126,7 @@ void SearchProviderTest::SetUp() {
keyword_url_ = GURL(keyword_t_url_->url()->ReplaceSearchTerms(
*keyword_t_url_, UTF16ToWide(keyword_term_), 0, std::wstring()));
history->AddPageWithDetails(keyword_url_, string16(), 1, 1,
- base::Time::Now(), false,
- history::SOURCE_BROWSED);
+ base::Time::Now(), false);
history->SetKeywordSearchTermsForURL(keyword_url_, keyword_t_url_->id(),
keyword_term_);