diff options
42 files changed, 168 insertions, 107 deletions
diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.h b/chrome/browser/bookmarks/bookmark_context_menu_controller.h index 66f9f61..0934b70 100644 --- a/chrome/browser/bookmarks/bookmark_context_menu_controller.h +++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.h @@ -9,10 +9,11 @@ #include "app/gfx/native_widget_types.h" #include "base/basictypes.h" -#include "chrome/browser/bookmarks/bookmark_model.h" +#include "chrome/browser/bookmarks/bookmark_model_observer.h" class Browser; class PageNavigator; +class Profile; // An interface implemented by an object that performs actions on the actual // menu for the controller. diff --git a/chrome/browser/bookmarks/bookmark_drag_data.h b/chrome/browser/bookmarks/bookmark_drag_data.h index 0b9736c..2699234 100644 --- a/chrome/browser/bookmarks/bookmark_drag_data.h +++ b/chrome/browser/bookmarks/bookmark_drag_data.h @@ -8,7 +8,6 @@ #include <string> #include <vector> -#include "chrome/browser/history/history.h" #include "googleurl/src/gurl.h" // TODO(port): Port this file. diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc index daab3c7..f75577c 100644 --- a/chrome/browser/bookmarks/bookmark_model.cc +++ b/chrome/browser/bookmarks/bookmark_model.cc @@ -12,6 +12,7 @@ #include "chrome/browser/bookmarks/bookmark_utils.h" #include "chrome/browser/bookmarks/bookmark_storage.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/history/history_notifications.h" #include "chrome/browser/profile.h" #include "chrome/common/notification_service.h" #include "chrome/common/pref_service.h" @@ -449,9 +450,9 @@ void BookmarkModel::RemoveNode(BookmarkNode* node, } void BookmarkModel::DoneLoading( - BookmarkStorage::LoadDetails* details_delete_me) { + BookmarkLoadDetails* details_delete_me) { DCHECK(details_delete_me); - scoped_ptr<BookmarkStorage::LoadDetails> details(details_delete_me); + scoped_ptr<BookmarkLoadDetails> details(details_delete_me); if (loaded_) { // We should only ever be loaded once. NOTREACHED(); @@ -727,9 +728,9 @@ void BookmarkModel::SetFileChanged() { file_changed_ = true; } -BookmarkStorage::LoadDetails* BookmarkModel::CreateLoadDetails() { +BookmarkLoadDetails* BookmarkModel::CreateLoadDetails() { BookmarkNode* bb_node = CreateBookmarkNode(); BookmarkNode* other_folder_node = CreateOtherBookmarksNode(); - return new BookmarkStorage::LoadDetails( + return new BookmarkLoadDetails( bb_node, other_folder_node, new BookmarkIndex(profile()), next_node_id_); } diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h index 88286a09..5d03af7 100644 --- a/chrome/browser/bookmarks/bookmark_model.h +++ b/chrome/browser/bookmarks/bookmark_model.h @@ -16,7 +16,6 @@ #include "base/waitable_event.h" #include "chrome/browser/bookmarks/bookmark_model_observer.h" #include "chrome/browser/bookmarks/bookmark_service.h" -#include "chrome/browser/bookmarks/bookmark_storage.h" #include "chrome/browser/cancelable_request.h" #include "chrome/browser/favicon_service.h" #include "chrome/browser/history/history.h" @@ -26,10 +25,12 @@ #include "third_party/skia/include/core/SkBitmap.h" #include "testing/gtest/include/gtest/gtest_prod.h" +class BookmarkCodec; class BookmarkEditorView; class BookmarkIndex; +class BookmarkLoadDetails; class BookmarkModel; -class BookmarkCodec; +class BookmarkStorage; class Profile; namespace bookmark_utils { @@ -332,7 +333,7 @@ class BookmarkModel : public NotificationObserver, public BookmarkService { // Invoked when loading is finished. Sets loaded_ and notifies observers. // BookmarkModel takes ownership of |details|. - void DoneLoading(BookmarkStorage::LoadDetails* details); + void DoneLoading(BookmarkLoadDetails* details); // Populates nodes_ordered_by_url_set_ from root. void PopulateNodesByURL(BookmarkNode* node); @@ -400,9 +401,9 @@ class BookmarkModel : public NotificationObserver, public BookmarkService { // Records that the bookmarks file was changed externally. void SetFileChanged(); - // Creates and returns a new LoadDetails. It's up to the caller to delete - // the returned object. - BookmarkStorage::LoadDetails* CreateLoadDetails(); + // Creates and returns a new BookmarkLoadDetails. It's up to the caller to + // delete the returned object. + BookmarkLoadDetails* CreateLoadDetails(); NotificationRegistrar registrar_; diff --git a/chrome/browser/bookmarks/bookmark_model_unittest.cc b/chrome/browser/bookmarks/bookmark_model_unittest.cc index 1e5b90e..0624b74 100644 --- a/chrome/browser/bookmarks/bookmark_model_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_model_unittest.cc @@ -11,6 +11,8 @@ #include "chrome/browser/bookmarks/bookmark_codec.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_utils.h" +#include "chrome/browser/chrome_thread.h" +#include "chrome/browser/history/history_notifications.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/notification_registrar.h" diff --git a/chrome/browser/bookmarks/bookmark_storage.cc b/chrome/browser/bookmarks/bookmark_storage.cc index 387fa71..0b7d895 100644 --- a/chrome/browser/bookmarks/bookmark_storage.cc +++ b/chrome/browser/bookmarks/bookmark_storage.cc @@ -64,7 +64,7 @@ class BookmarkStorage::LoadTask : public Task { public: LoadTask(const FilePath& path, BookmarkStorage* storage, - LoadDetails* details) + BookmarkLoadDetails* details) : path_(path), storage_(storage), details_(details) { @@ -120,7 +120,7 @@ class BookmarkStorage::LoadTask : public Task { const FilePath path_; scoped_refptr<BookmarkStorage> storage_; - LoadDetails* details_; + BookmarkLoadDetails* details_; DISALLOW_COPY_AND_ASSIGN(LoadTask); }; @@ -143,7 +143,7 @@ BookmarkStorage::~BookmarkStorage() { writer_.DoScheduledWrite(); } -void BookmarkStorage::LoadBookmarks(LoadDetails* details) { +void BookmarkStorage::LoadBookmarks(BookmarkLoadDetails* details) { DCHECK(!details_.get()); DCHECK(details); details_.reset(details); diff --git a/chrome/browser/bookmarks/bookmark_storage.h b/chrome/browser/bookmarks/bookmark_storage.h index e3e1337..0edf5a0 100644 --- a/chrome/browser/bookmarks/bookmark_storage.h +++ b/chrome/browser/bookmarks/bookmark_storage.h @@ -19,6 +19,69 @@ class Profile; class Task; class Value; +// BookmarkLoadDetails is used by BookmarkStorage when loading bookmarks. +// BookmarkModel creates a BookmarkLoadDetails and passes it (including +// ownership) to BookmarkStorage. BoomarkStorage loads the bookmarks (and index) +// in the background thread, then calls back to the BookmarkModel (on the main +// thread) when loading is done, passing ownership back to the BookmarkModel. +// While loading BookmarkModel does not maintain references to the contents +// of the BookmarkLoadDetails, this ensures we don't have any threading +// problems. +class BookmarkLoadDetails { + public: + BookmarkLoadDetails(BookmarkNode* bb_node, + BookmarkNode* other_folder_node, + BookmarkIndex* index, + int64 max_id) + : bb_node_(bb_node), + other_folder_node_(other_folder_node), + index_(index), + max_id_(max_id), + ids_reassigned_(false) { + } + + void release() { + bb_node_.release(); + other_folder_node_.release(); + index_.release(); + } + + BookmarkNode* bb_node() { return bb_node_.get(); } + BookmarkNode* other_folder_node() { return other_folder_node_.get(); } + BookmarkIndex* index() { return index_.get(); } + + // Max id of the nodes. + void set_max_id(int64 max_id) { max_id_ = max_id; } + int64 max_id() const { return max_id_; } + + // Computed checksum. + void set_computed_checksum(const std::string& value) { + computed_checksum_ = value; + } + const std::string& computed_checksum() const { return computed_checksum_; } + + // Stored checksum. + void set_stored_checksum(const std::string& value) { + stored_checksum_ = value; + } + const std::string& stored_checksum() const { return stored_checksum_; } + + // Whether ids were reassigned. + void set_ids_reassigned(bool value) { ids_reassigned_ = value; } + bool ids_reassigned() const { return ids_reassigned_; } + + private: + scoped_ptr<BookmarkNode> bb_node_; + scoped_ptr<BookmarkNode> other_folder_node_; + scoped_ptr<BookmarkIndex> index_; + int64 max_id_; + std::string computed_checksum_; + std::string stored_checksum_; + bool ids_reassigned_; + + DISALLOW_COPY_AND_ASSIGN(BookmarkLoadDetails); +}; + // BookmarkStorage handles reading/write the bookmark bar model. The // BookmarkModel uses the BookmarkStorage to load bookmarks from disk, as well // as notifying the BookmarkStorage every time the model changes. @@ -28,74 +91,12 @@ class BookmarkStorage : public NotificationObserver, public ImportantFileWriter::DataSerializer, public base::RefCountedThreadSafe<BookmarkStorage> { public: - // LoadDetails is used by BookmarkStorage when loading bookmarks. - // BookmarkModel creates a LoadDetails and passes it (including ownership) to - // BookmarkStorage. BoomarkStorage loads the bookmarks (and index) in the - // background thread, then calls back to the BookmarkModel (on the main - // thread) when loading is done, passing ownership back to the BookmarkModel. - // While loading BookmarkModel does not maintain references to the contents - // of the LoadDetails, this ensures we don't have any threading problems. - class LoadDetails { - public: - LoadDetails(BookmarkNode* bb_node, - BookmarkNode* other_folder_node, - BookmarkIndex* index, - int64 max_id) - : bb_node_(bb_node), - other_folder_node_(other_folder_node), - index_(index), - max_id_(max_id), - ids_reassigned_(false) { - } - - void release() { - bb_node_.release(); - other_folder_node_.release(); - index_.release(); - } - - BookmarkNode* bb_node() { return bb_node_.get(); } - BookmarkNode* other_folder_node() { return other_folder_node_.get(); } - BookmarkIndex* index() { return index_.get(); } - - // Max id of the nodes. - void set_max_id(int64 max_id) { max_id_ = max_id; } - int64 max_id() const { return max_id_; } - - // Computed checksum. - void set_computed_checksum(const std::string& value) { - computed_checksum_ = value; - } - const std::string& computed_checksum() const { return computed_checksum_; } - - // Stored checksum. - void set_stored_checksum(const std::string& value) { - stored_checksum_ = value; - } - const std::string& stored_checksum() const { return stored_checksum_; } - - // Whether ids were reassigned. - void set_ids_reassigned(bool value) { ids_reassigned_ = value; } - bool ids_reassigned() const { return ids_reassigned_; } - - private: - scoped_ptr<BookmarkNode> bb_node_; - scoped_ptr<BookmarkNode> other_folder_node_; - scoped_ptr<BookmarkIndex> index_; - int64 max_id_; - std::string computed_checksum_; - std::string stored_checksum_; - bool ids_reassigned_; - - DISALLOW_COPY_AND_ASSIGN(LoadDetails); - }; - // Creates a BookmarkStorage for the specified model BookmarkStorage(Profile* profile, BookmarkModel* model); // Loads the bookmarks into the model, notifying the model when done. This - // takes ownership of |details|. See LoadDetails for details. - void LoadBookmarks(LoadDetails* details); + // takes ownership of |details|. See BookmarkLoadDetails for details. + void LoadBookmarks(BookmarkLoadDetails* details); // Schedules saving the bookmark bar model to disk. void ScheduleSave(); @@ -157,8 +158,8 @@ class BookmarkStorage : public NotificationObserver, // Path to temporary file created during migrating bookmarks from history. const FilePath tmp_history_path_; - // See class description of LoadDetails for details on this. - scoped_ptr<LoadDetails> details_; + // See class description of BookmarkLoadDetails for details on this. + scoped_ptr<BookmarkLoadDetails> details_; DISALLOW_COPY_AND_ASSIGN(BookmarkStorage); }; diff --git a/chrome/browser/dom_ui/dom_ui_theme_source.cc b/chrome/browser/dom_ui/dom_ui_theme_source.cc index 9fa4f25..c871e42 100644 --- a/chrome/browser/dom_ui/dom_ui_theme_source.cc +++ b/chrome/browser/dom_ui/dom_ui_theme_source.cc @@ -7,6 +7,7 @@ #include "app/theme_provider.h" #include "base/message_loop.h" #include "chrome/browser/browser_theme_provider.h" +#include "chrome/browser/chrome_thread.h" #include "chrome/browser/dom_ui/ntp_resource_cache.h" #include "chrome/browser/profile.h" #include "chrome/browser/theme_resources_util.h" diff --git a/chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc b/chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc index 0f1e9eb..d7a6336 100644 --- a/chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc +++ b/chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/browser_theme_provider.h" +#include "chrome/browser/chrome_thread.h" #include "chrome/browser/dom_ui/dom_ui_theme_source.h" #include "chrome/browser/profile.h" #include "chrome/common/url_constants.h" diff --git a/chrome/browser/gtk/options/fonts_page_gtk.cc b/chrome/browser/gtk/options/fonts_page_gtk.cc index 7fa7285..0493df9 100644 --- a/chrome/browser/gtk/options/fonts_page_gtk.cc +++ b/chrome/browser/gtk/options/fonts_page_gtk.cc @@ -7,6 +7,7 @@ #include "app/l10n_util.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/gtk/options/options_layout_gtk.h" +#include "chrome/browser/profile.h" #include "chrome/common/gtk_util.h" #include "chrome/common/pref_names.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/gtk/options/general_page_gtk.cc b/chrome/browser/gtk/options/general_page_gtk.cc index 2054a8a..7594e1c 100644 --- a/chrome/browser/gtk/options/general_page_gtk.cc +++ b/chrome/browser/gtk/options/general_page_gtk.cc @@ -12,6 +12,7 @@ #include "chrome/browser/gtk/options/options_layout_gtk.h" #include "chrome/browser/gtk/options/url_picker_dialog_gtk.h" #include "chrome/browser/net/url_fixer_upper.h" +#include "chrome/browser/profile.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/session_startup_pref.h" #include "chrome/browser/tab_contents/tab_contents.h" diff --git a/chrome/browser/history/expire_history_backend_unittest.cc b/chrome/browser/history/expire_history_backend_unittest.cc index 17b67c4..2ccab9b61 100644 --- a/chrome/browser/history/expire_history_backend_unittest.cc +++ b/chrome/browser/history/expire_history_backend_unittest.cc @@ -13,6 +13,7 @@ #include "chrome/browser/history/archived_database.h" #include "chrome/browser/history/expire_history_backend.h" #include "chrome/browser/history/history_database.h" +#include "chrome/browser/history/history_notifications.h" #include "chrome/browser/history/text_database_manager.h" #include "chrome/browser/history/thumbnail_database.h" #include "chrome/common/notification_service.h" diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc index e1cf8a9..fdf7901 100644 --- a/chrome/browser/history/history.cc +++ b/chrome/browser/history/history.cc @@ -36,6 +36,7 @@ #include "chrome/browser/chrome_thread.h" #include "chrome/browser/history/download_types.h" #include "chrome/browser/history/history_backend.h" +#include "chrome/browser/history/history_notifications.h" #include "chrome/browser/history/history_types.h" #include "chrome/browser/history/in_memory_database.h" #include "chrome/browser/history/in_memory_history_backend.h" diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h index 1afe44d..09dc19e 100644 --- a/chrome/browser/history/history.h +++ b/chrome/browser/history/history.h @@ -15,7 +15,6 @@ #include "base/task.h" #include "chrome/browser/cancelable_request.h" #include "chrome/browser/favicon_service.h" -#include "chrome/browser/history/history_notifications.h" #include "chrome/browser/history/history_types.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/common/notification_registrar.h" @@ -46,6 +45,7 @@ namespace history { class InMemoryHistoryBackend; class HistoryBackend; class HistoryDatabase; +struct HistoryDetails; class HistoryQueryTest; class URLDatabase; diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index 1a3bd09..9734d4f 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -17,6 +17,7 @@ #include "chrome/browser/autocomplete/history_url_provider.h" #include "chrome/browser/bookmarks/bookmark_service.h" #include "chrome/browser/history/download_types.h" +#include "chrome/browser/history/history_notifications.h" #include "chrome/browser/history/history_publisher.h" #include "chrome/browser/history/in_memory_history_backend.h" #include "chrome/browser/history/page_usage_data.h" diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc index a1cebc1..84f1d95 100644 --- a/chrome/browser/history/history_backend_unittest.cc +++ b/chrome/browser/history/history_backend_unittest.cc @@ -9,6 +9,7 @@ #include "base/scoped_ptr.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/history/history_backend.h" +#include "chrome/browser/history/history_notifications.h" #include "chrome/browser/history/in_memory_history_backend.h" #include "chrome/browser/history/in_memory_database.h" #include "chrome/common/notification_service.h" diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index 47cd4e8..9e28372 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -36,6 +36,7 @@ #include "chrome/browser/history/history.h" #include "chrome/browser/history/history_backend.h" #include "chrome/browser/history/history_database.h" +#include "chrome/browser/history/history_notifications.h" #include "chrome/browser/history/in_memory_database.h" #include "chrome/browser/history/in_memory_history_backend.h" #include "chrome/browser/history/page_usage_data.h" diff --git a/chrome/browser/importer/firefox2_importer.cc b/chrome/browser/importer/firefox2_importer.cc index 794d97e..19c1a82 100644 --- a/chrome/browser/importer/firefox2_importer.cc +++ b/chrome/browser/importer/firefox2_importer.cc @@ -13,6 +13,7 @@ #include "base/stl_util-inl.h" #include "base/string_util.h" #include "base/values.h" +#include "chrome/browser/history/history_types.h" #include "chrome/browser/importer/firefox_importer_utils.h" #include "chrome/browser/importer/importer_bridge.h" #include "chrome/browser/importer/mork_reader.h" diff --git a/chrome/browser/importer/firefox2_importer.h b/chrome/browser/importer/firefox2_importer.h index 97b7318..79b6780 100644 --- a/chrome/browser/importer/firefox2_importer.h +++ b/chrome/browser/importer/firefox2_importer.h @@ -5,8 +5,9 @@ #ifndef CHROME_BROWSER_IMPORTER_FIREFOX2_IMPORTER_H_ #define CHROME_BROWSER_IMPORTER_FIREFOX2_IMPORTER_H_ -#include "chrome/browser/importer/importer.h" +#include <set> +#include "chrome/browser/importer/importer.h" #include "testing/gtest/include/gtest/gtest_prod.h" class TemplateURL; diff --git a/chrome/browser/importer/firefox3_importer.cc b/chrome/browser/importer/firefox3_importer.cc index c347b0c..028c6fa 100644 --- a/chrome/browser/importer/firefox3_importer.cc +++ b/chrome/browser/importer/firefox3_importer.cc @@ -12,6 +12,7 @@ #include "base/scoped_ptr.h" #include "base/stl_util-inl.h" #include "base/string_util.h" +#include "chrome/browser/history/history_types.h" #include "chrome/browser/importer/firefox2_importer.h" #include "chrome/browser/importer/firefox_importer_utils.h" #include "chrome/browser/importer/importer_bridge.h" diff --git a/chrome/browser/importer/firefox3_importer.h b/chrome/browser/importer/firefox3_importer.h index 5123961..04baf49 100644 --- a/chrome/browser/importer/firefox3_importer.h +++ b/chrome/browser/importer/firefox3_importer.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_IMPORTER_FIREFOX3_IMPORTER_H_ #include <map> +#include <set> #include <string> #include <vector> diff --git a/chrome/browser/importer/importer.h b/chrome/browser/importer/importer.h index 4c9220a..cb70cfa 100644 --- a/chrome/browser/importer/importer.h +++ b/chrome/browser/importer/importer.h @@ -14,8 +14,8 @@ #include "base/basictypes.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" +#include "base/time.h" #include "chrome/browser/bookmarks/bookmark_model_observer.h" -#include "chrome/browser/history/history_types.h" #include "chrome/browser/importer/importer_list.h" #include "chrome/common/notification_registrar.h" #include "googleurl/src/gurl.h" @@ -27,6 +27,11 @@ class TemplateURL; struct IE7PasswordInfo; +namespace history { +struct ImportedFavIconUsage; +class URLRow; +} + namespace webkit_glue { struct PasswordForm; } diff --git a/chrome/browser/importer/importer_bridge.cc b/chrome/browser/importer/importer_bridge.cc index eddb026..e646c7b 100644 --- a/chrome/browser/importer/importer_bridge.cc +++ b/chrome/browser/importer/importer_bridge.cc @@ -5,6 +5,7 @@ #include "chrome/browser/importer/importer_bridge.h" #include "chrome/browser/chrome_thread.h" +#include "chrome/browser/history/history_types.h" #include "chrome/browser/importer/importer.h" #if defined(OS_WIN) #include "chrome/browser/password_manager/ie7_password.h" diff --git a/chrome/browser/importer/safari_importer.mm b/chrome/browser/importer/safari_importer.mm index 18d6ae3..3118b31 100644 --- a/chrome/browser/importer/safari_importer.mm +++ b/chrome/browser/importer/safari_importer.mm @@ -16,6 +16,7 @@ #include "base/string16.h" #include "base/sys_string_conversions.h" #include "base/time.h" +#include "chrome/browser/history/history_types.h" #include "chrome/browser/importer/importer_bridge.h" #include "chrome/common/sqlite_utils.h" #include "chrome/common/url_constants.h" diff --git a/chrome/browser/importer/safari_importer_unittest.mm b/chrome/browser/importer/safari_importer_unittest.mm index cc5e189..5c8a153 100644 --- a/chrome/browser/importer/safari_importer_unittest.mm +++ b/chrome/browser/importer/safari_importer_unittest.mm @@ -9,6 +9,7 @@ #include "base/file_util.h" #include "base/path_service.h" #include "base/sys_string_conversions.h" +#include "chrome/browser/history/history_types.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/file_test_utils.h" #include "chrome/browser/importer/importer_bridge.h" diff --git a/chrome/browser/jumplist.cc b/chrome/browser/jumplist.cc index 03fab2f..327d929 100644 --- a/chrome/browser/jumplist.cc +++ b/chrome/browser/jumplist.cc @@ -27,6 +27,7 @@ #include "chrome/browser/history/history.h" #include "chrome/browser/history/page_usage_data.h" #include "chrome/browser/profile.h" +#include "chrome/browser/sessions/session_types.h" #include "chrome/browser/sessions/tab_restore_service.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" diff --git a/chrome/browser/notifications/desktop_notifications_unittest.h b/chrome/browser/notifications/desktop_notifications_unittest.h index 31b8051..b06aa6e 100644 --- a/chrome/browser/notifications/desktop_notifications_unittest.h +++ b/chrome/browser/notifications/desktop_notifications_unittest.h @@ -10,6 +10,7 @@ #include "base/message_loop.h" #include "chrome/browser/browser_list.h" +#include "chrome/browser/chrome_thread.h" #include "chrome/browser/notifications/balloon.h" #include "chrome/browser/notifications/balloon_collection.h" #include "chrome/browser/notifications/desktop_notification_service.h" diff --git a/chrome/browser/options_page_base.h b/chrome/browser/options_page_base.h index 6aac9c2..fee43d0 100644 --- a/chrome/browser/options_page_base.h +++ b/chrome/browser/options_page_base.h @@ -5,11 +5,14 @@ #ifndef CHROME_BROWSER_OPTIONS_PAGE_BASE_H_ #define CHROME_BROWSER_OPTIONS_PAGE_BASE_H_ +#include <string> + +#include "base/basictypes.h" #include "chrome/browser/options_window.h" -#include "chrome/browser/profile.h" #include "chrome/common/notification_observer.h" class PrefService; +class Profile; /////////////////////////////////////////////////////////////////////////////// // OptionsPageBase diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 7a7c89a..ebe224f 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -26,6 +26,7 @@ #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/extensions/user_script_master.h" #include "chrome/browser/favicon_service.h" +#include "chrome/browser/spellcheck_host.h" #include "chrome/browser/strict_transport_security_persister.h" #include "chrome/browser/history/history.h" #include "chrome/browser/in_process_webkit/webkit_context.h" diff --git a/chrome/browser/profile.h b/chrome/browser/profile.h index 1f3c4a3..51abbb3 100644 --- a/chrome/browser/profile.h +++ b/chrome/browser/profile.h @@ -14,7 +14,7 @@ #include "base/file_path.h" #include "base/scoped_ptr.h" #include "base/timer.h" -#include "chrome/browser/spellcheck_host.h" +#include "chrome/browser/spellcheck_host_observer.h" #include "chrome/common/notification_registrar.h" #if defined(OS_CHROMEOS) @@ -51,6 +51,7 @@ class PrefService; class ProfileSyncService; class SearchVersusNavigateClassifier; class SessionService; +class SpellCheckHost; class SSLConfigServiceManager; class SSLHostState; class StrictTransportSecurityPersister; @@ -387,7 +388,7 @@ class OffTheRecordProfileImpl; // The default profile implementation. class ProfileImpl : public Profile, - public SpellCheckHost::Observer, + public SpellCheckHostObserver, public NotificationObserver { public: virtual ~ProfileImpl(); @@ -458,7 +459,7 @@ class ProfileImpl : public Profile, const NotificationSource& source, const NotificationDetails& details); - // SpellCheckHost::Observer implementation. + // SpellCheckHostObserver implementation. virtual void SpellCheckHostInitialized(); private: diff --git a/chrome/browser/search_engines/template_url_model.cc b/chrome/browser/search_engines/template_url_model.cc index 0d7bc58..525a2f1 100644 --- a/chrome/browser/search_engines/template_url_model.cc +++ b/chrome/browser/search_engines/template_url_model.cc @@ -10,6 +10,7 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/google_url_tracker.h" #include "chrome/browser/history/history.h" +#include "chrome/browser/history/history_notifications.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/profile.h" #include "chrome/browser/rlz/rlz.h" diff --git a/chrome/browser/search_engines/template_url_model_unittest.cc b/chrome/browser/search_engines/template_url_model_unittest.cc index f0c5e80..1edad67 100644 --- a/chrome/browser/search_engines/template_url_model_unittest.cc +++ b/chrome/browser/search_engines/template_url_model_unittest.cc @@ -4,6 +4,7 @@ #include "base/path_service.h" #include "base/thread.h" +#include "chrome/browser/history/history_notifications.h" #include "chrome/browser/webdata/web_database.h" #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc index dc7b7b5..aeaceab 100644 --- a/chrome/browser/sessions/tab_restore_service.cc +++ b/chrome/browser/sessions/tab_restore_service.cc @@ -15,6 +15,7 @@ #include "chrome/browser/profile.h" #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sessions/session_command.h" +#include "chrome/browser/sessions/session_types.h" #include "chrome/browser/tab_contents/navigation_controller.h" #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/tab_contents.h" @@ -118,6 +119,17 @@ void RemoveEntryByID(SessionID::id_type id, } // namespace +TabRestoreService::Tab::Tab() + : Entry(TAB), + current_navigation_index(-1), + browser_id(0), + tabstrip_index(-1), + pinned(false) { +} + +TabRestoreService::Window::Window() : Entry(WINDOW), selected_tab_index(-1) { +} + TabRestoreService::TabRestoreService(Profile* profile, TabRestoreService::TimeFactory* time_factory) : BaseSessionService(BaseSessionService::TAB_RESTORE, profile, diff --git a/chrome/browser/sessions/tab_restore_service.h b/chrome/browser/sessions/tab_restore_service.h index ba351ab..ce488be 100644 --- a/chrome/browser/sessions/tab_restore_service.h +++ b/chrome/browser/sessions/tab_restore_service.h @@ -6,17 +6,18 @@ #define CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_H_ #include <list> +#include <set> #include <vector> #include "base/observer_list.h" #include "base/time.h" #include "chrome/browser/sessions/base_session_service.h" #include "chrome/browser/sessions/session_id.h" -#include "chrome/browser/sessions/session_types.h" class Browser; class NavigationController; class Profile; +struct SessionWindow; // TabRestoreService is responsible for maintaining the most recently closed // tabs and windows. When a tab is closed @@ -79,12 +80,7 @@ class TabRestoreService : public BaseSessionService { // Represents a previously open tab. struct Tab : public Entry { - Tab() - : Entry(TAB), - current_navigation_index(-1), - browser_id(0), - tabstrip_index(-1), - pinned(false) {} + Tab(); bool has_browser() const { return browser_id > 0; } @@ -107,7 +103,7 @@ class TabRestoreService : public BaseSessionService { // Represents a previously open window. struct Window : public Entry { - Window() : Entry(WINDOW), selected_tab_index(-1) {} + Window(); // The tabs that comprised the window, in order. std::vector<Tab> tabs; diff --git a/chrome/browser/spellcheck_host.cc b/chrome/browser/spellcheck_host.cc index f716e7a..2884d5a 100644 --- a/chrome/browser/spellcheck_host.cc +++ b/chrome/browser/spellcheck_host.cc @@ -12,6 +12,8 @@ #include "base/path_service.h" #include "base/string_util.h" #include "chrome/browser/profile.h" +#include "chrome/browser/net/url_request_context_getter.h" +#include "chrome/browser/spellcheck_host_observer.h" #include "chrome/browser/spellchecker_platform_engine.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" @@ -38,7 +40,7 @@ FilePath GetFallbackFilePath(const FilePath& first_choice) { } // namespace // Constructed on UI thread. -SpellCheckHost::SpellCheckHost(Observer* observer, +SpellCheckHost::SpellCheckHost(SpellCheckHostObserver* observer, const std::string& language, URLRequestContextGetter* request_context_getter) : observer_(observer), diff --git a/chrome/browser/spellcheck_host.h b/chrome/browser/spellcheck_host.h index 325921a..493f26c 100644 --- a/chrome/browser/spellcheck_host.h +++ b/chrome/browser/spellcheck_host.h @@ -13,20 +13,16 @@ #include "base/ref_counted.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/net/url_fetcher.h" -#include "chrome/browser/net/url_request_context_getter.h" class Profile; +class SpellCheckHostObserver; +class URLRequestContextGetter; class SpellCheckHost : public base::RefCountedThreadSafe<SpellCheckHost, ChromeThread::DeleteOnFileThread>, public URLFetcher::Delegate { public: - class Observer { - public: - virtual void SpellCheckHostInitialized() = 0; - }; - - SpellCheckHost(Observer* observer, + SpellCheckHost(SpellCheckHostObserver* observer, const std::string& language, URLRequestContextGetter* request_context_getter); @@ -100,7 +96,7 @@ class SpellCheckHost : public base::RefCountedThreadSafe<SpellCheckHost, void SaveDictionaryData(); // May be NULL. - Observer* observer_; + SpellCheckHostObserver* observer_; // The desired location of the dictionary file (whether or not t exists yet). FilePath bdict_file_path_; diff --git a/chrome/browser/spellcheck_host_observer.h b/chrome/browser/spellcheck_host_observer.h new file mode 100644 index 0000000..222cd91 --- /dev/null +++ b/chrome/browser/spellcheck_host_observer.h @@ -0,0 +1,15 @@ +// Copyright (c) 2009 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_SPELLCHECK_HOST_OBSERVER_H_ +#define CHROME_BROWSER_SPELLCHECK_HOST_OBSERVER_H_ + +// Observer for the SpellCheckHost. +class SpellCheckHostObserver { + public: + // Invoked on the UI thread when SpellCheckHost is initialized. + virtual void SpellCheckHostInitialized() = 0; +}; + +#endif // CHROME_BROWSER_SPELLCHECK_HOST_OBSERVER_H_ diff --git a/chrome/browser/thumbnail_store.cc b/chrome/browser/thumbnail_store.cc index 2a937dd..d23719f 100644 --- a/chrome/browser/thumbnail_store.cc +++ b/chrome/browser/thumbnail_store.cc @@ -17,6 +17,7 @@ #include "base/thread.h" #include "base/values.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/history/history_notifications.h" #include "chrome/browser/profile.h" #include "chrome/common/pref_service.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc index 221383b..3a5b2c1 100644 --- a/chrome/browser/views/options/advanced_contents_view.cc +++ b/chrome/browser/views/options/advanced_contents_view.cc @@ -18,7 +18,9 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/file_util.h" +#include "base/message_loop.h" #include "base/path_service.h" +#include "base/thread.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" @@ -26,6 +28,7 @@ #include "chrome/browser/gears_integration.h" #include "chrome/browser/net/dns_global.h" #include "chrome/browser/options_util.h" +#include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/resource_dispatcher_host.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/shell_dialogs.h" diff --git a/chrome/browser/views/options/fonts_page_view.cc b/chrome/browser/views/options/fonts_page_view.cc index 72b5c7f..17aadae7 100644 --- a/chrome/browser/views/options/fonts_page_view.cc +++ b/chrome/browser/views/options/fonts_page_view.cc @@ -21,6 +21,7 @@ #include "base/string_util.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/character_encoding.h" +#include "chrome/browser/profile.h" #include "chrome/browser/shell_dialogs.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" diff --git a/chrome/browser/views/options/passwords_page_view.h b/chrome/browser/views/options/passwords_page_view.h index 6de8785..eeb752a 100644 --- a/chrome/browser/views/options/passwords_page_view.h +++ b/chrome/browser/views/options/passwords_page_view.h @@ -12,6 +12,7 @@ #include "base/scoped_ptr.h" #include "base/stl_util-inl.h" #include "chrome/browser/password_manager/password_store.h" +#include "chrome/browser/profile.h" #include "chrome/browser/views/confirm_message_box_dialog.h" #include "chrome/browser/views/options/options_page_view.h" #include "views/controls/button/native_button.h" @@ -22,8 +23,6 @@ #include "views/window/window.h" #include "webkit/glue/password_form.h" -class Profile; - /////////////////////////////////////////////////////////////////////////////// // PasswordTableModelObserver // An observer interface to notify change of row count in a table model. This diff --git a/chrome/browser/visitedlink_master.cc b/chrome/browser/visitedlink_master.cc index 7292551..c2aa3fe 100644 --- a/chrome/browser/visitedlink_master.cc +++ b/chrome/browser/visitedlink_master.cc @@ -25,6 +25,7 @@ #include "base/stack_container.h" #include "base/string_util.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/chrome_thread.h" #include "chrome/browser/history/history.h" #include "chrome/browser/profile.h" |