diff options
22 files changed, 143 insertions, 168 deletions
diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc index cb53639..4280808 100644 --- a/chrome/browser/bookmarks/bookmark_model.cc +++ b/chrome/browser/bookmarks/bookmark_model.cc @@ -5,7 +5,6 @@ #include "chrome/browser/bookmarks/bookmark_model.h" #include "base/gfx/png_decoder.h" -#include "build/build_config.h" #include "chrome/browser/bookmarks/bookmark_utils.h" #include "chrome/browser/bookmarks/bookmark_storage.h" #include "chrome/browser/profile.h" @@ -62,15 +61,13 @@ void BookmarkNode::Reset(const history::StarredEntry& entry) { BookmarkModel::BookmarkModel(Profile* profile) : profile_(profile), loaded_(false), - ALLOW_THIS_IN_INITIALIZER_LIST(root_(this, GURL())), +#pragma warning(suppress: 4355) // Okay to pass "this" here. + root_(this, GURL()), bookmark_bar_node_(NULL), other_node_(NULL), observers_(ObserverList<BookmarkModelObserver>::NOTIFY_EXISTING_ONLY), - waiting_for_history_load_(false) -#if defined(OS_WIN) - , loaded_signal_(CreateEvent(NULL, TRUE, FALSE, NULL)) -#endif -{ + waiting_for_history_load_(false), + loaded_signal_(CreateEvent(NULL, TRUE, FALSE, NULL)) { // Create the bookmark bar and other bookmarks folders. These always exist. CreateBookmarkNode(); CreateOtherBookmarksNode(); @@ -440,12 +437,8 @@ void BookmarkModel::DoneLoading() { loaded_ = true; -#if defined(OS_WIN) if (loaded_signal_.Get()) SetEvent(loaded_signal_.Get()); -#else - NOTIMPLEMENTED(); -#endif // Notify our direct observers. @@ -474,15 +467,10 @@ void BookmarkModel::RemoveAndDeleteNode(BookmarkNode* delete_me) { // allow duplicates we need to remove any entries that are still bookmarked. for (std::set<GURL>::iterator i = details.changed_urls.begin(); i != details.changed_urls.end(); ){ - if (IsBookmarkedNoLock(*i)) { - // When we erase the iterator pointing at the erasee is - // invalidated, so using i++ here within the "erase" call is - // important as it advances the iterator before passing the - // old value through to erase. - details.changed_urls.erase(i++); - } else { + if (IsBookmarkedNoLock(*i)) + i = details.changed_urls.erase(i); + else ++i; - } } } @@ -534,12 +522,8 @@ BookmarkNode* BookmarkModel::AddNode(BookmarkNode* parent, } void BookmarkModel::BlockTillLoaded() { -#if defined(OS_WIN) if (loaded_signal_.Get()) WaitForSingleObject(loaded_signal_.Get(), INFINITE); -#else - NOTIMPLEMENTED(); -#endif } BookmarkNode* BookmarkModel::GetNodeByID(BookmarkNode* node, int id) { diff --git a/chrome/browser/bookmarks/bookmark_storage.cc b/chrome/browser/bookmarks/bookmark_storage.cc index 64743e5..4f2ae9f 100644 --- a/chrome/browser/bookmarks/bookmark_storage.cc +++ b/chrome/browser/bookmarks/bookmark_storage.cc @@ -19,11 +19,11 @@ namespace { // Extension used for backup files (copy of main file created during startup). -const FilePath::CharType kBackupExtension[] = FILE_PATH_LITERAL("bak"); +const wchar_t* const kBackupExtension = L"bak"; // Extension for the temporary file. We write to the temp file than move to // kBookmarksFileName. -const FilePath::CharType kTmpExtension[] = FILE_PATH_LITERAL("tmp"); +const wchar_t* const kTmpExtension = L"tmp"; // How often we save. const int kSaveDelayMS = 2500; @@ -36,9 +36,10 @@ BookmarkStorage::BookmarkStorage(Profile* profile, BookmarkModel* model) : model_(model), ALLOW_THIS_IN_INITIALIZER_LIST(save_factory_(this)), backend_thread_(g_browser_process->file_thread()) { - FilePath path = profile->GetPath().Append(chrome::kBookmarksFileName); - FilePath tmp_history_path = - profile->GetPath().Append(chrome::kHistoryBookmarksFileName); + std::wstring path = profile->GetPath().ToWStringHack(); + file_util::AppendToPath(&path, chrome::kBookmarksFileName); + std::wstring tmp_history_path = profile->GetPath().ToWStringHack(); + file_util::AppendToPath(&tmp_history_path, chrome::kHistoryBookmarksFileName); backend_ = new BookmarkStorageBackend(path, tmp_history_path); } @@ -114,12 +115,13 @@ void BookmarkStorage::SaveNow() { // BookmarkStorageBackend ------------------------------------------------------ BookmarkStorageBackend::BookmarkStorageBackend( - const FilePath& path, - const FilePath& tmp_history_path) - : path_(path.ToWStringHack()), - tmp_history_path_(tmp_history_path.ToWStringHack()) { + const std::wstring& path, + const std::wstring& tmp_history_path) + : path_(path), + tmp_history_path_(tmp_history_path) { // Make a backup of the current file. - FilePath backup_path = path.ReplaceExtension(kBackupExtension); + std::wstring backup_path = path; + file_util::ReplaceExtension(&backup_path, kBackupExtension); file_util::CopyFile(path, backup_path); } @@ -133,11 +135,8 @@ void BookmarkStorageBackend::Write(Value* value) { JSONWriter::Write(value, true, &content); // Write to a temp file, then rename. - // TODO(port): this code was all written to use wstrings; needs cleaning up - // for FilePath. - FilePath tmp_file_filepath = - FilePath::FromWStringHack(path_).ReplaceExtension(kTmpExtension); - std::wstring tmp_file = tmp_file_filepath.ToWStringHack(); + std::wstring tmp_file = path_; + file_util::ReplaceExtension(&tmp_file, kTmpExtension); int bytes_written = file_util::WriteFile(tmp_file, content.c_str(), static_cast<int>(content.length())); diff --git a/chrome/browser/bookmarks/bookmark_storage.h b/chrome/browser/bookmarks/bookmark_storage.h index 59b91a8..f63aa81 100644 --- a/chrome/browser/bookmarks/bookmark_storage.h +++ b/chrome/browser/bookmarks/bookmark_storage.h @@ -10,7 +10,6 @@ class BookmarkModel; class BookmarkStorageBackend; -class FilePath; class Profile; class MessageLoop; class Value; @@ -76,8 +75,8 @@ class BookmarkStorage : public base::RefCountedThreadSafe<BookmarkStorage> { class BookmarkStorageBackend : public base::RefCountedThreadSafe<BookmarkStorageBackend> { public: - explicit BookmarkStorageBackend(const FilePath& path, - const FilePath& tmp_history_path); + explicit BookmarkStorageBackend(const std::wstring& path, + const std::wstring& tmp_histor_path); // Writes the specified value to disk. This takes ownership of |value| and // deletes it when done. diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons index 8e050bb..bb09aaa 100644 --- a/chrome/browser/browser.scons +++ b/chrome/browser/browser.scons @@ -670,6 +670,8 @@ if not env.Bit('windows'): 'bookmarks/bookmark_context_menu.cc', 'bookmarks/bookmark_drag_data.cc', 'bookmarks/bookmark_drop_info.cc', + 'bookmarks/bookmark_model.cc', + 'bookmarks/bookmark_storage.cc', 'bookmarks/bookmark_utils.cc', 'browser_about_handler.cc', 'browser_accessibility.cc', @@ -705,6 +707,7 @@ if not env.Bit('windows'): 'gears_integration.cc', 'hang_monitor/hung_plugin_action.cc', 'hang_monitor/hung_window_detector.cc', + 'history/history.cc', 'history_tab_ui.cc', 'history_view.cc', 'icon_loader.cc', diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index 8236f18..721ebf2 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -12,7 +12,6 @@ #include "base/string_util.h" #include "base/sys_info.h" #include "chrome/app/result_codes.h" -#include "chrome/browser/autocomplete/autocomplete.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/extensions_service.h" diff --git a/chrome/browser/history/expire_history_backend.h b/chrome/browser/history/expire_history_backend.h index ed44096..0e5ab44 100644 --- a/chrome/browser/history/expire_history_backend.h +++ b/chrome/browser/history/expire_history_backend.h @@ -18,7 +18,6 @@ class BookmarkService; class GURL; class NotificationType; -class TestingProfile; namespace history { @@ -86,7 +85,7 @@ class ExpireHistoryBackend { FRIEND_TEST(ExpireHistoryTest, DeleteTextIndexForURL); FRIEND_TEST(ExpireHistoryTest, DeleteFaviconsIfPossible); FRIEND_TEST(ExpireHistoryTest, ArchiveSomeOldHistory); - friend class ::TestingProfile; + friend class TestingProfile; struct DeleteDependencies { // The time range affected. These can be is_null() to be unbounded in one diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc index 74118d0..0bfcd6fa 100644 --- a/chrome/browser/history/history.cc +++ b/chrome/browser/history/history.cc @@ -599,7 +599,6 @@ void HistoryService::SetInMemoryBackend( } void HistoryService::NotifyTooNew() { -#if defined(OS_WIN) // Find the last browser window to display our message box from. Browser* cur_browser = BrowserList::GetLastActive(); // TODO(brettw): Do this some other way or beng will kick you. e.g. move to @@ -612,10 +611,6 @@ void HistoryService::NotifyTooNew() { std::wstring message = l10n_util::GetString(IDS_PROFILE_TOO_NEW_ERROR); MessageBox(cur_hwnd, message.c_str(), title.c_str(), MB_OK | MB_ICONWARNING | MB_TOPMOST); -#else - // TODO(port): factor this out into platform-specific code. - NOTIMPLEMENTED(); -#endif } void HistoryService::DeleteURL(const GURL& url) { diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index 6bed37a..c899700 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -477,7 +477,7 @@ void HistoryBackend::InitImpl() { std::wstring archived_name = GetArchivedFileName(); std::wstring tmp_bookmarks_file = history_dir_; file_util::AppendToPath(&tmp_bookmarks_file, - FilePath(chrome::kHistoryBookmarksFileName).ToWStringHack()); + chrome::kHistoryBookmarksFileName); // History database. db_.reset(new HistoryDatabase()); diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h index 1dfa16e..8918742 100644 --- a/chrome/browser/history/history_backend.h +++ b/chrome/browser/history/history_backend.h @@ -26,7 +26,6 @@ #include "testing/gtest/include/gtest/gtest_prod.h" class BookmarkService; -class TestingProfile; struct ThumbnailScore; namespace history { @@ -261,7 +260,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, friend class HistoryTest; // So the unit tests can poke our innards. FRIEND_TEST(HistoryBackendTest, DeleteAll); FRIEND_TEST(HistoryBackendTest, URLsNoLongerBookmarked); - friend class ::TestingProfile; + friend class TestingProfile; // Computes the name of the specified database on disk. std::wstring GetThumbnailFileName() const; diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index e640895..158a9e1 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -15,7 +15,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/extensions/user_script_master.h" -#include "chrome/browser/history/history.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/profile_manager.h" #include "chrome/browser/renderer_host/render_process_host.h" @@ -42,6 +41,7 @@ #if defined(OS_WIN) #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/download/download_manager.h" +#include "chrome/browser/history/history.h" #include "chrome/browser/search_engines/template_url_fetcher.h" #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sessions/tab_restore_service.h" diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 75a631c..3e3081a 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -24,7 +24,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/cache_manager_host.h" #include "chrome/browser/extensions/user_script_master.h" -#include "chrome/browser/history/history.h" #include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/render_widget_helper.h" #include "chrome/browser/renderer_host/renderer_security_policy.h" @@ -46,6 +45,7 @@ // TODO(port): see comment by the only usage of RenderViewHost in this file. #include "chrome/browser/renderer_host/render_view_host.h" +#include "chrome/browser/history/history.h" #include "chrome/browser/spellchecker.h" // Once the above TODO is finished, then this block is all Windows-specific @@ -515,7 +515,6 @@ void BrowserRenderProcessHost::InitVisitedLinks() { return; } -#if defined(OS_WIN) base::SharedMemoryHandle handle_for_process = NULL; visitedlink_master->ShareToProcess(GetRendererProcessHandle(), &handle_for_process); @@ -523,9 +522,6 @@ void BrowserRenderProcessHost::InitVisitedLinks() { if (handle_for_process) { channel_->Send(new ViewMsg_VisitedLink_NewTable(handle_for_process)); } -#else - NOTIMPLEMENTED(); -#endif } void BrowserRenderProcessHost::InitUserScripts() { diff --git a/chrome/browser/search_engines/template_url_model.cc b/chrome/browser/search_engines/template_url_model.cc index bfb9d43..1262780 100644 --- a/chrome/browser/search_engines/template_url_model.cc +++ b/chrome/browser/search_engines/template_url_model.cc @@ -11,7 +11,6 @@ #include "chrome/app/locales/locale_settings.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/google_url_tracker.h" -#include "chrome/browser/history/history.h" #include "chrome/browser/profile.h" #include "chrome/browser/rlz/rlz.h" #include "chrome/browser/search_engines/template_url.h" @@ -27,6 +26,17 @@ #include "unicode/rbbi.h" #include "unicode/uchar.h" +#if defined(OS_POSIX) +// TODO(port): get rid of this include. It's used just to provide declarations +// and stub definitions for classes we encouter during the porting effort. +#include "chrome/common/temp_scaffolding_stubs.h" +#endif + +// TODO(port): Get rid of this section and finish porting. +#if defined(OS_WIN) +#include "chrome/browser/history/history.h" +#endif + using base::Time; // String in the URL that is replaced by the search term. diff --git a/chrome/browser/tab_contents/web_contents.h b/chrome/browser/tab_contents/web_contents.h index a734685..7bb858c 100644 --- a/chrome/browser/tab_contents/web_contents.h +++ b/chrome/browser/tab_contents/web_contents.h @@ -8,7 +8,6 @@ #include "base/basictypes.h" #include "base/hash_tables.h" #include "chrome/browser/cancelable_request.h" -#include "chrome/browser/history/history.h" #include "chrome/browser/renderer_host/render_view_host_delegate.h" #include "chrome/browser/tab_contents/navigation_controller.h" #include "chrome/browser/tab_contents/render_view_host_manager.h" diff --git a/chrome/browser/visitedlink_master.cc b/chrome/browser/visitedlink_master.cc index 8baf4a3..e24f80c 100644 --- a/chrome/browser/visitedlink_master.cc +++ b/chrome/browser/visitedlink_master.cc @@ -23,9 +23,14 @@ #include "base/string_util.h" #include "base/thread.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/history/history.h" #include "chrome/browser/profile.h" - +#if defined(OS_WIN) +#include "chrome/browser/history/history.h" +#else +// TODO(port): We should be using history.h, remove scaffolding +// when it is ported. +#include "chrome/common/temp_scaffolding_stubs.h" +#endif // !defined(OS_WIN) #if defined(OS_WIN) #include "chrome/common/win_util.h" #endif diff --git a/chrome/browser/webdata/web_database.cc b/chrome/browser/webdata/web_database.cc index cf327d1..7ee4f79 100755 --- a/chrome/browser/webdata/web_database.cc +++ b/chrome/browser/webdata/web_database.cc @@ -13,7 +13,6 @@ #include "base/string_util.h" #include "base/time.h" #include "base/values.h" -#include "chrome/browser/history/history_database.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/common/l10n_util.h" #include "chrome/common/scoped_vector.h" @@ -30,6 +29,7 @@ // Encryptor is the *wrong* way of doing things; we need to turn it into a // bottleneck to use the platform methods (e.g. Keychain on the Mac). That's // going to take a massive change in its API... +#include "chrome/browser/history/history_database.h" #include "chrome/browser/password_manager/encryptor.h" #endif diff --git a/chrome/chrome.xcodeproj/project.pbxproj b/chrome/chrome.xcodeproj/project.pbxproj index 231e401..c56d960 100644 --- a/chrome/chrome.xcodeproj/project.pbxproj +++ b/chrome/chrome.xcodeproj/project.pbxproj @@ -75,7 +75,6 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 2974AF430AA6D66F204D0C56 /* history.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BF9EC0E9D48F7009A6919 /* history.cc */; }; 331218220F3BFF32006CB2B0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 331B93A90F3BF2B9008B1C46 /* QuartzCore.framework */; }; 331218230F3BFF36006CB2B0 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 331B93AB0F3BF2DA008B1C46 /* Carbon.framework */; }; 331218290F3C007A006CB2B0 /* renderer_glue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D640CD80EAE868600EBCFC0 /* renderer_glue.cc */; }; @@ -5121,7 +5120,6 @@ E45075C60F15070D003BE099 /* firefox_profile_lock.cc in Sources */, 4D7BF9990E9D486B009A6919 /* google_url_tracker.cc in Sources */, 4D7BF99E0E9D486F009A6919 /* google_util.cc in Sources */, - 2974AF430AA6D66F204D0C56 /* history.cc in Sources */, E4F3244A0EE5CF3C002533CE /* history_backend.cc in Sources */, E40CC5E30F2E348900708647 /* history_contents_provider.cc in Sources */, E4F3244D0EE5CF4A002533CE /* history_database.cc in Sources */, diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc index 494d3b0..a0ae25b 100644 --- a/chrome/common/chrome_constants.cc +++ b/chrome/common/chrome_constants.cc @@ -42,8 +42,7 @@ const wchar_t kUserDataDirname[] = L"User Data"; const FilePath::CharType kUserScriptsDirname[] = FPL("User Scripts"); const FilePath::CharType kWebDataFilename[] = FPL("Web Data"); const FilePath::CharType kBookmarksFileName[] = FPL("Bookmarks"); -const FilePath::CharType kHistoryBookmarksFileName[] = - FPL("Bookmarks From History"); +const wchar_t kHistoryBookmarksFileName[] = L"Bookmarks From History"; const wchar_t kCustomDictionaryFileName[] = L"Custom Dictionary.txt"; // Note, this shouldn't go above 64. See bug 535234. diff --git a/chrome/common/chrome_constants.h b/chrome/common/chrome_constants.h index 0ddf579..a752aba 100644 --- a/chrome/common/chrome_constants.h +++ b/chrome/common/chrome_constants.h @@ -37,7 +37,7 @@ extern const wchar_t kUserDataDirname[]; extern const FilePath::CharType kUserScriptsDirname[]; extern const FilePath::CharType kWebDataFilename[]; extern const FilePath::CharType kBookmarksFileName[]; -extern const FilePath::CharType kHistoryBookmarksFileName[]; +extern const wchar_t kHistoryBookmarksFileName[]; extern const wchar_t kCustomDictionaryFileName[]; extern const unsigned int kMaxRendererProcessCount; diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc index 0aff7b7..bdee164 100644 --- a/chrome/common/temp_scaffolding_stubs.cc +++ b/chrome/common/temp_scaffolding_stubs.cc @@ -12,8 +12,6 @@ #include "base/singleton.h" #include "base/task.h" #include "build/build_config.h" -#include "chrome/browser/autocomplete/autocomplete.h" -#include "chrome/browser/autocomplete/history_url_provider.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_shutdown.h" #include "chrome/browser/cache_manager_host.h" @@ -37,7 +35,6 @@ #include "webkit/glue/webcursor.h" #include "webkit/glue/webkit_glue.h" - // static size_t SessionRestore::num_tabs_to_load_ = 0; @@ -369,98 +366,3 @@ bool ClipboardIsFormatAvailable(Clipboard::FormatType format) { } // webkit_glue - -//-------------------------------------------------------------------------- -size_t AutocompleteProvider::max_matches_ = 42; -size_t AutocompleteResult::max_matches_ = 42; - -// static -std::string AutocompleteInput::TypeToString(Type type) { - NOTIMPLEMENTED(); - return ""; -} - -AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider, - int relevance, - bool deletable, - Type type) { - NOTIMPLEMENTED(); -} - -// static -void AutocompleteMatch::ClassifyLocationInString( - size_t match_location, - size_t match_length, - size_t overall_length, - int style, - ACMatchClassifications* classifications) { - NOTIMPLEMENTED(); -} - -// static -std::string AutocompleteMatch::TypeToString(Type type) { - NOTIMPLEMENTED(); - return ""; -} - -AutocompleteProvider::~AutocompleteProvider() { - NOTIMPLEMENTED(); -} - -std::wstring AutocompleteProvider::StringForURLDisplay(const GURL& url, - bool check_accept_lang) { - NOTIMPLEMENTED(); - return L""; -} - -void HistoryURLProvider::ExecuteWithDB(history::HistoryBackend* backend, - history::URLDatabase* db, - HistoryURLProviderParams* params) { - NOTIMPLEMENTED(); -} - -//-------------------------------------------------------------------------- -namespace bookmark_utils { - -struct TitleMatch { - void* undefined; -}; - -void GetBookmarksMatchingText(BookmarkModel* model, - const std::wstring& text, - size_t max_count, - std::vector<TitleMatch>* matches) { - NOTIMPLEMENTED(); -} - -bool MoreRecentlyAdded(BookmarkNode* n1, BookmarkNode* n2) { - NOTIMPLEMENTED(); - return false; -} - -std::vector<BookmarkNode*> GetMostRecentlyModifiedGroups(BookmarkModel* model, - size_t max_count) { - NOTIMPLEMENTED(); - return std::vector<BookmarkNode*>(); -} - - -void GetBookmarksContainingText(BookmarkModel* model, - const std::wstring& text, - size_t max_count, - std::vector<BookmarkNode*>* nodes) { - NOTIMPLEMENTED(); -} - -bool DoesBookmarkContainText(BookmarkNode* node, const std::wstring& text) { - NOTIMPLEMENTED(); - return false; -} - -void GetMostRecentlyAddedEntries(BookmarkModel* model, - size_t count, - std::vector<BookmarkNode*>* nodes) { - NOTIMPLEMENTED(); -} - -} // bookmark_utils diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h index 2e77074..26a47c6 100644 --- a/chrome/common/temp_scaffolding_stubs.h +++ b/chrome/common/temp_scaffolding_stubs.h @@ -204,6 +204,75 @@ class TabRestoreService : public base::RefCountedThreadSafe<TabRestoreService> { void RestoreMostRecentEntry(Browser*) { NOTIMPLEMENTED(); } }; +namespace history { + +class ExpireHistoryBackend { + public: + BookmarkService* bookmark_service_; +}; + +class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend> { + public: + BookmarkService* bookmark_service_; + ExpireHistoryBackend expirer_; +}; + +class HistoryDatabase { + public: + static std::string GURLToDatabaseURL(const GURL& url) { + NOTIMPLEMENTED(); + return ""; + } +}; + +} + +class HistoryService { + public: + class URLEnumerator { + public: + virtual ~URLEnumerator() {} + virtual void OnURL(const GURL& url) = 0; + virtual void OnComplete(bool success) = 0; + }; + class Handle { + public: + }; + HistoryService() {} + HistoryService(Profile* profile) {} + bool Init(const FilePath& history_dir, BookmarkService* bookmark_service) { + NOTIMPLEMENTED(); + return false; + } + void SetOnBackendDestroyTask(Task*) { NOTIMPLEMENTED(); } + void AddPage(GURL const&, void const*, int, GURL const&, + int, std::vector<GURL> const&) { NOTIMPLEMENTED(); } + void AddPage(const GURL& url) { NOTIMPLEMENTED(); } + void SetPageContents(const GURL& url, const std::wstring& contents) { + NOTIMPLEMENTED(); + } + void IterateURLs(URLEnumerator* iterator) { NOTIMPLEMENTED(); } + void DeleteAllSearchTermsForKeyword(long long) { NOTIMPLEMENTED(); } + void SetKeywordSearchTermsForURL(const GURL& url, + long long keyword_id, + const std::wstring& term) { + NOTIMPLEMENTED(); + } + void NotifyRenderProcessHostDestruction(int) { NOTIMPLEMENTED(); }; + void Cleanup() { NOTIMPLEMENTED(); } + void AddRef() { NOTIMPLEMENTED(); } + void Release() { NOTIMPLEMENTED(); } + void SetFavIconOutOfDateForPage(const GURL&) { NOTIMPLEMENTED(); } + void SetPageThumbnail(const GURL&, const SkBitmap&, const ThumbnailScore&) { + NOTIMPLEMENTED(); + } + void SetPageTitle(const GURL&, const std::wstring&) { + NOTIMPLEMENTED(); + } + + scoped_refptr<history::HistoryBackend> history_backend_; +}; + class MetricsService { public: MetricsService() { } @@ -807,6 +876,16 @@ class WebAppLauncher { } }; +class AutocompleteResult { + public: + static void set_max_matches(int) { NOTIMPLEMENTED(); } +}; + +class AutocompleteProvider { + public: + static void set_max_matches(int) { NOTIMPLEMENTED(); } +}; + class URLFixerUpper { public: static std::wstring FixupRelativeFile(const std::wstring& base_dir, diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc index 7e46932..7514ba1 100644 --- a/chrome/test/testing_profile.cc +++ b/chrome/test/testing_profile.cc @@ -5,9 +5,19 @@ #include "chrome/test/testing_profile.h" #include "base/string_util.h" -#include "chrome/browser/history/history_backend.h" #include "chrome/common/chrome_constants.h" +#if defined(OS_POSIX) +// TODO(port): get rid of this include. It's used just to provide declarations +// and stub definitions for classes we encouter during the porting effort. +#include "chrome/common/temp_scaffolding_stubs.h" +#endif + +// TODO(port): Get rid of this section and finish porting. +#if defined(OS_WIN) +#include "chrome/browser/history/history_backend.h" +#endif + using base::Time; namespace { diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h index 53167a2..bcaa346 100644 --- a/chrome/test/testing_profile.h +++ b/chrome/test/testing_profile.h @@ -10,7 +10,6 @@ #include "base/path_service.h" #include "base/file_util.h" #include "chrome/browser/browser_prefs.h" -#include "chrome/browser/history/history.h" #include "chrome/browser/profile.h" #include "chrome/browser/search_engines/template_url_model.h" #include "chrome/common/pref_service.h" @@ -24,6 +23,7 @@ // TODO(port): Get rid of this section and finish porting. #if defined(OS_WIN) #include "chrome/browser/bookmarks/bookmark_model.h" +#include "chrome/browser/history/history.h" #include "chrome/browser/sessions/session_service.h" #endif |