diff options
author | naiem.shaik <naiem.shaik@gmail.com> | 2014-11-30 01:02:31 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-30 09:02:53 +0000 |
commit | b9f5bffad6a920c2f6139bc0e5f2bc91e8fc12b0 (patch) | |
tree | ddf30851265e82dcd3ffc42e0758b755a9a27508 | |
parent | b5adb1e71466bf983f647047c13e76ae29546c2a (diff) | |
download | chromium_src-b9f5bffad6a920c2f6139bc0e5f2bc91e8fc12b0.zip chromium_src-b9f5bffad6a920c2f6139bc0e5f2bc91e8fc12b0.tar.gz chromium_src-b9f5bffad6a920c2f6139bc0e5f2bc91e8fc12b0.tar.bz2 |
Move constants used by history component to history namespace.
Add history_constants.cc/h for history specific constants.
BUG=390953
TEST=unit_tests
Review URL: https://codereview.chromium.org/722723005
Cr-Commit-Position: refs/heads/master@{#306130}
17 files changed, 105 insertions, 65 deletions
diff --git a/chrome/browser/diagnostics/sqlite_diagnostics.cc b/chrome/browser/diagnostics/sqlite_diagnostics.cc index 3f98caa..b274622 100644 --- a/chrome/browser/diagnostics/sqlite_diagnostics.cc +++ b/chrome/browser/diagnostics/sqlite_diagnostics.cc @@ -18,6 +18,7 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chromeos/chromeos_constants.h" +#include "components/history/core/browser/history_constants.h" #include "components/webdata/common/webdata_constants.h" #include "content/public/common/content_constants.h" #include "sql/connection.h" @@ -219,7 +220,7 @@ DiagnosticsTest* MakeSqliteWebDatabaseTrackerDbTest() { DiagnosticsTest* MakeSqliteHistoryDbTest() { return new SqliteIntegrityTest(SqliteIntegrityTest::CRITICAL, DIAGNOSTICS_SQLITE_INTEGRITY_HISTORY_TEST, - base::FilePath(chrome::kHistoryFilename)); + base::FilePath(history::kHistoryFilename)); } #if defined(OS_CHROMEOS) @@ -243,7 +244,7 @@ DiagnosticsTest* MakeSqliteNssKeyDbTest() { DiagnosticsTest* MakeSqliteThumbnailsDbTest() { return new SqliteIntegrityTest(SqliteIntegrityTest::NO_FLAGS_SET, DIAGNOSTICS_SQLITE_INTEGRITY_THUMBNAILS_TEST, - base::FilePath(chrome::kThumbnailsFilename)); + base::FilePath(history::kThumbnailsFilename)); } DiagnosticsTest* MakeSqliteWebDataDbTest() { diff --git a/chrome/browser/history/android/android_provider_backend_unittest.cc b/chrome/browser/history/android/android_provider_backend_unittest.cc index c3b6748..6c19eaf 100644 --- a/chrome/browser/history/android/android_provider_backend_unittest.cc +++ b/chrome/browser/history/android/android_provider_backend_unittest.cc @@ -25,6 +25,7 @@ #include "chrome/test/base/testing_profile_manager.h" #include "components/bookmarks/browser/bookmark_model.h" #include "components/bookmarks/test/bookmark_test_helpers.h" +#include "components/history/core/browser/history_constants.h" #include "components/history/core/browser/keyword_search_term.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/test_browser_thread.h" @@ -191,9 +192,8 @@ class AndroidProviderBackendTest : public testing::Test { // Setup the database directory and files. ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - history_db_name_ = temp_dir_.path().AppendASCII(chrome::kHistoryFilename); - thumbnail_db_name_ = temp_dir_.path().AppendASCII( - chrome::kFaviconsFilename); + history_db_name_ = temp_dir_.path().AppendASCII(kHistoryFilename); + thumbnail_db_name_ = temp_dir_.path().AppendASCII(kFaviconsFilename); android_cache_db_name_ = temp_dir_.path().AppendASCII( "TestAndroidCache.db"); } diff --git a/chrome/browser/history/android/android_urls_database_unittest.cc b/chrome/browser/history/android/android_urls_database_unittest.cc index 91d94de..c0a1927 100644 --- a/chrome/browser/history/android/android_urls_database_unittest.cc +++ b/chrome/browser/history/android/android_urls_database_unittest.cc @@ -12,6 +12,7 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/base/testing_profile.h" +#include "components/history/core/browser/history_constants.h" namespace history { @@ -29,7 +30,7 @@ class AndroidURLsMigrationTest : public HistoryUnitTestBase { ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); data_path = data_path.AppendASCII("History"); - history_db_name_ = profile_->GetPath().Append(chrome::kHistoryFilename); + history_db_name_ = profile_->GetPath().Append(kHistoryFilename); // Set up history as they would be before migration. ASSERT_NO_FATAL_FAILURE( ExecuteSQLScript(data_path.AppendASCII("history.21.sql"), diff --git a/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc b/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc index 55fcd8a..cbbc4e4 100644 --- a/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc +++ b/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc @@ -15,6 +15,7 @@ #include "chrome/test/base/testing_profile_manager.h" #include "components/bookmarks/browser/bookmark_model.h" #include "components/bookmarks/test/bookmark_test_helpers.h" +#include "components/history/core/browser/history_constants.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/test_browser_thread.h" #include "content/public/test/test_utils.h" @@ -56,8 +57,8 @@ class BookmarkModelSQLHandlerTest : public testing::Test { // Create the directory for history database. ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - base::FilePath history_db_name = temp_dir_.path().AppendASCII( - chrome::kHistoryFilename); + base::FilePath history_db_name = + temp_dir_.path().AppendASCII(kHistoryFilename); history_db_.Init(history_db_name); } diff --git a/chrome/browser/history/android/urls_sql_handler_unittest.cc b/chrome/browser/history/android/urls_sql_handler_unittest.cc index e3ccaf0..2c49755 100644 --- a/chrome/browser/history/android/urls_sql_handler_unittest.cc +++ b/chrome/browser/history/android/urls_sql_handler_unittest.cc @@ -13,6 +13,7 @@ #include "chrome/browser/history/android/visit_sql_handler.h" #include "chrome/browser/history/history_database.h" #include "chrome/common/chrome_constants.h" +#include "components/history/core/browser/history_constants.h" #include "testing/gtest/include/gtest/gtest.h" using base::Time; @@ -32,8 +33,8 @@ class UrlsSQLHandlerTest : public testing::Test { virtual void SetUp() { // Get a temporary directory for the test DB files. ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - base::FilePath history_db_name = temp_dir_.path().AppendASCII( - chrome::kHistoryFilename); + base::FilePath history_db_name = + temp_dir_.path().AppendASCII(kHistoryFilename); ASSERT_EQ(sql::INIT_OK, history_db_.Init(history_db_name)); } diff --git a/chrome/browser/history/android/visit_sql_handler_unittest.cc b/chrome/browser/history/android/visit_sql_handler_unittest.cc index de37ec8..3061fa9 100644 --- a/chrome/browser/history/android/visit_sql_handler_unittest.cc +++ b/chrome/browser/history/android/visit_sql_handler_unittest.cc @@ -13,6 +13,7 @@ #include "chrome/browser/history/android/urls_sql_handler.h" #include "chrome/browser/history/history_database.h" #include "chrome/common/chrome_constants.h" +#include "components/history/core/browser/history_constants.h" #include "testing/gtest/include/gtest/gtest.h" using base::Time; @@ -32,8 +33,8 @@ class VisitSQLHandlerTest : public testing::Test { virtual void SetUp() { // Get a temporary directory for the test DB files. ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - base::FilePath history_db_name = temp_dir_.path().AppendASCII( - chrome::kHistoryFilename); + base::FilePath history_db_name = + temp_dir_.path().AppendASCII(kHistoryFilename); ASSERT_EQ(sql::INIT_OK, history_db_.Init(history_db_name)); } diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index 82a542a..9fb30e4 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -40,6 +40,7 @@ #include "components/favicon_base/select_favicon_frames.h" #include "components/history/core/browser/history_backend_observer.h" #include "components/history/core/browser/history_client.h" +#include "components/history/core/browser/history_constants.h" #include "components/history/core/browser/keyword_search_term.h" #include "components/history/core/browser/page_usage_data.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" @@ -262,20 +263,20 @@ void HistoryBackend::ClearCachedDataForContextID(ContextID context_id) { } base::FilePath HistoryBackend::GetThumbnailFileName() const { - return history_dir_.Append(chrome::kThumbnailsFilename); + return history_dir_.Append(history::kThumbnailsFilename); } base::FilePath HistoryBackend::GetFaviconsFileName() const { - return history_dir_.Append(chrome::kFaviconsFilename); + return history_dir_.Append(history::kFaviconsFilename); } base::FilePath HistoryBackend::GetArchivedFileName() const { - return history_dir_.Append(chrome::kArchivedHistoryFilename); + return history_dir_.Append(history::kArchivedHistoryFilename); } #if defined(OS_ANDROID) base::FilePath HistoryBackend::GetAndroidCacheFileName() const { - return history_dir_.Append(chrome::kAndroidCacheFilename); + return history_dir_.Append(history::kAndroidCacheFilename); } #endif @@ -588,7 +589,7 @@ void HistoryBackend::InitImpl(const std::string& languages) { TimeTicks beginning_time = TimeTicks::Now(); // Compute the file names. - base::FilePath history_name = history_dir_.Append(chrome::kHistoryFilename); + base::FilePath history_name = history_dir_.Append(history::kHistoryFilename); base::FilePath thumbnail_name = GetFaviconsFileName(); base::FilePath archived_name = GetArchivedFileName(); diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc index df55148..cbbcac4 100644 --- a/chrome/browser/history/history_backend_unittest.cc +++ b/chrome/browser/history/history_backend_unittest.cc @@ -31,6 +31,7 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/importer/imported_favicon_usage.h" #include "chrome/test/base/testing_profile.h" +#include "components/history/core/browser/history_constants.h" #include "components/history/core/browser/in_memory_database.h" #include "components/history/core/browser/keyword_search_term.h" #include "components/history/core/test/history_client_fake_bookmarks.h" @@ -1544,8 +1545,7 @@ TEST_F(HistoryBackendTest, MigrationVisitSource) { base::FilePath new_history_path(test_dir()); base::DeleteFile(new_history_path, true); base::CreateDirectory(new_history_path); - base::FilePath new_history_file = - new_history_path.Append(chrome::kHistoryFilename); + base::FilePath new_history_file = new_history_path.Append(kHistoryFilename); ASSERT_TRUE(base::CopyFile(old_history_path, new_history_file)); backend_ = new HistoryBackend( @@ -2797,8 +2797,7 @@ TEST_F(HistoryBackendTest, MigrationVisitDuration) { base::FilePath new_history_path(test_dir()); base::DeleteFile(new_history_path, true); base::CreateDirectory(new_history_path); - base::FilePath new_history_file = - new_history_path.Append(chrome::kHistoryFilename); + base::FilePath new_history_file = new_history_path.Append(kHistoryFilename); ASSERT_TRUE(base::CopyFile(old_history, new_history_file)); backend_ = new HistoryBackend( diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index 31c831c..80410f0 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -53,6 +53,7 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/tools/profiles/thumbnail-inl.h" +#include "components/history/core/browser/history_constants.h" #include "components/history/core/browser/in_memory_database.h" #include "components/history/core/browser/page_usage_data.h" #include "components/history/core/common/thumbnail_score.h" @@ -140,8 +141,7 @@ class HistoryBackendDBTest : public HistoryUnitTestBase { data_path = data_path.AppendASCII(base::StringPrintf("history.%d.sql", version)); ASSERT_NO_FATAL_FAILURE( - ExecuteSQLScript(data_path, history_dir_.Append( - chrome::kHistoryFilename))); + ExecuteSQLScript(data_path, history_dir_.Append(kHistoryFilename))); } void CreateArchivedDB() { @@ -149,9 +149,8 @@ class HistoryBackendDBTest : public HistoryUnitTestBase { ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_path)); data_path = data_path.AppendASCII("History"); data_path = data_path.AppendASCII("archived_history.4.sql"); - ASSERT_NO_FATAL_FAILURE( - ExecuteSQLScript(data_path, history_dir_.Append( - chrome::kArchivedHistoryFilename))); + ASSERT_NO_FATAL_FAILURE(ExecuteSQLScript( + data_path, history_dir_.Append(kArchivedHistoryFilename))); } // testing::Test @@ -288,7 +287,7 @@ TEST_F(HistoryBackendDBTest, MigrateDownloadsState) { { // Open the db for manual manipulation. sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); // Manually insert corrupted rows; there's infrastructure in place now to // make this impossible, at least according to the test above. @@ -318,7 +317,7 @@ TEST_F(HistoryBackendDBTest, MigrateDownloadsState) { { // Re-open the db for manual manipulation. sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); { // The version should have been updated. int cur_version = HistoryDatabase::GetCurrentVersion(); @@ -356,7 +355,7 @@ TEST_F(HistoryBackendDBTest, MigrateDownloadsReasonPathsAndDangerType) { { // Re-open the db for manual manipulation. sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); // Manually insert some rows. sql::Statement s(db.GetUniqueStatement( @@ -399,7 +398,7 @@ TEST_F(HistoryBackendDBTest, MigrateDownloadsReasonPathsAndDangerType) { { // Re-open the db for manual manipulation. sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); { // The version should have been updated. int cur_version = HistoryDatabase::GetCurrentVersion(); @@ -466,7 +465,7 @@ TEST_F(HistoryBackendDBTest, MigrateReferrer) { ASSERT_NO_FATAL_FAILURE(CreateDBVersion(22)); { sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); sql::Statement s(db.GetUniqueStatement( "INSERT INTO downloads (id, full_path, url, start_time, " "received_bytes, total_bytes, state, end_time, opened) VALUES " @@ -490,7 +489,7 @@ TEST_F(HistoryBackendDBTest, MigrateReferrer) { { // Re-open the db for manual manipulation. sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); // The version should have been updated. int cur_version = HistoryDatabase::GetCurrentVersion(); ASSERT_LE(26, cur_version); @@ -514,7 +513,7 @@ TEST_F(HistoryBackendDBTest, MigrateDownloadedByExtension) { ASSERT_NO_FATAL_FAILURE(CreateDBVersion(26)); { sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); { sql::Statement s(db.GetUniqueStatement( "INSERT INTO downloads (id, current_path, target_path, start_time, " @@ -552,7 +551,7 @@ TEST_F(HistoryBackendDBTest, MigrateDownloadedByExtension) { { // Re-open the db for manual manipulation. sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); // The version should have been updated. int cur_version = HistoryDatabase::GetCurrentVersion(); ASSERT_LE(27, cur_version); @@ -577,7 +576,7 @@ TEST_F(HistoryBackendDBTest, MigrateDownloadValidators) { ASSERT_NO_FATAL_FAILURE(CreateDBVersion(27)); { sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); { sql::Statement s(db.GetUniqueStatement( "INSERT INTO downloads (id, current_path, target_path, start_time, " @@ -617,7 +616,7 @@ TEST_F(HistoryBackendDBTest, MigrateDownloadValidators) { { // Re-open the db for manual manipulation. sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); // The version should have been updated. int cur_version = HistoryDatabase::GetCurrentVersion(); ASSERT_LE(28, cur_version); @@ -641,16 +640,14 @@ TEST_F(HistoryBackendDBTest, PurgeArchivedDatabase) { ASSERT_NO_FATAL_FAILURE(CreateDBVersion(27)); ASSERT_NO_FATAL_FAILURE(CreateArchivedDB()); - ASSERT_TRUE(base::PathExists( - history_dir_.Append(chrome::kArchivedHistoryFilename))); + ASSERT_TRUE(base::PathExists(history_dir_.Append(kArchivedHistoryFilename))); CreateBackendAndDatabase(); DeleteBackend(); // We do not retain expired history entries in an archived database as of M37. // Verify that any legacy archived database is deleted on start-up. - ASSERT_FALSE(base::PathExists( - history_dir_.Append(chrome::kArchivedHistoryFilename))); + ASSERT_FALSE(base::PathExists(history_dir_.Append(kArchivedHistoryFilename))); } TEST_F(HistoryBackendDBTest, MigrateDownloadMimeType) { @@ -658,7 +655,7 @@ TEST_F(HistoryBackendDBTest, MigrateDownloadMimeType) { ASSERT_NO_FATAL_FAILURE(CreateDBVersion(28)); { sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); { sql::Statement s(db.GetUniqueStatement( "INSERT INTO downloads (id, current_path, target_path, start_time, " @@ -701,7 +698,7 @@ TEST_F(HistoryBackendDBTest, MigrateDownloadMimeType) { { // Re-open the db for manual manipulation. sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); // The version should have been updated. int cur_version = HistoryDatabase::GetCurrentVersion(); ASSERT_LE(29, cur_version); @@ -737,7 +734,7 @@ TEST_F(HistoryBackendDBTest, ConfirmDownloadRowCreateAndDelete) { DeleteBackend(); { sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); sql::Statement statement(db.GetUniqueStatement( "Select Count(*) from downloads")); EXPECT_TRUE(statement.Step()); @@ -756,7 +753,7 @@ TEST_F(HistoryBackendDBTest, ConfirmDownloadRowCreateAndDelete) { DeleteBackend(); { sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); sql::Statement statement(db.GetUniqueStatement( "Select Count(*) from downloads")); EXPECT_TRUE(statement.Step()); @@ -803,7 +800,7 @@ TEST_F(HistoryBackendDBTest, DownloadNukeRecordsMissingURLs) { DeleteBackend(); { sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); sql::Statement statement(db.GetUniqueStatement( "DELETE FROM downloads_url_chains WHERE id=1")); ASSERT_TRUE(statement.Run()); @@ -817,7 +814,7 @@ TEST_F(HistoryBackendDBTest, DownloadNukeRecordsMissingURLs) { DeleteBackend(); { sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); { sql::Statement statement(db.GetUniqueStatement( "SELECT count(*) from downloads")); @@ -840,7 +837,7 @@ TEST_F(HistoryBackendDBTest, ConfirmDownloadInProgressCleanup) { DeleteBackend(); { sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); sql::Statement statement(db.GetUniqueStatement( "Select Count(*) from downloads")); EXPECT_TRUE(statement.Step()); @@ -870,7 +867,7 @@ TEST_F(HistoryBackendDBTest, ConfirmDownloadInProgressCleanup) { DeleteBackend(); { sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); sql::Statement statement(db.GetUniqueStatement( "Select Count(*) from downloads")); EXPECT_TRUE(statement.Step()); @@ -1818,7 +1815,7 @@ TEST_F(HistoryBackendDBTest, MigratePresentations) { { // Re-open the db for manual manipulation. sql::Connection db; - ASSERT_TRUE(db.Open(history_dir_.Append(chrome::kHistoryFilename))); + ASSERT_TRUE(db.Open(history_dir_.Append(kHistoryFilename))); // Add an entry to urls. { diff --git a/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc index 9d257b2..ced861c 100644 --- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc +++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc @@ -28,6 +28,7 @@ #include "chrome/test/base/testing_pref_service_syncable.h" #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" +#include "components/history/core/browser/history_constants.h" #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_utils.h" #include "testing/gtest/include/gtest/gtest.h" @@ -41,7 +42,7 @@ KeyedService* BuildHistoryService(content::BrowserContext* context) { // Delete the file before creating the service. base::FilePath history_path( - profile->GetPath().Append(chrome::kHistoryFilename)); + profile->GetPath().Append(history::kHistoryFilename)); if (!base::DeleteFile(history_path, false) || base::PathExists(history_path)) { ADD_FAILURE() << "failed to delete history db file " diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc index 2e97af4..2a963e4 100644 --- a/chrome/common/chrome_constants.cc +++ b/chrome/common/chrome_constants.cc @@ -136,11 +136,6 @@ const base::FilePath::CharType kGuestProfileDir[] = FPL("Guest Profile"); const wchar_t kBrowserResourcesDll[] = L"chrome.dll"; // filenames -#if defined(OS_ANDROID) -const base::FilePath::CharType kAndroidCacheFilename[] = FPL("AndroidCache"); -#endif -const base::FilePath::CharType kArchivedHistoryFilename[] = - FPL("Archived History"); const base::FilePath::CharType kCacheDirname[] = FPL("Cache"); const base::FilePath::CharType kChannelIDFilename[] = FPL("Origin Bound Certs"); const base::FilePath::CharType kCookieFilename[] = FPL("Cookies"); @@ -152,10 +147,8 @@ const base::FilePath::CharType kExtensionActivityLogFilename[] = FPL("Extension Activity"); const base::FilePath::CharType kExtensionsCookieFilename[] = FPL("Extension Cookies"); -const base::FilePath::CharType kFaviconsFilename[] = FPL("Favicons"); const base::FilePath::CharType kFirstRunSentinel[] = FPL("First Run"); const base::FilePath::CharType kGCMStoreDirname[] = FPL("GCM Store"); -const base::FilePath::CharType kHistoryFilename[] = FPL("History"); const base::FilePath::CharType kJumpListIconDirname[] = FPL("JumpListIcons"); const base::FilePath::CharType kLocalStateFilename[] = FPL("Local State"); const base::FilePath::CharType kLocalStorePoolName[] = FPL("LocalStorePool"); @@ -185,7 +178,6 @@ const base::FilePath::CharType kSupervisedUserSettingsFilename[] = const base::FilePath::CharType kSyncCredentialsFilename[] = FPL("Sync Credentials"); const base::FilePath::CharType kThemePackFilename[] = FPL("Cached Theme.pak"); -const base::FilePath::CharType kThumbnailsFilename[] = FPL("Thumbnails"); const base::FilePath::CharType kTopSitesFilename[] = FPL("Top Sites"); const base::FilePath::CharType kWebAppDirname[] = FPL("Web Applications"); diff --git a/chrome/common/chrome_constants.h b/chrome/common/chrome_constants.h index 869f42b..d65e5fd 100644 --- a/chrome/common/chrome_constants.h +++ b/chrome/common/chrome_constants.h @@ -62,10 +62,6 @@ extern const base::FilePath::CharType kGuestProfileDir[]; extern const wchar_t kBrowserResourcesDll[]; // filenames -#if defined(OS_ANDROID) -extern const base::FilePath::CharType kAndroidCacheFilename[]; -#endif -extern const base::FilePath::CharType kArchivedHistoryFilename[]; extern const base::FilePath::CharType kCacheDirname[]; extern const base::FilePath::CharType kChannelIDFilename[]; extern const base::FilePath::CharType kCookieFilename[]; @@ -73,10 +69,8 @@ extern const base::FilePath::CharType kCRLSetFilename[]; extern const base::FilePath::CharType kCustomDictionaryFileName[]; extern const base::FilePath::CharType kExtensionActivityLogFilename[]; extern const base::FilePath::CharType kExtensionsCookieFilename[]; -extern const base::FilePath::CharType kFaviconsFilename[]; extern const base::FilePath::CharType kFirstRunSentinel[]; extern const base::FilePath::CharType kGCMStoreDirname[]; -extern const base::FilePath::CharType kHistoryFilename[]; extern const base::FilePath::CharType kJumpListIconDirname[]; extern const base::FilePath::CharType kLocalStateFilename[]; extern const base::FilePath::CharType kLocalStorePoolName[]; diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index fa1e454..b9c45d3 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc @@ -52,6 +52,7 @@ #include "components/bookmarks/browser/bookmark_model.h" #include "components/bookmarks/common/bookmark_constants.h" #include "components/content_settings/core/browser/host_content_settings_map.h" +#include "components/history/core/browser/history_constants.h" #include "components/history/core/browser/top_sites_observer.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/policy/core/common/policy_service.h" @@ -474,7 +475,7 @@ bool TestingProfile::CreateHistoryService(bool delete_file, bool no_db) { DestroyHistoryService(); if (delete_file) { base::FilePath path = GetPath(); - path = path.Append(chrome::kHistoryFilename); + path = path.Append(history::kHistoryFilename); if (!base::DeleteFile(path, false) || base::PathExists(path)) return false; } diff --git a/components/history.gypi b/components/history.gypi index 870d866..2fd1cbd 100644 --- a/components/history.gypi +++ b/components/history.gypi @@ -28,6 +28,8 @@ 'history/core/browser/history_backend_observer.h', 'history/core/browser/history_client.cc', 'history/core/browser/history_client.h', + 'history/core/browser/history_constants.cc', + 'history/core/browser/history_constants.h', 'history/core/browser/history_match.cc', 'history/core/browser/history_match.h', 'history/core/browser/history_service_observer.h', diff --git a/components/history/core/browser/BUILD.gn b/components/history/core/browser/BUILD.gn index da2b27b..151bf73 100644 --- a/components/history/core/browser/BUILD.gn +++ b/components/history/core/browser/BUILD.gn @@ -8,6 +8,8 @@ static_library("browser") { "history_backend_observer.h", "history_client.cc", "history_client.h", + "history_constants.cc", + "history_constants.h", "history_match.cc", "history_match.h", "history_service_observer.h", diff --git a/components/history/core/browser/history_constants.cc b/components/history/core/browser/history_constants.cc new file mode 100644 index 0000000..b37169f --- /dev/null +++ b/components/history/core/browser/history_constants.cc @@ -0,0 +1,23 @@ +// Copyright 2014 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. + +#include "components/history/core/browser/history_constants.h" + +#include "base/files/file_path.h" + +#define FPL FILE_PATH_LITERAL + +namespace history { + +// filenames +#if defined(OS_ANDROID) +const base::FilePath::CharType kAndroidCacheFilename[] = FPL("AndroidCache"); +#endif +const base::FilePath::CharType kArchivedHistoryFilename[] = + FPL("Archived History"); +const base::FilePath::CharType kFaviconsFilename[] = FPL("Favicons"); +const base::FilePath::CharType kHistoryFilename[] = FPL("History"); +const base::FilePath::CharType kThumbnailsFilename[] = FPL("Thumbnails"); + +} // namespace history diff --git a/components/history/core/browser/history_constants.h b/components/history/core/browser/history_constants.h new file mode 100644 index 0000000..910b4ca --- /dev/null +++ b/components/history/core/browser/history_constants.h @@ -0,0 +1,23 @@ +// Copyright 2014 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 COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CONSTANTS_H_ +#define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CONSTANTS_H_ + +#include "base/files/file_path.h" + +namespace history { + +// filenames +#if defined(OS_ANDROID) +extern const base::FilePath::CharType kAndroidCacheFilename[]; +#endif +extern const base::FilePath::CharType kArchivedHistoryFilename[]; +extern const base::FilePath::CharType kFaviconsFilename[]; +extern const base::FilePath::CharType kHistoryFilename[]; +extern const base::FilePath::CharType kThumbnailsFilename[]; + +} // namespace history + +#endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CONSTANTS_H_ |