summaryrefslogtreecommitdiffstats
path: root/chrome/browser/webdata
diff options
context:
space:
mode:
authorlevin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 22:37:11 +0000
committerlevin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 22:37:11 +0000
commit8b62334be15306086414ae6c490ee8a58de65338 (patch)
treeabe94dd6210e914146ed1e177087320a0eb60cf5 /chrome/browser/webdata
parentcba2196088043137c76fe1a7206506154e3c0a1d (diff)
downloadchromium_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/webdata')
-rw-r--r--chrome/browser/webdata/web_data_service.cc21
-rw-r--r--chrome/browser/webdata/web_data_service.h8
-rw-r--r--chrome/browser/webdata/web_database.cc3
-rw-r--r--chrome/browser/webdata/web_database.h7
4 files changed, 23 insertions, 16 deletions
diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc
index 0e3976b..43c6a5d 100644
--- a/chrome/browser/webdata/web_data_service.cc
+++ b/chrome/browser/webdata/web_data_service.cc
@@ -10,6 +10,7 @@
#include "base/thread.h"
#include "chrome/browser/autofill/autofill_profile.h"
#include "chrome/browser/autofill/credit_card.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/webdata/autofill_change.h"
#include "chrome/browser/webdata/autofill_entry.h"
#include "chrome/browser/webdata/web_database.h"
@@ -103,9 +104,9 @@ void WebDataService::AddKeyword(const TemplateURL& url) {
}
void WebDataService::RemoveKeyword(const TemplateURL& url) {
- GenericRequest<TemplateURL::IDType>* request =
- new GenericRequest<TemplateURL::IDType>(this, GetNextRequestHandle(),
- NULL, url.id());
+ GenericRequest<TemplateURLID>* request =
+ new GenericRequest<TemplateURLID>(this, GetNextRequestHandle(),
+ NULL, url.id());
RegisterRequest(request);
ScheduleTask(
NewRunnableMethod(this, &WebDataService::RemoveKeywordImpl, request));
@@ -135,11 +136,11 @@ WebDataService::Handle WebDataService::GetKeywords(
}
void WebDataService::SetDefaultSearchProvider(const TemplateURL* url) {
- GenericRequest<TemplateURL::IDType>* request =
- new GenericRequest<TemplateURL::IDType>(this,
- GetNextRequestHandle(),
- NULL,
- url ? url->id() : 0);
+ GenericRequest<TemplateURLID>* request =
+ new GenericRequest<TemplateURLID>(this,
+ GetNextRequestHandle(),
+ NULL,
+ url ? url->id() : 0);
RegisterRequest(request);
ScheduleTask(
NewRunnableMethod(this, &WebDataService::SetDefaultSearchProviderImpl,
@@ -635,7 +636,7 @@ void WebDataService::AddKeywordImpl(GenericRequest<TemplateURL>* request) {
}
void WebDataService::RemoveKeywordImpl(
- GenericRequest<TemplateURL::IDType>* request) {
+ GenericRequest<TemplateURLID>* request) {
InitializeDatabaseIfNecessary();
if (db_ && !request->IsCancelled()) {
DCHECK(request->GetArgument());
@@ -669,7 +670,7 @@ void WebDataService::GetKeywordsImpl(WebDataRequest* request) {
}
void WebDataService::SetDefaultSearchProviderImpl(
- GenericRequest<TemplateURL::IDType>* request) {
+ GenericRequest<TemplateURLID>* request) {
InitializeDatabaseIfNecessary();
if (db_ && !request->IsCancelled()) {
if (!db_->SetDefaultSearchProviderID(request->GetArgument()))
diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h
index 6aced50..3c572f4 100644
--- a/chrome/browser/webdata/web_data_service.h
+++ b/chrome/browser/webdata/web_data_service.h
@@ -14,18 +14,20 @@
#include "base/lock.h"
#include "base/ref_counted.h"
#include "chrome/browser/chrome_thread.h"
-#include "chrome/browser/search_engines/template_url.h"
+#include "chrome/browser/search_engines/template_url_id.h"
#include "webkit/glue/form_field.h"
class AutofillChange;
class AutoFillProfile;
class CreditCard;
+class GURL;
#if defined(OS_WIN)
struct IE7PasswordInfo;
#endif
class MessageLoop;
class SkBitmap;
class Task;
+class TemplateURL;
class WebDatabase;
namespace base {
@@ -529,10 +531,10 @@ class WebDataService
//
//////////////////////////////////////////////////////////////////////////////
void AddKeywordImpl(GenericRequest<TemplateURL>* request);
- void RemoveKeywordImpl(GenericRequest<TemplateURL::IDType>* request);
+ void RemoveKeywordImpl(GenericRequest<TemplateURLID>* request);
void UpdateKeywordImpl(GenericRequest<TemplateURL>* request);
void GetKeywordsImpl(WebDataRequest* request);
- void SetDefaultSearchProviderImpl(GenericRequest<TemplateURL::IDType>* r);
+ void SetDefaultSearchProviderImpl(GenericRequest<TemplateURLID>* r);
void SetBuiltinKeywordVersionImpl(GenericRequest<int>* r);
//////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/webdata/web_database.cc b/chrome/browser/webdata/web_database.cc
index fa325f3..694beb4 100644
--- a/chrome/browser/webdata/web_database.cc
+++ b/chrome/browser/webdata/web_database.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/autofill/credit_card.h"
#include "chrome/browser/diagnostics/sqlite_diagnostics.h"
#include "chrome/browser/history/history_database.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/webdata/autofill_change.h"
#include "chrome/common/notification_service.h"
#include "gfx/codec/png_codec.h"
@@ -853,7 +854,7 @@ bool WebDatabase::AddKeyword(const TemplateURL& url) {
return true;
}
-bool WebDatabase::RemoveKeyword(TemplateURL::IDType id) {
+bool WebDatabase::RemoveKeyword(TemplateURLID id) {
DCHECK(id);
sql::Statement s(db_.GetUniqueStatement("DELETE FROM keywords WHERE id = ?"));
if (!s) {
diff --git a/chrome/browser/webdata/web_database.h b/chrome/browser/webdata/web_database.h
index 23938a8..33df2d9 100644
--- a/chrome/browser/webdata/web_database.h
+++ b/chrome/browser/webdata/web_database.h
@@ -13,15 +13,18 @@
#include "app/sql/meta_table.h"
#include "base/gtest_prod_util.h"
#include "base/scoped_ptr.h"
-#include "chrome/browser/search_engines/template_url.h"
+#include "base/string16.h"
+#include "chrome/browser/search_engines/template_url_id.h"
class AutofillChange;
class AutofillEntry;
class AutoFillProfile;
class CreditCard;
class FilePath;
+class GURL;
class NotificationService;
class SkBitmap;
+class TemplateURL;
class WebDatabaseTest;
namespace base {
@@ -67,7 +70,7 @@ class WebDatabase {
// Removes the specified keyword.
// Returns true if successful.
- bool RemoveKeyword(TemplateURL::IDType id);
+ bool RemoveKeyword(TemplateURLID id);
// Loads the keywords into the specified vector. It's up to the caller to
// delete the returned objects.