diff options
author | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 22:37:11 +0000 |
---|---|---|
committer | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 22:37:11 +0000 |
commit | 8b62334be15306086414ae6c490ee8a58de65338 (patch) | |
tree | abe94dd6210e914146ed1e177087320a0eb60cf5 /chrome/browser/history | |
parent | cba2196088043137c76fe1a7206506154e3c0a1d (diff) | |
download | chromium_src-8b62334be15306086414ae6c490ee8a58de65338.zip chromium_src-8b62334be15306086414ae6c490ee8a58de65338.tar.gz chromium_src-8b62334be15306086414ae6c490ee8a58de65338.tar.bz2 |
Reduce the number of files that recompile when changing template_url.h or template_url_model.h.
Separated out the TemplateURL::IDType which is now TemplateURLId into its own
file, since this was a primary reason for including template_url.h in another
header.
Similarly separate out the TemplateURLModelObserver from template_url_model.h to
reduce how often that file is included.
BUG=None
TEST=Compiling.
Review URL: http://codereview.chromium.org/3270011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58080 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history')
-rw-r--r-- | chrome/browser/history/history.cc | 6 | ||||
-rw-r--r-- | chrome/browser/history/history.h | 8 | ||||
-rw-r--r-- | chrome/browser/history/history_backend.cc | 6 | ||||
-rw-r--r-- | chrome/browser/history/history_backend.h | 7 | ||||
-rw-r--r-- | chrome/browser/history/url_database.cc | 6 | ||||
-rw-r--r-- | chrome/browser/history/url_database.h | 8 |
6 files changed, 21 insertions, 20 deletions
diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc index bc9c8e5..fb08fa0 100644 --- a/chrome/browser/history/history.cc +++ b/chrome/browser/history/history.cc @@ -239,7 +239,7 @@ void HistoryService::SetSegmentPresentationIndex(int64 segment_id, int index) { } void HistoryService::SetKeywordSearchTermsForURL(const GURL& url, - TemplateURL::IDType keyword_id, + TemplateURLID keyword_id, const string16& term) { ScheduleAndForget(PRIORITY_UI, &HistoryBackend::SetKeywordSearchTermsForURL, @@ -247,14 +247,14 @@ void HistoryService::SetKeywordSearchTermsForURL(const GURL& url, } void HistoryService::DeleteAllSearchTermsForKeyword( - TemplateURL::IDType keyword_id) { + TemplateURLID keyword_id) { ScheduleAndForget(PRIORITY_UI, &HistoryBackend::DeleteAllSearchTermsForKeyword, keyword_id); } HistoryService::Handle HistoryService::GetMostRecentKeywordSearchTerms( - TemplateURL::IDType keyword_id, + TemplateURLID keyword_id, const string16& prefix, int max_count, CancelableRequestConsumerBase* consumer, diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h index 560db1a..3d24981 100644 --- a/chrome/browser/history/history.h +++ b/chrome/browser/history/history.h @@ -18,7 +18,7 @@ #include "chrome/browser/cancelable_request.h" #include "chrome/browser/favicon_service.h" #include "chrome/browser/history/history_types.h" -#include "chrome/browser/search_engines/template_url.h" +#include "chrome/browser/search_engines/template_url_id.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/page_transition_types.h" #include "chrome/common/ref_counted_util.h" @@ -480,11 +480,11 @@ class HistoryService : public CancelableRequestProvider, // Sets the search terms for the specified url and keyword. url_id gives the // id of the url, keyword_id the id of the keyword and term the search term. void SetKeywordSearchTermsForURL(const GURL& url, - TemplateURL::IDType keyword_id, + TemplateURLID keyword_id, const string16& term); // Deletes all search terms for the specified keyword. - void DeleteAllSearchTermsForKeyword(TemplateURL::IDType keyword_id); + void DeleteAllSearchTermsForKeyword(TemplateURLID keyword_id); typedef Callback2<Handle, std::vector<history::KeywordSearchTermVisit>*>::Type GetMostRecentKeywordSearchTermsCallback; @@ -494,7 +494,7 @@ class HistoryService : public CancelableRequestProvider, // in descending order up to |max_count| with the most recent search term // first. Handle GetMostRecentKeywordSearchTerms( - TemplateURL::IDType keyword_id, + TemplateURLID keyword_id, const string16& prefix, int max_count, CancelableRequestConsumerBase* consumer, diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index a4c6ea5..db49bfb 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -1026,7 +1026,7 @@ void HistoryBackend::QuerySegmentUsage( // Keyword visits -------------------------------------------------------------- void HistoryBackend::SetKeywordSearchTermsForURL(const GURL& url, - TemplateURL::IDType keyword_id, + TemplateURLID keyword_id, const string16& term) { if (!db_.get()) return; @@ -1044,7 +1044,7 @@ void HistoryBackend::SetKeywordSearchTermsForURL(const GURL& url, } void HistoryBackend::DeleteAllSearchTermsForKeyword( - TemplateURL::IDType keyword_id) { + TemplateURLID keyword_id) { if (!db_.get()) return; @@ -1055,7 +1055,7 @@ void HistoryBackend::DeleteAllSearchTermsForKeyword( void HistoryBackend::GetMostRecentKeywordSearchTerms( scoped_refptr<GetMostRecentKeywordSearchTermsRequest> request, - TemplateURL::IDType keyword_id, + TemplateURLID keyword_id, const string16& prefix, int max_count) { if (request->canceled()) diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h index 1965bc5..96cad61 100644 --- a/chrome/browser/history/history_backend.h +++ b/chrome/browser/history/history_backend.h @@ -20,6 +20,7 @@ #include "chrome/browser/history/text_database_manager.h" #include "chrome/browser/history/thumbnail_database.h" #include "chrome/browser/history/visit_tracker.h" +#include "chrome/browser/search_engines/template_url_id.h" #include "chrome/common/mru_cache.h" class BookmarkService; @@ -237,14 +238,14 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, // Keyword search terms ------------------------------------------------------ void SetKeywordSearchTermsForURL(const GURL& url, - TemplateURL::IDType keyword_id, + TemplateURLID keyword_id, const string16& term); - void DeleteAllSearchTermsForKeyword(TemplateURL::IDType keyword_id); + void DeleteAllSearchTermsForKeyword(TemplateURLID keyword_id); void GetMostRecentKeywordSearchTerms( scoped_refptr<GetMostRecentKeywordSearchTermsRequest> request, - TemplateURL::IDType keyword_id, + TemplateURLID keyword_id, const string16& prefix, int max_count); diff --git a/chrome/browser/history/url_database.cc b/chrome/browser/history/url_database.cc index 3c4e3be..b63d24a 100644 --- a/chrome/browser/history/url_database.cc +++ b/chrome/browser/history/url_database.cc @@ -345,7 +345,7 @@ bool URLDatabase::DropKeywordSearchTermsTable() { } bool URLDatabase::SetKeywordSearchTermsForURL(URLID url_id, - TemplateURL::IDType keyword_id, + TemplateURLID keyword_id, const string16& term) { DCHECK(url_id && keyword_id && !term.empty()); @@ -373,7 +373,7 @@ bool URLDatabase::SetKeywordSearchTermsForURL(URLID url_id, } void URLDatabase::DeleteAllSearchTermsForKeyword( - TemplateURL::IDType keyword_id) { + TemplateURLID keyword_id) { DCHECK(keyword_id); sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE, "DELETE FROM keyword_search_terms WHERE keyword_id=?")); @@ -385,7 +385,7 @@ void URLDatabase::DeleteAllSearchTermsForKeyword( } void URLDatabase::GetMostRecentKeywordSearchTerms( - TemplateURL::IDType keyword_id, + TemplateURLID keyword_id, const string16& prefix, int max_count, std::vector<KeywordSearchTermVisit>* matches) { diff --git a/chrome/browser/history/url_database.h b/chrome/browser/history/url_database.h index f1582ce..36bfebb 100644 --- a/chrome/browser/history/url_database.h +++ b/chrome/browser/history/url_database.h @@ -9,7 +9,7 @@ #include "app/sql/statement.h" #include "base/basictypes.h" #include "chrome/browser/history/history_types.h" -#include "chrome/browser/search_engines/template_url.h" +#include "chrome/browser/search_engines/template_url_id.h" class GURL; @@ -160,17 +160,17 @@ class URLDatabase { // Sets the search terms for the specified url/keyword pair. bool SetKeywordSearchTermsForURL(URLID url_id, - TemplateURL::IDType keyword_id, + TemplateURLID keyword_id, const string16& term); // Deletes all search terms for the specified keyword that have been added by // way of SetKeywordSearchTermsForURL. - void DeleteAllSearchTermsForKeyword(TemplateURL::IDType keyword_id); + void DeleteAllSearchTermsForKeyword(TemplateURLID keyword_id); // Returns up to max_count of the most recent search terms for the specified // keyword. void GetMostRecentKeywordSearchTerms( - TemplateURL::IDType keyword_id, + TemplateURLID keyword_id, const string16& prefix, int max_count, std::vector<KeywordSearchTermVisit>* matches); |