summaryrefslogtreecommitdiffstats
path: root/chrome
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
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')
-rw-r--r--chrome/browser/autocomplete/search_provider.cc2
-rw-r--r--chrome/browser/autocomplete/search_provider.h5
-rw-r--r--chrome/browser/autocomplete/search_provider_unittest.cc2
-rw-r--r--chrome/browser/autofill/autofill_manager.h1
-rw-r--r--chrome/browser/browser_init.cc1
-rw-r--r--chrome/browser/browser_main.cc3
-rw-r--r--chrome/browser/cocoa/edit_search_engine_cocoa_controller.mm3
-rw-r--r--chrome/browser/cocoa/keyword_editor_cocoa_controller.h2
-rw-r--r--chrome/browser/cocoa/keyword_editor_cocoa_controller.mm1
-rw-r--r--chrome/browser/cocoa/keyword_editor_cocoa_controller_unittest.mm2
-rw-r--r--chrome/browser/cocoa/search_engine_list_model.mm1
-rw-r--r--chrome/browser/dom_ui/browser_options_handler.cc2
-rw-r--r--chrome/browser/dom_ui/browser_options_handler.h3
-rw-r--r--chrome/browser/dom_ui/search_engine_manager_handler.cc2
-rw-r--r--chrome/browser/extensions/extension_omnibox_apitest.cc1
-rw-r--r--chrome/browser/gtk/first_run_dialog.cc2
-rw-r--r--chrome/browser/gtk/first_run_dialog.h5
-rw-r--r--chrome/browser/gtk/keyword_editor_view.h3
-rw-r--r--chrome/browser/gtk/options/general_page_gtk.cc1
-rw-r--r--chrome/browser/gtk/options/general_page_gtk.h3
-rw-r--r--chrome/browser/history/history.cc6
-rw-r--r--chrome/browser/history/history.h8
-rw-r--r--chrome/browser/history/history_backend.cc6
-rw-r--r--chrome/browser/history/history_backend.h7
-rw-r--r--chrome/browser/history/url_database.cc6
-rw-r--r--chrome/browser/history/url_database.h8
-rw-r--r--chrome/browser/importer/ie_importer.cc1
-rw-r--r--chrome/browser/importer/importer.cc1
-rw-r--r--chrome/browser/importer/profile_writer.cc1
-rw-r--r--chrome/browser/omnibox_search_hint.cc1
-rw-r--r--chrome/browser/rlz/rlz.cc1
-rw-r--r--chrome/browser/search_engines/search_host_to_urls_map.cc2
-rw-r--r--chrome/browser/search_engines/template_url.h9
-rw-r--r--chrome/browser/search_engines/template_url_id.h11
-rw-r--r--chrome/browser/search_engines/template_url_model.cc2
-rw-r--r--chrome/browser/search_engines/template_url_model.h15
-rw-r--r--chrome/browser/search_engines/template_url_model_observer.h20
-rw-r--r--chrome/browser/search_engines/template_url_model_unittest.cc4
-rw-r--r--chrome/browser/search_engines/template_url_table_model.cc2
-rw-r--r--chrome/browser/search_engines/template_url_table_model.h3
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc1
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc1
-rw-r--r--chrome/browser/views/first_run_search_engine_view.cc1
-rw-r--r--chrome/browser/views/first_run_search_engine_view.h2
-rw-r--r--chrome/browser/views/keyword_editor_view.h5
-rw-r--r--chrome/browser/views/location_bar/location_bar_view.cc1
-rw-r--r--chrome/browser/views/location_bar/location_bar_view.h3
-rw-r--r--chrome/browser/views/options/general_page_view.cc1
-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
-rw-r--r--chrome/chrome_browser.gypi2
53 files changed, 142 insertions, 73 deletions
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index bd5063f..2c67f7d 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -333,7 +333,7 @@ void SearchProvider::StopSuggest() {
have_suggest_results_ = false;
}
-void SearchProvider::ScheduleHistoryQuery(TemplateURL::IDType search_id,
+void SearchProvider::ScheduleHistoryQuery(TemplateURLID search_id,
const std::wstring& text) {
DCHECK(!text.empty());
HistoryService* const history_service =
diff --git a/chrome/browser/autocomplete/search_provider.h b/chrome/browser/autocomplete/search_provider.h
index 71e71bd..02adb5c 100644
--- a/chrome/browser/autocomplete/search_provider.h
+++ b/chrome/browser/autocomplete/search_provider.h
@@ -25,6 +25,7 @@
#include "chrome/browser/cancelable_request.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/net/url_fetcher.h"
class Profile;
@@ -185,7 +186,7 @@ class SearchProvider : public AutocompleteProvider,
// Schedules a history query requesting past searches against the engine
// whose id is |search_id| and whose text starts with |text|.
- void ScheduleHistoryQuery(TemplateURL::IDType search_id,
+ void ScheduleHistoryQuery(TemplateURLID search_id,
const std::wstring& text);
// Called back by the history system to return searches that begin with the
@@ -283,7 +284,7 @@ class SearchProvider : public AutocompleteProvider,
// corresponds to the id of the search engine and is used in the callback to
// determine whether the request corresponds to the keyword of default
// provider.
- CancelableRequestConsumerTSimple<TemplateURL::IDType>
+ CancelableRequestConsumerTSimple<TemplateURLID>
history_request_consumer_;
// Searches in the user's history that begin with the input text.
diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc
index da2c67e..5d6c816 100644
--- a/chrome/browser/autocomplete/search_provider_unittest.cc
+++ b/chrome/browser/autocomplete/search_provider_unittest.cc
@@ -100,7 +100,7 @@ void SearchProviderTest::SetUp() {
default_t_url_->SetSuggestionsURL("http://defaultturl2/{searchTerms}", 0, 0);
turl_model->Add(default_t_url_);
turl_model->SetDefaultSearchProvider(default_t_url_);
- TemplateURL::IDType default_provider_id = default_t_url_->id();
+ TemplateURLID default_provider_id = default_t_url_->id();
ASSERT_NE(0, default_provider_id);
// Add url1, with search term term1_.
diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h
index 387e6df..304b1f0 100644
--- a/chrome/browser/autofill/autofill_manager.h
+++ b/chrome/browser/autofill/autofill_manager.h
@@ -9,6 +9,7 @@
#include <vector>
#include <string>
+#include "base/gtest_prod_util.h"
#include "base/scoped_ptr.h"
#include "base/scoped_vector.h"
#include "chrome/browser/autofill/autofill_dialog.h"
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc
index 1625732..1d404b2 100644
--- a/chrome/browser/browser_init.cc
+++ b/chrome/browser/browser_init.cc
@@ -37,6 +37,7 @@
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_process_host.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/sessions/session_restore.h"
#include "chrome/browser/sessions/session_service.h"
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index ce92751..ee69a43 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -60,6 +60,7 @@
#include "chrome/browser/profile.h"
#include "chrome/browser/profile_manager.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
#include "chrome/browser/service/service_process_control.h"
@@ -1321,7 +1322,7 @@ int BrowserMain(const MainFunctionParams& parameters) {
RegisterBlobURLRequestJobFactory();
// In unittest mode, this will do nothing. In normal mode, this will create
- // the global GoogleURLTracker and IntranetRedirectDetector instances, which
+ // the global GoogleURLTracker and IntranetRedirectDetector instances, which
// will promptly go to sleep for five and seven seconds, respectively (to
// avoid slowing startup), and wake up afterwards to see if they should do
// anything else.
diff --git a/chrome/browser/cocoa/edit_search_engine_cocoa_controller.mm b/chrome/browser/cocoa/edit_search_engine_cocoa_controller.mm
index 3d3208a..8ddff56 100644
--- a/chrome/browser/cocoa/edit_search_engine_cocoa_controller.mm
+++ b/chrome/browser/cocoa/edit_search_engine_cocoa_controller.mm
@@ -6,10 +6,11 @@
#include "app/l10n_util_mac.h"
#include "app/resource_bundle.h"
+#include "base/logging.h"
#import "base/mac_util.h"
#include "base/string16.h"
#include "base/sys_string_conversions.h"
-#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "grit/app_resources.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
diff --git a/chrome/browser/cocoa/keyword_editor_cocoa_controller.h b/chrome/browser/cocoa/keyword_editor_cocoa_controller.h
index d894957..d833cec 100644
--- a/chrome/browser/cocoa/keyword_editor_cocoa_controller.h
+++ b/chrome/browser/cocoa/keyword_editor_cocoa_controller.h
@@ -11,7 +11,7 @@
#include "chrome/browser/cocoa/table_row_nsimage_cache.h"
#include "chrome/browser/search_engines/edit_search_engine_controller.h"
#include "chrome/browser/search_engines/keyword_editor_controller.h"
-#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url_model_observer.h"
class EditSearchEngineControllerDelegate;
@class KeywordEditorCocoaController;
diff --git a/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm b/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm
index 55133cf..20a3c93 100644
--- a/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm
+++ b/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm
@@ -14,6 +14,7 @@
#import "chrome/browser/cocoa/window_size_autosaver.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/search_engines/template_url_table_model.h"
#include "chrome/common/pref_names.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/cocoa/keyword_editor_cocoa_controller_unittest.mm b/chrome/browser/cocoa/keyword_editor_cocoa_controller_unittest.mm
index 2ea9648..7c7610d 100644
--- a/chrome/browser/cocoa/keyword_editor_cocoa_controller_unittest.mm
+++ b/chrome/browser/cocoa/keyword_editor_cocoa_controller_unittest.mm
@@ -8,6 +8,8 @@
#include "chrome/browser/cocoa/browser_test_helper.h"
#include "chrome/browser/cocoa/cocoa_test_helper.h"
#import "chrome/browser/cocoa/keyword_editor_cocoa_controller.h"
+#include "chrome/browser/search_engines/template_url.h"
+#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/test/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
diff --git a/chrome/browser/cocoa/search_engine_list_model.mm b/chrome/browser/cocoa/search_engine_list_model.mm
index 50eac21..50c606c 100644
--- a/chrome/browser/cocoa/search_engine_list_model.mm
+++ b/chrome/browser/cocoa/search_engine_list_model.mm
@@ -7,6 +7,7 @@
#include "base/sys_string_conversions.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url_model_observer.h"
NSString* const kSearchEngineListModelChangedNotification =
@"kSearchEngineListModelChangedNotification";
diff --git a/chrome/browser/dom_ui/browser_options_handler.cc b/chrome/browser/dom_ui/browser_options_handler.cc
index c408459..3a91bc1 100644
--- a/chrome/browser/dom_ui/browser_options_handler.cc
+++ b/chrome/browser/dom_ui/browser_options_handler.cc
@@ -20,6 +20,8 @@
#include "chrome/browser/options_window.h"
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/search_engines/template_url.h"
+#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/installer/util/browser_distribution.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/dom_ui/browser_options_handler.h b/chrome/browser/dom_ui/browser_options_handler.h
index 722e811..0bc1ebb 100644
--- a/chrome/browser/dom_ui/browser_options_handler.h
+++ b/chrome/browser/dom_ui/browser_options_handler.h
@@ -8,11 +8,12 @@
#include "app/table_model_observer.h"
#include "chrome/browser/dom_ui/options_ui.h"
-#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url_model_observer.h"
#include "chrome/browser/shell_integration.h"
class CustomHomePagesTableModel;
class OptionsManagedBannerHandler;
+class TemplateURLModel;
// Chrome browser options page UI handler.
class BrowserOptionsHandler : public OptionsPageUIHandler,
diff --git a/chrome/browser/dom_ui/search_engine_manager_handler.cc b/chrome/browser/dom_ui/search_engine_manager_handler.cc
index 3fc9008..688ee8d 100644
--- a/chrome/browser/dom_ui/search_engine_manager_handler.cc
+++ b/chrome/browser/dom_ui/search_engine_manager_handler.cc
@@ -11,6 +11,8 @@
#include "base/values.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/search_engines/keyword_editor_controller.h"
+#include "chrome/browser/search_engines/template_url.h"
+#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/search_engines/template_url_table_model.h"
#include "chrome/common/url_constants.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/extensions/extension_omnibox_apitest.cc b/chrome/browser/extensions/extension_omnibox_apitest.cc
index 05fcb9b..ae84bc0 100644
--- a/chrome/browser/extensions/extension_omnibox_apitest.cc
+++ b/chrome/browser/extensions/extension_omnibox_apitest.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/location_bar.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_type.h"
diff --git a/chrome/browser/gtk/first_run_dialog.cc b/chrome/browser/gtk/first_run_dialog.cc
index c1ec4e7..dfe0365 100644
--- a/chrome/browser/gtk/first_run_dialog.cc
+++ b/chrome/browser/gtk/first_run_dialog.cc
@@ -16,6 +16,8 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/process_singleton.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/search_engines/template_url.h"
+#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/common/pref_names.h"
#include "chrome/installer/util/google_update_settings.h"
diff --git a/chrome/browser/gtk/first_run_dialog.h b/chrome/browser/gtk/first_run_dialog.h
index 5c3b6f4..fdd47a7 100644
--- a/chrome/browser/gtk/first_run_dialog.h
+++ b/chrome/browser/gtk/first_run_dialog.h
@@ -11,7 +11,10 @@ typedef struct _GtkWidget GtkWidget;
#include "app/gtk_signal.h"
#include "chrome/browser/first_run/first_run.h"
-#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url_model_observer.h"
+
+class TemplateURL;
+class TemplateURLModel;
class FirstRunDialog : public TemplateURLModelObserver {
public:
diff --git a/chrome/browser/gtk/keyword_editor_view.h b/chrome/browser/gtk/keyword_editor_view.h
index 9ebebad..451d635 100644
--- a/chrome/browser/gtk/keyword_editor_view.h
+++ b/chrome/browser/gtk/keyword_editor_view.h
@@ -11,9 +11,10 @@
#include "app/table_model_observer.h"
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
+#include "base/scoped_ptr.h"
#include "base/string16.h"
#include "chrome/browser/search_engines/edit_search_engine_controller.h"
-#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url_model_observer.h"
class AccessibleWidgetHelper;
class KeywordEditorController;
diff --git a/chrome/browser/gtk/options/general_page_gtk.cc b/chrome/browser/gtk/options/general_page_gtk.cc
index 2636398..fb4db2b 100644
--- a/chrome/browser/gtk/options/general_page_gtk.cc
+++ b/chrome/browser/gtk/options/general_page_gtk.cc
@@ -23,6 +23,7 @@
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/search_engines/template_url.h"
+#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
diff --git a/chrome/browser/gtk/options/general_page_gtk.h b/chrome/browser/gtk/options/general_page_gtk.h
index a9ede80..3a072ac 100644
--- a/chrome/browser/gtk/options/general_page_gtk.h
+++ b/chrome/browser/gtk/options/general_page_gtk.h
@@ -15,13 +15,14 @@
#include "chrome/browser/gtk/options/managed_prefs_banner_gtk.h"
#include "chrome/browser/options_page_base.h"
#include "chrome/browser/prefs/pref_member.h"
-#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url_model_observer.h"
#include "chrome/browser/shell_integration.h"
#include "googleurl/src/gurl.h"
class AccessibleWidgetHelper;
class CustomHomePagesTableModel;
class Profile;
+class TemplateURLModel;
class GeneralPageGtk : public OptionsPageBase,
public TemplateURLModelObserver,
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);
diff --git a/chrome/browser/importer/ie_importer.cc b/chrome/browser/importer/ie_importer.cc
index 57b095a..469f1d6 100644
--- a/chrome/browser/importer/ie_importer.cc
+++ b/chrome/browser/importer/ie_importer.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/importer/importer_bridge.h"
#include "chrome/browser/importer/importer_data_types.h"
#include "chrome/browser/password_manager/ie7_password.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/common/time_format.h"
#include "chrome/common/url_constants.h"
diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc
index 2f1a893..1b88b72 100644
--- a/chrome/browser/importer/importer.cc
+++ b/chrome/browser/importer/importer.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/importer/firefox_profile_lock.h"
#include "chrome/browser/importer/importer_bridge.h"
#include "chrome/browser/renderer_host/site_instance.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/common/notification_service.h"
diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc
index 5833f2d..93d6248 100644
--- a/chrome/browser/importer/profile_writer.cc
+++ b/chrome/browser/importer/profile_writer.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/password_manager/password_store.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
diff --git a/chrome/browser/omnibox_search_hint.cc b/chrome/browser/omnibox_search_hint.cc
index 3045b67..1a91efe 100644
--- a/chrome/browser/omnibox_search_hint.cc
+++ b/chrome/browser/omnibox_search_hint.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/location_bar.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/tab_contents/infobar_delegate.h"
#include "chrome/browser/tab_contents/tab_contents.h"
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc
index b57224e..840ce60 100644
--- a/chrome/browser/rlz/rlz.cc
+++ b/chrome/browser/rlz/rlz.cc
@@ -23,6 +23,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/profile_manager.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/env_vars.h"
diff --git a/chrome/browser/search_engines/search_host_to_urls_map.cc b/chrome/browser/search_engines/search_host_to_urls_map.cc
index 3fc228b..584ecc5 100644
--- a/chrome/browser/search_engines/search_host_to_urls_map.cc
+++ b/chrome/browser/search_engines/search_host_to_urls_map.cc
@@ -74,7 +74,7 @@ void SearchHostToURLsMap::Update(const TemplateURL* existing_turl,
RemoveNoLock(existing_turl);
// Use the information from new_values but preserve existing_turl's id.
- TemplateURL::IDType previous_id = existing_turl->id();
+ TemplateURLID previous_id = existing_turl->id();
TemplateURL* modifiable_turl = const_cast<TemplateURL*>(existing_turl);
*modifiable_turl = new_values;
modifiable_turl->set_id(previous_id);
diff --git a/chrome/browser/search_engines/template_url.h b/chrome/browser/search_engines/template_url.h
index 7c061c4..35e88d5 100644
--- a/chrome/browser/search_engines/template_url.h
+++ b/chrome/browser/search_engines/template_url.h
@@ -11,6 +11,7 @@
#include "base/gtest_prod_util.h"
#include "base/time.h"
+#include "chrome/browser/search_engines/template_url_id.h"
#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
#include "googleurl/src/gurl.h"
@@ -235,8 +236,6 @@ class TemplateURLRef {
// Describes the relevant portions of a single OSD document.
class TemplateURL {
public:
- typedef int64 IDType;
-
// Describes a single image reference. Each TemplateURL may have
// any number (including 0) of ImageRefs.
//
@@ -428,7 +427,7 @@ class TemplateURL {
// Returns the unique identifier of this TemplateURL. The unique ID is set
// by the TemplateURLModel when the TemplateURL is added to it.
- IDType id() const { return id_; }
+ TemplateURLID id() const { return id_; }
// If this TemplateURL comes from prepopulated data the prepopulate_id is > 0.
void set_prepopulate_id(int id) { prepopulate_id_ = id; }
@@ -452,7 +451,7 @@ class TemplateURL {
void InvalidateCachedValues() const;
// Unique identifier, used when archived to the database.
- void set_id(IDType id) { id_ = id;}
+ void set_id(TemplateURLID id) { id_ = id;}
std::wstring short_name_;
std::wstring description_;
@@ -471,7 +470,7 @@ class TemplateURL {
std::vector<std::wstring> languages_;
// List of supported input encodings.
std::vector<std::string> input_encodings_;
- IDType id_;
+ TemplateURLID id_;
base::Time date_created_;
int usage_count_;
TemplateURLPrepopulateData::SearchEngineType search_engine_type_;
diff --git a/chrome/browser/search_engines/template_url_id.h b/chrome/browser/search_engines/template_url_id.h
new file mode 100644
index 0000000..db607e2
--- /dev/null
+++ b/chrome/browser/search_engines/template_url_id.h
@@ -0,0 +1,11 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_ID_H_
+#define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_ID_H_
+#pragma once
+
+typedef int64 TemplateURLID;
+
+#endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_ID_H_
diff --git a/chrome/browser/search_engines/template_url_model.cc b/chrome/browser/search_engines/template_url_model.cc
index 5eb345e..b5cf1df 100644
--- a/chrome/browser/search_engines/template_url_model.cc
+++ b/chrome/browser/search_engines/template_url_model.cc
@@ -20,6 +20,8 @@
#include "chrome/browser/rlz/rlz.h"
#include "chrome/browser/search_engines/search_host_to_urls_map.h"
#include "chrome/browser/search_engines/search_terms_data.h"
+#include "chrome/browser/search_engines/template_url.h"
+#include "chrome/browser/search_engines/template_url_model_observer.h"
#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
#include "chrome/browser/search_engines/util.h"
#include "chrome/common/chrome_switches.h"
diff --git a/chrome/browser/search_engines/template_url_model.h b/chrome/browser/search_engines/template_url_model.h
index d940cbd..ab6e171 100644
--- a/chrome/browser/search_engines/template_url_model.h
+++ b/chrome/browser/search_engines/template_url_model.h
@@ -11,6 +11,7 @@
#include "base/gtest_prod_util.h"
#include "base/observer_list.h"
#include "base/scoped_ptr.h"
+#include "chrome/browser/search_engines/template_url_id.h"
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_registrar.h"
@@ -21,6 +22,7 @@ class PrefService;
class Profile;
class SearchHostToURLsMap;
class SearchTermsData;
+class TemplateURLModelObserver;
namespace history {
struct URLVisitedDetails;
@@ -47,17 +49,6 @@ struct URLVisitedDetails;
// is a WebDataService, deletion is handled by WebDataService, otherwise
// TemplateURLModel handles deletion.
-// TemplateURLModelObserver is notified whenever the set of TemplateURLs
-// are modified.
-class TemplateURLModelObserver {
- public:
- // Notification that the template url model has changed in some way.
- virtual void OnTemplateURLModelChanged() = 0;
-
- protected:
- virtual ~TemplateURLModelObserver() {}
-};
-
class TemplateURLModel : public WebDataServiceConsumer,
public NotificationObserver {
public:
@@ -378,7 +369,7 @@ class TemplateURLModel : public WebDataServiceConsumer,
// ID assigned to next TemplateURL added to this model. This is an ever
// increasing integer that is initialized from the database.
- TemplateURL::IDType next_id_;
+ TemplateURLID next_id_;
// List of extension IDs waiting for Load to have keywords registered.
std::vector<std::string> pending_extension_ids_;
diff --git a/chrome/browser/search_engines/template_url_model_observer.h b/chrome/browser/search_engines/template_url_model_observer.h
new file mode 100644
index 0000000..860c01e
--- /dev/null
+++ b/chrome/browser/search_engines/template_url_model_observer.h
@@ -0,0 +1,20 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_MODEL_OBSERVER_H_
+#define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_MODEL_OBSERVER_H_
+#pragma once
+
+// TemplateURLModelObserver is notified whenever the set of TemplateURLs
+// are modified.
+class TemplateURLModelObserver {
+ public:
+ // Notification that the template url model has changed in some way.
+ virtual void OnTemplateURLModelChanged() = 0;
+
+ protected:
+ virtual ~TemplateURLModelObserver() {}
+};
+
+#endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_MODEL_OBSERVER_H_
diff --git a/chrome/browser/search_engines/template_url_model_unittest.cc b/chrome/browser/search_engines/template_url_model_unittest.cc
index 95a18ad..c67bec9 100644
--- a/chrome/browser/search_engines/template_url_model_unittest.cc
+++ b/chrome/browser/search_engines/template_url_model_unittest.cc
@@ -12,7 +12,9 @@
#include "chrome/browser/history/history.h"
#include "chrome/browser/history/history_notifications.h"
#include "chrome/browser/search_engines/search_host_to_urls_map.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url_model_observer.h"
#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
#include "chrome/browser/webdata/web_database.h"
#include "chrome/test/testing_profile.h"
@@ -606,7 +608,7 @@ TEST_F(TemplateURLModelTest, DefaultSearchProviderLoadedFromPrefs) {
model_->Add(template_url);
- const TemplateURL::IDType id = template_url->id();
+ const TemplateURLID id = template_url->id();
model_->SetDefaultSearchProvider(template_url);
diff --git a/chrome/browser/search_engines/template_url_table_model.cc b/chrome/browser/search_engines/template_url_table_model.cc
index 6a59978..4570b25 100644
--- a/chrome/browser/search_engines/template_url_table_model.cc
+++ b/chrome/browser/search_engines/template_url_table_model.cc
@@ -16,6 +16,8 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/favicon_service.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/search_engines/template_url.h"
+#include "chrome/browser/search_engines/template_url_model.h"
#include "gfx/codec/png_codec.h"
#include "grit/app_resources.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/search_engines/template_url_table_model.h b/chrome/browser/search_engines/template_url_table_model.h
index af2f1e7..03bb43a 100644
--- a/chrome/browser/search_engines/template_url_table_model.h
+++ b/chrome/browser/search_engines/template_url_table_model.h
@@ -8,13 +8,12 @@
#include "app/table_model.h"
#include "base/string16.h"
-#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url_model_observer.h"
class ModelEntry;
class SkBitmap;
class TemplateURL;
class TemplateURLModel;
-class TemplateURLTableModel;
// TemplateURLTableModel is the TableModel implementation used by
// KeywordEditorView to show the keywords in a TableView.
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 84ba4c4..b79996e 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -32,6 +32,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_view_host.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/spellcheck_host.h"
#include "chrome/browser/spellchecker_platform_engine.h"
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index ec9e201..9e4325f 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -65,6 +65,7 @@
#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/renderer_host/web_cache_manager.h"
#include "chrome/browser/renderer_preferences_util.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_fetcher.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/sessions/session_types.h"
diff --git a/chrome/browser/views/first_run_search_engine_view.cc b/chrome/browser/views/first_run_search_engine_view.cc
index 6554fc6..3b7b137 100644
--- a/chrome/browser/views/first_run_search_engine_view.cc
+++ b/chrome/browser/views/first_run_search_engine_view.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/options_window.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/search_engines/template_url.h"
+#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
#include "gfx/canvas.h"
#include "gfx/font.h"
diff --git a/chrome/browser/views/first_run_search_engine_view.h b/chrome/browser/views/first_run_search_engine_view.h
index 72adc51..e69bb46 100644
--- a/chrome/browser/views/first_run_search_engine_view.h
+++ b/chrome/browser/views/first_run_search_engine_view.h
@@ -8,7 +8,7 @@
#include <vector>
-#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url_model_observer.h"
#include "gfx/size.h"
#include "views/controls/button/native_button.h"
#include "views/view.h"
diff --git a/chrome/browser/views/keyword_editor_view.h b/chrome/browser/views/keyword_editor_view.h
index ec4645d..b4e7736 100644
--- a/chrome/browser/views/keyword_editor_view.h
+++ b/chrome/browser/views/keyword_editor_view.h
@@ -11,7 +11,7 @@
#include "base/string16.h"
#include "chrome/browser/search_engines/edit_search_engine_controller.h"
#include "chrome/browser/search_engines/keyword_editor_controller.h"
-#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url_model_observer.h"
#include "views/controls/button/button.h"
#include "views/controls/table/table_view_observer.h"
#include "views/view.h"
@@ -28,8 +28,7 @@ class BorderView;
class SearchEngineSelectionObserver;
class SkBitmap;
-class TemplateURLModel;
-class TemplateURLTableModel;
+class TemplateURL;
// KeywordEditorView allows the user to edit keywords.
diff --git a/chrome/browser/views/location_bar/location_bar_view.cc b/chrome/browser/views/location_bar/location_bar_view.cc
index c3ef4c0..119ec4f 100644
--- a/chrome/browser/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/views/location_bar/location_bar_view.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/extensions/extension_browser_event_router.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/tab_contents/match_preview.h"
#include "chrome/browser/view_ids.h"
diff --git a/chrome/browser/views/location_bar/location_bar_view.h b/chrome/browser/views/location_bar/location_bar_view.h
index 281fee7..ccacdb0 100644
--- a/chrome/browser/views/location_bar/location_bar_view.h
+++ b/chrome/browser/views/location_bar/location_bar_view.h
@@ -14,7 +14,7 @@
#include "chrome/browser/extensions/extension_context_menu_model.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/location_bar.h"
-#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url_model_observer.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/toolbar_model.h"
#include "chrome/browser/views/extensions/extension_popup.h"
@@ -42,6 +42,7 @@ class PageActionWithBadgeView;
class Profile;
class SelectedKeywordView;
class StarView;
+class TemplateURLModel;
namespace views {
class HorizontalPainter;
diff --git a/chrome/browser/views/options/general_page_view.cc b/chrome/browser/views/options/general_page_view.cc
index d8ae49b..8bf838f 100644
--- a/chrome/browser/views/options/general_page_view.cc
+++ b/chrome/browser/views/options/general_page_view.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/browser/search_engines/template_url_model_observer.h"
#include "chrome/browser/views/keyword_editor_view.h"
#include "chrome/browser/views/options/managed_prefs_banner_view.h"
#include "chrome/browser/views/options/options_group_view.h"
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.
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 4e69cfb..cc8af50 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -2422,8 +2422,10 @@
'browser/search_engines/template_url.h',
'browser/search_engines/template_url_fetcher.cc',
'browser/search_engines/template_url_fetcher.h',
+ 'browser/search_engines/template_url_id.h',
'browser/search_engines/template_url_model.cc',
'browser/search_engines/template_url_model.h',
+ 'browser/search_engines/template_url_model_observer.h',
'browser/search_engines/template_url_parser.cc',
'browser/search_engines/template_url_parser.h',
'browser/search_engines/template_url_prepopulate_data.cc',