From c36a9e1dd2f21fce9ac430bd896b9f76e9a8eb73 Mon Sep 17 00:00:00 2001 From: "avi@chromium.org" Date: Tue, 5 Jun 2012 14:31:02 +0000 Subject: TabContentsWrapper -> TabContents, part 1. BUG=131026 TEST=no change Review URL: https://chromiumcodereview.appspot.com/10528002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140523 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/autocomplete/autocomplete_edit.h | 3 +- chrome/browser/autofill/autofill_manager.h | 3 +- .../autofill/test_autofill_external_delegate.h | 3 +- chrome/browser/automation/automation_util.h | 3 +- .../bookmarks/bookmark_manager_extension_api.h | 3 +- .../chromeos/login/simple_web_view_dialog.h | 3 +- chrome/browser/chromeos/login/webui_login_view.h | 3 +- chrome/browser/debugger/devtools_window.h | 3 +- chrome/browser/download/download_danger_prompt.h | 3 +- chrome/browser/download/download_request_limiter.h | 3 +- .../api/extension_action/extension_actions_api.h | 3 +- .../api/offscreen_tabs/offscreen_tabs_api.h | 3 +- chrome/browser/extensions/app_notify_channel_ui.h | 3 +- chrome/browser/extensions/extension_install_ui.h | 3 +- chrome/browser/extensions/extension_tab_helper.h | 3 +- .../extensions/extension_tab_helper_delegate.h | 3 +- chrome/browser/extensions/extension_tab_util.h | 3 +- chrome/browser/extensions/extension_tabs_module.h | 3 +- chrome/browser/extensions/page_action_controller.h | 3 +- .../browser/extensions/script_badge_controller.h | 3 +- .../external_tab/external_tab_container_win.h | 3 +- .../browser/google/google_url_tracker_unittest.cc | 3 +- chrome/browser/instant/instant_controller.h | 3 +- chrome/browser/instant/instant_delegate.h | 3 +- chrome/browser/instant/instant_loader.h | 3 +- chrome/browser/instant/instant_unload_handler.h | 3 +- chrome/browser/omnibox_search_hint.h | 3 +- .../password_manager_delegate_impl.h | 3 +- chrome/browser/plugin_installer.h | 3 +- chrome/browser/plugin_observer.h | 3 +- chrome/browser/prerender/prerender_contents.h | 3 +- chrome/browser/prerender/prerender_tab_helper.h | 3 +- .../browser/printing/background_printing_manager.h | 3 +- .../printing/print_preview_context_menu_observer.h | 3 +- .../printing/print_preview_message_handler.h | 3 +- .../printing/print_preview_tab_controller.h | 3 +- chrome/browser/printing/print_view_manager.h | 3 +- .../safe_browsing/safe_browsing_tab_observer.h | 3 +- chrome/browser/sessions/session_service.h | 3 +- chrome/browser/ssl_client_certificate_selector.h | 3 +- .../browser/tab_contents/tab_contents_ssl_helper.h | 3 +- .../tab_contents/web_drag_bookmark_handler_aura.h | 3 +- .../tab_contents/web_drag_bookmark_handler_gtk.h | 3 +- .../tab_contents/web_drag_bookmark_handler_mac.h | 3 +- .../tab_contents/web_drag_bookmark_handler_win.h | 3 +- chrome/browser/task_manager/task_manager.h | 3 +- .../task_manager/task_manager_resource_providers.h | 3 +- .../ui/blocked_content/blocked_content_container.h | 3 +- .../blocked_content/blocked_content_tab_helper.h | 3 +- .../blocked_content_tab_helper_delegate.h | 3 +- chrome/browser/ui/bookmarks/bookmark_tab_helper.h | 3 +- .../ui/bookmarks/bookmark_tab_helper_delegate.h | 3 +- chrome/browser/ui/browser_dialogs.h | 3 +- chrome/browser/ui/browser_navigator.h | 3 +- chrome/browser/ui/browser_navigator_browsertest.h | 3 +- chrome/browser/ui/browser_window.h | 3 +- .../browser/ui/cocoa/applescript/tab_applescript.h | 3 +- chrome/browser/ui/cocoa/constrained_window_mac.h | 3 +- .../cocoa/content_settings/collected_cookies_mac.h | 3 +- .../cocoa/infobars/infobar_container_controller.h | 3 +- .../browser/ui/cocoa/tab_contents/favicon_util.h | 3 +- .../ui/cocoa/tab_modal_confirm_dialog_mac.h | 3 +- .../cocoa/tabs/tab_strip_model_observer_bridge.h | 3 +- .../ui/cocoa/web_dialog_window_controller.h | 3 +- chrome/browser/ui/cocoa/web_intent_picker_cocoa.h | 3 +- chrome/browser/ui/constrained_window_tab_helper.h | 3 +- .../ui/constrained_window_tab_helper_delegate.h | 3 +- .../content_setting_bubble_model.h | 3 +- .../content_setting_bubble_model_delegate.h | 3 +- chrome/browser/ui/extensions/shell_window.h | 3 +- chrome/browser/ui/find_bar/find_bar_controller.h | 3 +- chrome/browser/ui/fullscreen_controller.h | 3 +- chrome/browser/ui/gtk/collected_cookies_gtk.h | 3 +- chrome/browser/ui/gtk/constrained_window_gtk.h | 3 +- .../gtk/create_application_shortcuts_dialog_gtk.h | 3 +- chrome/browser/ui/gtk/tab_contents_container_gtk.h | 3 +- .../browser/ui/gtk/tab_modal_confirm_dialog_gtk.h | 3 +- chrome/browser/ui/gtk/tabs/drag_data.h | 3 +- .../ui/gtk/tabs/dragged_tab_controller_gtk.h | 3 +- chrome/browser/ui/gtk/web_dialog_gtk.h | 3 +- chrome/browser/ui/gtk/web_intent_picker_gtk.h | 3 +- chrome/browser/ui/gtk/website_settings_popup_gtk.h | 3 +- chrome/browser/ui/intents/web_intent_picker.h | 3 +- .../ui/intents/web_intent_picker_controller.h | 3 +- chrome/browser/ui/media_stream_infobar_delegate.h | 3 +- chrome/browser/ui/pdf/pdf_tab_observer.h | 3 +- chrome/browser/ui/pdf/pdf_unsupported_feature.h | 3 +- chrome/browser/ui/snapshot_tab_helper.h | 3 +- .../browser/ui/startup/startup_browser_creator.h | 3 +- .../tab_contents_wrapper_synced_tab_delegate.h | 3 +- .../ui/tab_contents/core_tab_helper_delegate.h | 3 +- chrome/browser/ui/tab_contents/tab_contents.cc | 242 ++++++++++++++++ chrome/browser/ui/tab_contents/tab_contents.h | 318 +++++++++++++++++++++ .../ui/tab_contents/tab_contents_iterator.h | 3 +- .../ui/tab_contents/tab_contents_wrapper.cc | 243 ---------------- .../browser/ui/tab_contents/tab_contents_wrapper.h | 309 +------------------- .../ui/tab_contents/test_tab_contents_wrapper.h | 3 +- .../ui/tab_modal_confirm_dialog_browsertest.h | 3 +- chrome/browser/ui/tabs/tab_strip_model.h | 3 +- chrome/browser/ui/tabs/tab_strip_model_delegate.h | 3 +- chrome/browser/ui/tabs/tab_strip_model_observer.h | 3 +- .../ui/tabs/tab_strip_model_order_controller.h | 3 +- .../launcher/browser_launcher_item_controller.h | 3 +- .../ash/launcher/chrome_launcher_controller.h | 3 +- chrome/browser/ui/views/browser_dialogs.h | 3 +- chrome/browser/ui/views/collected_cookies_views.h | 3 +- chrome/browser/ui/views/constrained_window_views.h | 3 +- .../ui/views/create_application_shortcut_view.h | 3 +- .../ui/views/location_bar/location_bar_view.h | 3 +- .../ui/views/ssl_client_certificate_selector.h | 3 +- chrome/browser/ui/views/stubs_aura.cc | 3 +- .../ui/views/tab_modal_confirm_dialog_views.h | 3 +- chrome/browser/ui/web_applications/web_app_ui.h | 3 +- .../browser/ui/website_settings/website_settings.h | 3 +- .../ui/website_settings/website_settings_ui.h | 3 +- .../ui/webui/print_preview/print_preview_handler.h | 3 +- .../ui/webui/tab_modal_confirm_dialog_webui.h | 3 +- chrome/browser/ui/zoom/zoom_controller.h | 3 +- chrome/browser/ui/zoom/zoom_observer.h | 3 +- chrome/chrome_browser.gypi | 4 +- chrome/test/base/ui_test_utils.h | 3 +- ui/web_dialogs/constrained_web_dialog_ui.h | 3 +- 122 files changed, 798 insertions(+), 669 deletions(-) create mode 100644 chrome/browser/ui/tab_contents/tab_contents.cc create mode 100644 chrome/browser/ui/tab_contents/tab_contents.h delete mode 100644 chrome/browser/ui/tab_contents/tab_contents_wrapper.cc diff --git a/chrome/browser/autocomplete/autocomplete_edit.h b/chrome/browser/autocomplete/autocomplete_edit.h index ce827ca..dba8702 100644 --- a/chrome/browser/autocomplete/autocomplete_edit.h +++ b/chrome/browser/autocomplete/autocomplete_edit.h @@ -27,7 +27,8 @@ class InstantController; class OmniboxView; class Profile; class SkBitmap; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace gfx { class Rect; diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h index f70314b6..e7c011f 100644 --- a/chrome/browser/autofill/autofill_manager.h +++ b/chrome/browser/autofill/autofill_manager.h @@ -36,7 +36,8 @@ class CreditCard; class PersonalDataManager; class PrefService; class ProfileSyncService; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; struct ViewHostMsg_FrameNavigate_Params; diff --git a/chrome/browser/autofill/test_autofill_external_delegate.h b/chrome/browser/autofill/test_autofill_external_delegate.h index 2a6ef203..59ea97f 100644 --- a/chrome/browser/autofill/test_autofill_external_delegate.h +++ b/chrome/browser/autofill/test_autofill_external_delegate.h @@ -9,7 +9,8 @@ #include "chrome/browser/autofill/autofill_external_delegate.h" class AutofillManager; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // This test class is meant to give tests a base AutofillExternalDelegate // class that requires no additional work to compile with (i.e. all the diff --git a/chrome/browser/automation/automation_util.h b/chrome/browser/automation/automation_util.h index 942a08b..8a63c8e 100644 --- a/chrome/browser/automation/automation_util.h +++ b/chrome/browser/automation/automation_util.h @@ -15,7 +15,8 @@ class AutomationProvider; class Browser; class GURL; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace content { class RenderViewHost; diff --git a/chrome/browser/bookmarks/bookmark_manager_extension_api.h b/chrome/browser/bookmarks/bookmark_manager_extension_api.h index 9e0fe8a..2f9f025 100644 --- a/chrome/browser/bookmarks/bookmark_manager_extension_api.h +++ b/chrome/browser/bookmarks/bookmark_manager_extension_api.h @@ -13,7 +13,8 @@ struct BookmarkNodeData; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace base { class ListValue; diff --git a/chrome/browser/chromeos/login/simple_web_view_dialog.h b/chrome/browser/chromeos/login/simple_web_view_dialog.h index 60a0d55..312ef2c 100644 --- a/chrome/browser/chromeos/login/simple_web_view_dialog.h +++ b/chrome/browser/chromeos/login/simple_web_view_dialog.h @@ -19,7 +19,8 @@ class Profile; class ReloadButton; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class ToolbarModel; namespace views { diff --git a/chrome/browser/chromeos/login/webui_login_view.h b/chrome/browser/chromeos/login/webui_login_view.h index 327c6ee..c481065 100644 --- a/chrome/browser/chromeos/login/webui_login_view.h +++ b/chrome/browser/chromeos/login/webui_login_view.h @@ -29,7 +29,8 @@ class WebView; class Widget; } -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace chromeos { diff --git a/chrome/browser/debugger/devtools_window.h b/chrome/browser/debugger/devtools_window.h index 6c40ba9..8a4f8ff 100644 --- a/chrome/browser/debugger/devtools_window.h +++ b/chrome/browser/debugger/devtools_window.h @@ -27,7 +27,8 @@ class Browser; class BrowserWindow; class PrefService; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace base { class Value; diff --git a/chrome/browser/download/download_danger_prompt.h b/chrome/browser/download/download_danger_prompt.h index ac0f677..08c1527 100644 --- a/chrome/browser/download/download_danger_prompt.h +++ b/chrome/browser/download/download_danger_prompt.h @@ -9,7 +9,8 @@ #include "base/callback_forward.h" class ConstrainedWindow; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace content { class DownloadItem; diff --git a/chrome/browser/download/download_request_limiter.h b/chrome/browser/download/download_request_limiter.h index 420de0e..6162d60 100644 --- a/chrome/browser/download/download_request_limiter.h +++ b/chrome/browser/download/download_request_limiter.h @@ -18,7 +18,8 @@ #include "content/public/browser/web_contents_observer.h" class DownloadRequestInfoBarDelegate; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace content { class NavigationController; diff --git a/chrome/browser/extensions/api/extension_action/extension_actions_api.h b/chrome/browser/extensions/api/extension_action/extension_actions_api.h index 42be69e..f9e86d4 100644 --- a/chrome/browser/extensions/api/extension_action/extension_actions_api.h +++ b/chrome/browser/extensions/api/extension_action/extension_actions_api.h @@ -12,7 +12,8 @@ namespace base { class DictionaryValue; } -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Implementation of both the browserAction and pageAction APIs. // diff --git a/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h b/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h index 612b7b4..4b4e5b1 100644 --- a/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h +++ b/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h @@ -28,7 +28,8 @@ class BackingStore; class SkBitmap; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace content { class WebContents; } // namespace content diff --git a/chrome/browser/extensions/app_notify_channel_ui.h b/chrome/browser/extensions/app_notify_channel_ui.h index e345af8..45209a6 100644 --- a/chrome/browser/extensions/app_notify_channel_ui.h +++ b/chrome/browser/extensions/app_notify_channel_ui.h @@ -12,7 +12,8 @@ #include "chrome/browser/sync/profile_sync_service_observer.h" class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // An interface for prompting a user to sign in to sync so that we can create // an app notification channel for one of their apps. diff --git a/chrome/browser/extensions/extension_install_ui.h b/chrome/browser/extensions/extension_install_ui.h index af4da9b..58525e1 100644 --- a/chrome/browser/extensions/extension_install_ui.h +++ b/chrome/browser/extensions/extension_install_ui.h @@ -22,7 +22,8 @@ class ExtensionPermissionSet; class MessageLoop; class Profile; class InfoBarDelegate; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace base { class DictionaryValue; diff --git a/chrome/browser/extensions/extension_tab_helper.h b/chrome/browser/extensions/extension_tab_helper.h index b7c28e5..66ed9f1 100644 --- a/chrome/browser/extensions/extension_tab_helper.h +++ b/chrome/browser/extensions/extension_tab_helper.h @@ -18,7 +18,8 @@ #include "third_party/skia/include/core/SkBitmap.h" class ExtensionTabHelperDelegate; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; struct WebApplicationInfo; namespace content { diff --git a/chrome/browser/extensions/extension_tab_helper_delegate.h b/chrome/browser/extensions/extension_tab_helper_delegate.h index ac26f4e..e7b0827 100644 --- a/chrome/browser/extensions/extension_tab_helper_delegate.h +++ b/chrome/browser/extensions/extension_tab_helper_delegate.h @@ -8,7 +8,8 @@ #include "base/basictypes.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; struct WebApplicationInfo; // Objects implement this interface to get notified about changes in the diff --git a/chrome/browser/extensions/extension_tab_util.h b/chrome/browser/extensions/extension_tab_util.h index d6659e6..4fe0092 100644 --- a/chrome/browser/extensions/extension_tab_util.h +++ b/chrome/browser/extensions/extension_tab_util.h @@ -11,7 +11,8 @@ class Browser; class GURL; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TabStripModel; namespace base { diff --git a/chrome/browser/extensions/extension_tabs_module.h b/chrome/browser/extensions/extension_tabs_module.h index 6b28bb4..40934cc 100644 --- a/chrome/browser/extensions/extension_tabs_module.h +++ b/chrome/browser/extensions/extension_tabs_module.h @@ -18,7 +18,8 @@ class BackingStore; class GURL; class SkBitmap; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace base { class DictionaryValue; diff --git a/chrome/browser/extensions/page_action_controller.h b/chrome/browser/extensions/page_action_controller.h index 333d5d5..3c7c770 100644 --- a/chrome/browser/extensions/page_action_controller.h +++ b/chrome/browser/extensions/page_action_controller.h @@ -13,7 +13,8 @@ #include "chrome/browser/extensions/location_bar_controller.h" class ExtensionService; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace extensions { diff --git a/chrome/browser/extensions/script_badge_controller.h b/chrome/browser/extensions/script_badge_controller.h index 6dcc0a1..7740be8 100644 --- a/chrome/browser/extensions/script_badge_controller.h +++ b/chrome/browser/extensions/script_badge_controller.h @@ -20,7 +20,8 @@ class ExtensionAction; class ExtensionService; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace IPC { class Message; diff --git a/chrome/browser/external_tab/external_tab_container_win.h b/chrome/browser/external_tab/external_tab_container_win.h index 52413b3..e9a26d2 100644 --- a/chrome/browser/external_tab/external_tab_container_win.h +++ b/chrome/browser/external_tab/external_tab_container_win.h @@ -31,7 +31,8 @@ class AutomationProvider; class Browser; class Profile; class TabContentsContainer; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class RenderViewContextMenuViews; struct NavigationInfo; diff --git a/chrome/browser/google/google_url_tracker_unittest.cc b/chrome/browser/google/google_url_tracker_unittest.cc index 8612028..a22bc97 100644 --- a/chrome/browser/google/google_url_tracker_unittest.cc +++ b/chrome/browser/google/google_url_tracker_unittest.cc @@ -20,7 +20,8 @@ #include "content/public/test/test_url_fetcher_factory.h" #include "testing/gtest/include/gtest/gtest.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // TestNotificationObserver --------------------------------------------------- diff --git a/chrome/browser/instant/instant_controller.h b/chrome/browser/instant/instant_controller.h index ba1d62a..fc8e80f 100644 --- a/chrome/browser/instant/instant_controller.h +++ b/chrome/browser/instant/instant_controller.h @@ -29,7 +29,8 @@ class InstantLoader; class InstantTest; class PrefService; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TemplateURL; // InstantController maintains a WebContents that is intended to give a preview diff --git a/chrome/browser/instant/instant_delegate.h b/chrome/browser/instant/instant_delegate.h index 21511d4..23a41fb 100644 --- a/chrome/browser/instant/instant_delegate.h +++ b/chrome/browser/instant/instant_delegate.h @@ -9,7 +9,8 @@ #include "base/string16.h" #include "chrome/common/instant_types.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace gfx { class Rect; diff --git a/chrome/browser/instant/instant_loader.h b/chrome/browser/instant/instant_loader.h index 5ac326c..bb82723 100644 --- a/chrome/browser/instant/instant_loader.h +++ b/chrome/browser/instant/instant_loader.h @@ -24,7 +24,8 @@ class InstantLoaderDelegate; class InstantLoaderManagerTest; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TemplateURL; namespace content { diff --git a/chrome/browser/instant/instant_unload_handler.h b/chrome/browser/instant/instant_unload_handler.h index 3a1f1a4..1b2648c 100644 --- a/chrome/browser/instant/instant_unload_handler.h +++ b/chrome/browser/instant/instant_unload_handler.h @@ -9,7 +9,8 @@ #include "base/memory/scoped_vector.h" class Browser; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // InstantUnloadHandler makes sure the before unload and unload handler is run // when using instant. When the user commits the instant preview the existing diff --git a/chrome/browser/omnibox_search_hint.h b/chrome/browser/omnibox_search_hint.h index 348abf2..859edf9 100644 --- a/chrome/browser/omnibox_search_hint.h +++ b/chrome/browser/omnibox_search_hint.h @@ -14,7 +14,8 @@ #include "content/public/browser/notification_registrar.h" class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // This class is responsible for showing an info-bar that tells the user she // can type her search query directly in the omnibox. diff --git a/chrome/browser/password_manager/password_manager_delegate_impl.h b/chrome/browser/password_manager/password_manager_delegate_impl.h index 33bab0e..1cac93c 100644 --- a/chrome/browser/password_manager/password_manager_delegate_impl.h +++ b/chrome/browser/password_manager/password_manager_delegate_impl.h @@ -10,7 +10,8 @@ #include "base/compiler_specific.h" #include "chrome/browser/password_manager/password_manager_delegate.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class PasswordManagerDelegateImpl : public PasswordManagerDelegate { public: diff --git a/chrome/browser/plugin_installer.h b/chrome/browser/plugin_installer.h index 89cc7c7..52fe9c3 100644 --- a/chrome/browser/plugin_installer.h +++ b/chrome/browser/plugin_installer.h @@ -16,7 +16,8 @@ class FilePath; class PluginInstallerObserver; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class WeakPluginInstallerObserver; namespace content { diff --git a/chrome/browser/plugin_observer.h b/chrome/browser/plugin_observer.h index 3861f76..70d4bab 100644 --- a/chrome/browser/plugin_observer.h +++ b/chrome/browser/plugin_observer.h @@ -16,7 +16,8 @@ class GURL; class InfoBarDelegate; class PluginFinder; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; #if defined(ENABLE_PLUGIN_INSTALLATION) class PluginInstaller; diff --git a/chrome/browser/prerender/prerender_contents.h b/chrome/browser/prerender/prerender_contents.h index 0687345..0859c3b 100644 --- a/chrome/browser/prerender/prerender_contents.h +++ b/chrome/browser/prerender/prerender_contents.h @@ -22,7 +22,8 @@ #include "ui/gfx/size.h" class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; struct FaviconURL; namespace base { diff --git a/chrome/browser/prerender/prerender_tab_helper.h b/chrome/browser/prerender/prerender_tab_helper.h index 7036aa4..630433c 100644 --- a/chrome/browser/prerender/prerender_tab_helper.h +++ b/chrome/browser/prerender/prerender_tab_helper.h @@ -10,7 +10,8 @@ #include "content/public/browser/web_contents_observer.h" #include "googleurl/src/gurl.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace prerender { diff --git a/chrome/browser/printing/background_printing_manager.h b/chrome/browser/printing/background_printing_manager.h index 4a7e12e..b7df75a 100644 --- a/chrome/browser/printing/background_printing_manager.h +++ b/chrome/browser/printing/background_printing_manager.h @@ -14,7 +14,8 @@ #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace content { class RenderProcessHost; diff --git a/chrome/browser/printing/print_preview_context_menu_observer.h b/chrome/browser/printing/print_preview_context_menu_observer.h index b43e8e1..cf6fdc2 100644 --- a/chrome/browser/printing/print_preview_context_menu_observer.h +++ b/chrome/browser/printing/print_preview_context_menu_observer.h @@ -10,7 +10,8 @@ #include "base/compiler_specific.h" #include "chrome/browser/tab_contents/render_view_context_menu_observer.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class PrintPreviewContextMenuObserver : public RenderViewContextMenuObserver { public: diff --git a/chrome/browser/printing/print_preview_message_handler.h b/chrome/browser/printing/print_preview_message_handler.h index b5aa5f4..20c1487 100644 --- a/chrome/browser/printing/print_preview_message_handler.h +++ b/chrome/browser/printing/print_preview_message_handler.h @@ -10,7 +10,8 @@ #include "content/public/browser/web_contents_observer.h" class PrintPreviewUI; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; struct PrintHostMsg_DidGetPreviewPageCount_Params; struct PrintHostMsg_DidPreviewDocument_Params; struct PrintHostMsg_DidPreviewPage_Params; diff --git a/chrome/browser/printing/print_preview_tab_controller.h b/chrome/browser/printing/print_preview_tab_controller.h index 918089c..5307378 100644 --- a/chrome/browser/printing/print_preview_tab_controller.h +++ b/chrome/browser/printing/print_preview_tab_controller.h @@ -14,7 +14,8 @@ #include "content/public/browser/notification_registrar.h" class GURL; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace content { struct LoadCommittedDetails; diff --git a/chrome/browser/printing/print_view_manager.h b/chrome/browser/printing/print_view_manager.h index f0f3b71..8972db8 100644 --- a/chrome/browser/printing/print_view_manager.h +++ b/chrome/browser/printing/print_view_manager.h @@ -13,7 +13,8 @@ #include "content/public/browser/web_contents_observer.h" #include "printing/printed_pages_source.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; struct PrintHostMsg_DidPrintPage_Params; namespace content { diff --git a/chrome/browser/safe_browsing/safe_browsing_tab_observer.h b/chrome/browser/safe_browsing/safe_browsing_tab_observer.h index 6102944..675a5d9 100644 --- a/chrome/browser/safe_browsing/safe_browsing_tab_observer.h +++ b/chrome/browser/safe_browsing/safe_browsing_tab_observer.h @@ -10,7 +10,8 @@ #include "chrome/browser/prefs/pref_change_registrar.h" #include "content/public/browser/notification_observer.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace safe_browsing { diff --git a/chrome/browser/sessions/session_service.h b/chrome/browser/sessions/session_service.h index f2f4cc1..7381d9e 100644 --- a/chrome/browser/sessions/session_service.h +++ b/chrome/browser/sessions/session_service.h @@ -23,7 +23,8 @@ class Profile; class SessionCommand; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; struct SessionTab; struct SessionWindow; diff --git a/chrome/browser/ssl_client_certificate_selector.h b/chrome/browser/ssl_client_certificate_selector.h index 3743228..e9e0a00 100644 --- a/chrome/browser/ssl_client_certificate_selector.h +++ b/chrome/browser/ssl_client_certificate_selector.h @@ -8,7 +8,8 @@ #include "base/callback_forward.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace net { class HttpNetworkSession; diff --git a/chrome/browser/tab_contents/tab_contents_ssl_helper.h b/chrome/browser/tab_contents/tab_contents_ssl_helper.h index 425be06..677c7c0 100644 --- a/chrome/browser/tab_contents/tab_contents_ssl_helper.h +++ b/chrome/browser/tab_contents/tab_contents_ssl_helper.h @@ -13,7 +13,8 @@ #include "base/memory/ref_counted.h" class SSLAddCertHandler; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace net { class HttpNetworkSession; diff --git a/chrome/browser/tab_contents/web_drag_bookmark_handler_aura.h b/chrome/browser/tab_contents/web_drag_bookmark_handler_aura.h index 60ba07f..c830fe3 100644 --- a/chrome/browser/tab_contents/web_drag_bookmark_handler_aura.h +++ b/chrome/browser/tab_contents/web_drag_bookmark_handler_aura.h @@ -10,7 +10,8 @@ #include "content/public/browser/web_drag_dest_delegate.h" #include "chrome/browser/bookmarks/bookmark_node_data.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Chrome needs to intercept content drag events so it can dispatch them to the // bookmarks and extensions system. diff --git a/chrome/browser/tab_contents/web_drag_bookmark_handler_gtk.h b/chrome/browser/tab_contents/web_drag_bookmark_handler_gtk.h index 33c85e1..db23ba6 100644 --- a/chrome/browser/tab_contents/web_drag_bookmark_handler_gtk.h +++ b/chrome/browser/tab_contents/web_drag_bookmark_handler_gtk.h @@ -10,7 +10,8 @@ #include "chrome/browser/bookmarks/bookmark_node_data.h" #include "content/public/browser/web_drag_dest_delegate.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Chrome needs to intercept content drag events so it can dispatch them to the // bookmarks and extensions system. diff --git a/chrome/browser/tab_contents/web_drag_bookmark_handler_mac.h b/chrome/browser/tab_contents/web_drag_bookmark_handler_mac.h index 361b5fe..f991384 100644 --- a/chrome/browser/tab_contents/web_drag_bookmark_handler_mac.h +++ b/chrome/browser/tab_contents/web_drag_bookmark_handler_mac.h @@ -10,7 +10,8 @@ #include "chrome/browser/bookmarks/bookmark_node_data.h" #include "content/public/browser/web_drag_dest_delegate.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Chrome needs to intercept content drag events so it can dispatch them to the // bookmarks and extensions system. diff --git a/chrome/browser/tab_contents/web_drag_bookmark_handler_win.h b/chrome/browser/tab_contents/web_drag_bookmark_handler_win.h index 89cd42c..744f9c6 100644 --- a/chrome/browser/tab_contents/web_drag_bookmark_handler_win.h +++ b/chrome/browser/tab_contents/web_drag_bookmark_handler_win.h @@ -10,7 +10,8 @@ #include "chrome/browser/bookmarks/bookmark_node_data.h" #include "content/public/browser/web_drag_dest_delegate.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Chrome needs to intercept content drag events so it can dispatch them to the // bookmarks and extensions system. diff --git a/chrome/browser/task_manager/task_manager.h b/chrome/browser/task_manager/task_manager.h index 23e582e..d118ba8 100644 --- a/chrome/browser/task_manager/task_manager.h +++ b/chrome/browser/task_manager/task_manager.h @@ -22,7 +22,8 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" class SkBitmap; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TaskManagerModel; namespace base { diff --git a/chrome/browser/task_manager/task_manager_resource_providers.h b/chrome/browser/task_manager/task_manager_resource_providers.h index 612a5ca..affe440 100644 --- a/chrome/browser/task_manager/task_manager_resource_providers.h +++ b/chrome/browser/task_manager/task_manager_resource_providers.h @@ -21,7 +21,8 @@ class BackgroundContents; class BalloonHost; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace content { class RenderViewHost; diff --git a/chrome/browser/ui/blocked_content/blocked_content_container.h b/chrome/browser/ui/blocked_content/blocked_content_container.h index c0b1d53..2945f95 100644 --- a/chrome/browser/ui/blocked_content/blocked_content_container.h +++ b/chrome/browser/ui/blocked_content/blocked_content_container.h @@ -18,7 +18,8 @@ #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.h" #include "content/public/browser/web_contents_delegate.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Takes ownership of TabContentsWrappers that are unrequested popup windows. class BlockedContentContainer : public BlockedContentTabHelperDelegate, diff --git a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.h b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.h index 21afc11..347d0de 100644 --- a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.h +++ b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.h @@ -14,7 +14,8 @@ class BlockedContentContainer; class BlockedContentTabHelperDelegate; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Per-tab class to manage blocked popups. class BlockedContentTabHelper : public content::WebContentsObserver { diff --git a/chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.h b/chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.h index 9029226..6e58177 100644 --- a/chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.h +++ b/chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.h @@ -6,7 +6,8 @@ #define CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_CONTENT_TAB_HELPER_DELEGATE_H_ #pragma once -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Objects implement this interface to get notified about changes in the // BlockedContentTabHelper and to provide necessary functionality. diff --git a/chrome/browser/ui/bookmarks/bookmark_tab_helper.h b/chrome/browser/ui/bookmarks/bookmark_tab_helper.h index c165cc7..a3ec6a2 100644 --- a/chrome/browser/ui/bookmarks/bookmark_tab_helper.h +++ b/chrome/browser/ui/bookmarks/bookmark_tab_helper.h @@ -11,7 +11,8 @@ #include "content/public/browser/web_contents_observer.h" class BookmarkTabHelperDelegate; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; struct BookmarkNodeData; // Per-tab class to manage bookmarks. diff --git a/chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h b/chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h index 4f1942c..42f5f77 100644 --- a/chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h +++ b/chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h @@ -8,7 +8,8 @@ #include "base/basictypes.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Objects implement this interface to get notified about changes in the // BookmarkTabHelper and to provide necessary functionality. diff --git a/chrome/browser/ui/browser_dialogs.h b/chrome/browser/ui/browser_dialogs.h index dab83af..9d5094c 100644 --- a/chrome/browser/ui/browser_dialogs.h +++ b/chrome/browser/ui/browser_dialogs.h @@ -12,7 +12,8 @@ class Browser; class Profile; class SkBitmap; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TabModalConfirmDialogDelegate; class TemplateURL; diff --git a/chrome/browser/ui/browser_navigator.h b/chrome/browser/ui/browser_navigator.h index a6c377e..305aa73 100644 --- a/chrome/browser/ui/browser_navigator.h +++ b/chrome/browser/ui/browser_navigator.h @@ -17,7 +17,8 @@ class Browser; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace browser { diff --git a/chrome/browser/ui/browser_navigator_browsertest.h b/chrome/browser/ui/browser_navigator_browsertest.h index 2d056dd..cbce35e 100644 --- a/chrome/browser/ui/browser_navigator_browsertest.h +++ b/chrome/browser/ui/browser_navigator_browsertest.h @@ -10,7 +10,8 @@ #include "content/public/browser/notification_types.h" class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace browser { struct NavigateParams; diff --git a/chrome/browser/ui/browser_window.h b/chrome/browser/ui/browser_window.h index 4186e9c..ecd20d2 100644 --- a/chrome/browser/ui/browser_window.h +++ b/chrome/browser/ui/browser_window.h @@ -25,7 +25,8 @@ class GURL; class LocationBar; class Profile; class StatusBubble; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TemplateURL; #if !defined(OS_MACOSX) class ToolbarView; diff --git a/chrome/browser/ui/cocoa/applescript/tab_applescript.h b/chrome/browser/ui/cocoa/applescript/tab_applescript.h index b21d8fa..dd31941 100644 --- a/chrome/browser/ui/cocoa/applescript/tab_applescript.h +++ b/chrome/browser/ui/cocoa/applescript/tab_applescript.h @@ -9,7 +9,8 @@ #import "chrome/browser/ui/cocoa/applescript/element_applescript.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Represents a tab scriptable item in applescript. @interface TabAppleScript : ElementAppleScript { diff --git a/chrome/browser/ui/cocoa/constrained_window_mac.h b/chrome/browser/ui/cocoa/constrained_window_mac.h index 9e062d3..93b0b5d 100644 --- a/chrome/browser/ui/cocoa/constrained_window_mac.h +++ b/chrome/browser/ui/cocoa/constrained_window_mac.h @@ -17,7 +17,8 @@ @class GTMWindowSheetController; @class NSView; @class NSWindow; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Base class for constrained dialog delegates. Never inherit from this // directly. diff --git a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h index 57eb565..ea71fe0 100644 --- a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h +++ b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h @@ -16,7 +16,8 @@ @class CollectedCookiesWindowController; @class CookieDetailsViewController; @class VerticalGradientView; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // The constrained window delegate reponsible for managing the collected // cookies dialog. diff --git a/chrome/browser/ui/cocoa/infobars/infobar_container_controller.h b/chrome/browser/ui/cocoa/infobars/infobar_container_controller.h index e928cec..c881dab 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_container_controller.h +++ b/chrome/browser/ui/cocoa/infobars/infobar_container_controller.h @@ -18,7 +18,8 @@ class InfoBar; class InfoBarDelegate; class InfoBarNotificationObserver; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TabStripModel; // Protocol for basic container methods, as needed by an InfoBarController. diff --git a/chrome/browser/ui/cocoa/tab_contents/favicon_util.h b/chrome/browser/ui/cocoa/tab_contents/favicon_util.h index 2996745..63b910a 100644 --- a/chrome/browser/ui/cocoa/tab_contents/favicon_util.h +++ b/chrome/browser/ui/cocoa/tab_contents/favicon_util.h @@ -6,7 +6,8 @@ #define CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_FAVICON_UTIL_H_ @class NSImage; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace mac { diff --git a/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h b/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h index 5961d654..3f35544 100644 --- a/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h +++ b/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h @@ -11,7 +11,8 @@ #include "base/memory/scoped_ptr.h" #include "chrome/browser/ui/cocoa/constrained_window_mac.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TabModalConfirmDialogDelegate; // Displays a tab-modal dialog, i.e. a dialog that will block the current page diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h b/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h index 6b060d9..e840021 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h @@ -11,7 +11,8 @@ #include "base/compiler_specific.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TabStripModel; // A C++ bridge class to handle receiving notifications from the C++ tab strip diff --git a/chrome/browser/ui/cocoa/web_dialog_window_controller.h b/chrome/browser/ui/cocoa/web_dialog_window_controller.h index 8a33f8e..9b7c8ca 100644 --- a/chrome/browser/ui/cocoa/web_dialog_window_controller.h +++ b/chrome/browser/ui/cocoa/web_dialog_window_controller.h @@ -16,7 +16,8 @@ class Browser; class WebDialogWindowDelegateBridge; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // This controller manages a dialog box with properties and HTML content taken // from a WebDialogDelegate object. diff --git a/chrome/browser/ui/cocoa/web_intent_picker_cocoa.h b/chrome/browser/ui/cocoa/web_intent_picker_cocoa.h index 3363296..1242a18 100644 --- a/chrome/browser/ui/cocoa/web_intent_picker_cocoa.h +++ b/chrome/browser/ui/cocoa/web_intent_picker_cocoa.h @@ -16,7 +16,8 @@ #include "chrome/browser/ui/intents/web_intent_picker_model_observer.h" class ConstrainedWindow; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; @class WebIntentPickerSheetController; class WebIntentInlineDispositionDelegate; diff --git a/chrome/browser/ui/constrained_window_tab_helper.h b/chrome/browser/ui/constrained_window_tab_helper.h index d2622de..bbc2a30 100644 --- a/chrome/browser/ui/constrained_window_tab_helper.h +++ b/chrome/browser/ui/constrained_window_tab_helper.h @@ -12,7 +12,8 @@ class ConstrainedWindow; class ConstrainedWindowTabHelperDelegate; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Per-tab class to manage constrained windows. class ConstrainedWindowTabHelper : public content::WebContentsObserver { diff --git a/chrome/browser/ui/constrained_window_tab_helper_delegate.h b/chrome/browser/ui/constrained_window_tab_helper_delegate.h index 09eca90..dde376d 100644 --- a/chrome/browser/ui/constrained_window_tab_helper_delegate.h +++ b/chrome/browser/ui/constrained_window_tab_helper_delegate.h @@ -6,7 +6,8 @@ #define CHROME_BROWSER_UI_CONSTRAINED_WINDOW_TAB_HELPER_DELEGATE_H_ #pragma once -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class ConstrainedWindowTabHelperDelegate { public: diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.h b/chrome/browser/ui/content_settings/content_setting_bubble_model.h index 271efa4..c44be1b 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.h +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.h @@ -19,7 +19,8 @@ class ContentSettingBubbleModelDelegate; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // This model provides data for ContentSettingBubble, and also controls // the action triggered when the allow / block radio buttons are triggered. diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model_delegate.h b/chrome/browser/ui/content_settings/content_setting_bubble_model_delegate.h index b1bb956..7237431 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model_delegate.h +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model_delegate.h @@ -8,7 +8,8 @@ #include "chrome/common/content_settings_types.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Delegate which is used by ContentSettingBubbleModel class. class ContentSettingBubbleModelDelegate { diff --git a/chrome/browser/ui/extensions/shell_window.h b/chrome/browser/ui/extensions/shell_window.h index 669dc7d..edb7109 100644 --- a/chrome/browser/ui/extensions/shell_window.h +++ b/chrome/browser/ui/extensions/shell_window.h @@ -19,7 +19,8 @@ class ExtensionWindowController; class GURL; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace content { class WebContents; diff --git a/chrome/browser/ui/find_bar/find_bar_controller.h b/chrome/browser/ui/find_bar/find_bar_controller.h index 566618b..c635112 100644 --- a/chrome/browser/ui/find_bar/find_bar_controller.h +++ b/chrome/browser/ui/find_bar/find_bar_controller.h @@ -16,7 +16,8 @@ class Rect; } class FindBar; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class FindBarController : public content::NotificationObserver { public: diff --git a/chrome/browser/ui/fullscreen_controller.h b/chrome/browser/ui/fullscreen_controller.h index 8e8b468..f5304a32 100644 --- a/chrome/browser/ui/fullscreen_controller.h +++ b/chrome/browser/ui/fullscreen_controller.h @@ -15,7 +15,8 @@ class Browser; class BrowserWindow; class GURL; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace content { class WebContents; diff --git a/chrome/browser/ui/gtk/collected_cookies_gtk.h b/chrome/browser/ui/gtk/collected_cookies_gtk.h index 74df8a1..5b0ef49 100644 --- a/chrome/browser/ui/gtk/collected_cookies_gtk.h +++ b/chrome/browser/ui/gtk/collected_cookies_gtk.h @@ -20,7 +20,8 @@ #include "ui/base/gtk/gtk_signal.h" class CookiesTreeModel; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // CollectedCookiesGtk is a dialog that displays the allowed and blocked // cookies of the current tab contents. To display the dialog, invoke diff --git a/chrome/browser/ui/gtk/constrained_window_gtk.h b/chrome/browser/ui/gtk/constrained_window_gtk.h index 3a4962e..410dba3 100644 --- a/chrome/browser/ui/gtk/constrained_window_gtk.h +++ b/chrome/browser/ui/gtk/constrained_window_gtk.h @@ -15,7 +15,8 @@ #include "ui/base/gtk/gtk_signal.h" #include "ui/base/gtk/owned_widget_gtk.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; typedef struct _GdkColor GdkColor; class ChromeWebContentsViewDelegateGtk; diff --git a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h index 6253f8b..3cc23ff 100644 --- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h +++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h @@ -23,7 +23,8 @@ typedef struct _GtkWidget GtkWidget; typedef struct _GtkWindow GtkWindow; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace extensions{ class Extension; diff --git a/chrome/browser/ui/gtk/tab_contents_container_gtk.h b/chrome/browser/ui/gtk/tab_contents_container_gtk.h index f13f551..b3e4642 100644 --- a/chrome/browser/ui/gtk/tab_contents_container_gtk.h +++ b/chrome/browser/ui/gtk/tab_contents_container_gtk.h @@ -17,7 +17,8 @@ #include "ui/base/gtk/owned_widget_gtk.h" class StatusBubbleGtk; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace content { class WebContents; diff --git a/chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h b/chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h index f8c4ed5..ec9120b 100644 --- a/chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h +++ b/chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h @@ -13,7 +13,8 @@ #include "chrome/browser/ui/gtk/constrained_window_gtk.h" #include "ui/base/gtk/gtk_signal.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TabModalConfirmDialogDelegate; // Displays a tab-modal dialog, i.e. a dialog that will block the current page diff --git a/chrome/browser/ui/gtk/tabs/drag_data.h b/chrome/browser/ui/gtk/tabs/drag_data.h index 6557c23..faf7b42 100644 --- a/chrome/browser/ui/gtk/tabs/drag_data.h +++ b/chrome/browser/ui/gtk/tabs/drag_data.h @@ -10,7 +10,8 @@ #include "base/basictypes.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TabGtk; namespace content { diff --git a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h index b6bd6d97..4e77942 100644 --- a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h +++ b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h @@ -26,7 +26,8 @@ class DraggedViewGtk; class TabGtk; class TabStripGtk; class TabStripModel; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class DraggedTabControllerGtk : public content::NotificationObserver, public content::WebContentsDelegate { diff --git a/chrome/browser/ui/gtk/web_dialog_gtk.h b/chrome/browser/ui/gtk/web_dialog_gtk.h index 3546a16..c8b8505 100644 --- a/chrome/browser/ui/gtk/web_dialog_gtk.h +++ b/chrome/browser/ui/gtk/web_dialog_gtk.h @@ -22,7 +22,8 @@ typedef struct _GtkWidget GtkWidget; class Browser; class Profile; class TabContentsContainerGtk; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class WebDialogController; class WebDialogGtk : public WebDialogWebContentsDelegate, diff --git a/chrome/browser/ui/gtk/web_intent_picker_gtk.h b/chrome/browser/ui/gtk/web_intent_picker_gtk.h index bf90790..77bbe5b 100644 --- a/chrome/browser/ui/gtk/web_intent_picker_gtk.h +++ b/chrome/browser/ui/gtk/web_intent_picker_gtk.h @@ -25,7 +25,8 @@ class CustomDrawButton; class GURL; class TabContentsContainerGtk; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class ThrobberGtk; class WebIntentPickerDelegate; diff --git a/chrome/browser/ui/gtk/website_settings_popup_gtk.h b/chrome/browser/ui/gtk/website_settings_popup_gtk.h index 7b55843..1a19770 100644 --- a/chrome/browser/ui/gtk/website_settings_popup_gtk.h +++ b/chrome/browser/ui/gtk/website_settings_popup_gtk.h @@ -18,7 +18,8 @@ class Browser; class GtkThemeService; class GURL; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class WebsiteSettings; namespace content { diff --git a/chrome/browser/ui/intents/web_intent_picker.h b/chrome/browser/ui/intents/web_intent_picker.h index b69fa79..dd398e5 100644 --- a/chrome/browser/ui/intents/web_intent_picker.h +++ b/chrome/browser/ui/intents/web_intent_picker.h @@ -13,7 +13,8 @@ #include "base/string16.h" #include "ui/gfx/size.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class WebIntentPickerDelegate; class WebIntentPickerModel; diff --git a/chrome/browser/ui/intents/web_intent_picker_controller.h b/chrome/browser/ui/intents/web_intent_picker_controller.h index bf02dec..e7ac6b69 100644 --- a/chrome/browser/ui/intents/web_intent_picker_controller.h +++ b/chrome/browser/ui/intents/web_intent_picker_controller.h @@ -26,7 +26,8 @@ class Browser; struct DefaultWebIntentService; class GURL; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class WebIntentPicker; class WebIntentPickerModel; diff --git a/chrome/browser/ui/media_stream_infobar_delegate.h b/chrome/browser/ui/media_stream_infobar_delegate.h index 39ebc8c..586120c 100644 --- a/chrome/browser/ui/media_stream_infobar_delegate.h +++ b/chrome/browser/ui/media_stream_infobar_delegate.h @@ -14,7 +14,8 @@ #include "content/public/common/media_stream_request.h" class MessageLoop; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // This class configures an infobar shown when a page requests access to a // user's microphone and/or video camera. The user is shown a message asking diff --git a/chrome/browser/ui/pdf/pdf_tab_observer.h b/chrome/browser/ui/pdf/pdf_tab_observer.h index bde820c..df5eae4 100644 --- a/chrome/browser/ui/pdf/pdf_tab_observer.h +++ b/chrome/browser/ui/pdf/pdf_tab_observer.h @@ -8,7 +8,8 @@ #include "content/public/browser/web_contents_observer.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Per-tab class to handle PDF messages. class PDFTabObserver : public content::WebContentsObserver { diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.h b/chrome/browser/ui/pdf/pdf_unsupported_feature.h index c42380d..7c0c7df 100644 --- a/chrome/browser/ui/pdf/pdf_unsupported_feature.h +++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.h @@ -8,7 +8,8 @@ #include "base/basictypes.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Call this when a tab encounters a PDF that has features which our internal // viewer doesn't support. Will take care of puting up an infobar to inform the diff --git a/chrome/browser/ui/snapshot_tab_helper.h b/chrome/browser/ui/snapshot_tab_helper.h index 3870ffd..2771621 100644 --- a/chrome/browser/ui/snapshot_tab_helper.h +++ b/chrome/browser/ui/snapshot_tab_helper.h @@ -9,7 +9,8 @@ #include "content/public/browser/web_contents_observer.h" class SkBitmap; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Per-tab class to handle snapshot functionality. class SnapshotTabHelper : public content::WebContentsObserver { diff --git a/chrome/browser/ui/startup/startup_browser_creator.h b/chrome/browser/ui/startup/startup_browser_creator.h index f4c3260..78dc4ff 100644 --- a/chrome/browser/ui/startup/startup_browser_creator.h +++ b/chrome/browser/ui/startup/startup_browser_creator.h @@ -22,7 +22,8 @@ class Browser; class CommandLine; class GURL; class PrefService; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // class containing helpers for BrowserMain to spin up a new instance and // initialize the profile. diff --git a/chrome/browser/ui/sync/tab_contents_wrapper_synced_tab_delegate.h b/chrome/browser/ui/sync/tab_contents_wrapper_synced_tab_delegate.h index d0dd25d..b58328b 100644 --- a/chrome/browser/ui/sync/tab_contents_wrapper_synced_tab_delegate.h +++ b/chrome/browser/ui/sync/tab_contents_wrapper_synced_tab_delegate.h @@ -10,7 +10,8 @@ #include "chrome/browser/sessions/session_id.h" #include "chrome/browser/sync/glue/synced_tab_delegate.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TabContentsWrapperSyncedTabDelegate : public browser_sync::SyncedTabDelegate { diff --git a/chrome/browser/ui/tab_contents/core_tab_helper_delegate.h b/chrome/browser/ui/tab_contents/core_tab_helper_delegate.h index 1ff76df..36614fd 100644 --- a/chrome/browser/ui/tab_contents/core_tab_helper_delegate.h +++ b/chrome/browser/ui/tab_contents/core_tab_helper_delegate.h @@ -8,7 +8,8 @@ #include "base/basictypes.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Objects implement this interface to get notified about changes in the // TabContentsWrapper and to provide necessary functionality. diff --git a/chrome/browser/ui/tab_contents/tab_contents.cc b/chrome/browser/ui/tab_contents/tab_contents.cc new file mode 100644 index 0000000..305df3d --- /dev/null +++ b/chrome/browser/ui/tab_contents/tab_contents.cc @@ -0,0 +1,242 @@ +// Copyright (c) 2012 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 "chrome/browser/ui/tab_contents/tab_contents.h" + +#include "base/command_line.h" +#include "base/lazy_instance.h" +#include "chrome/browser/autocomplete_history_manager.h" +#include "chrome/browser/autofill/autofill_external_delegate.h" +#include "chrome/browser/autofill/autofill_manager.h" +#include "chrome/browser/automation/automation_tab_helper.h" +#include "chrome/browser/content_settings/tab_specific_content_settings.h" +#include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" +#include "chrome/browser/extensions/extension_tab_helper.h" +#include "chrome/browser/external_protocol/external_protocol_observer.h" +#include "chrome/browser/favicon/favicon_tab_helper.h" +#include "chrome/browser/history/history_tab_helper.h" +#include "chrome/browser/infobars/infobar_tab_helper.h" +#include "chrome/browser/omnibox_search_hint.h" +#include "chrome/browser/password_manager/password_manager.h" +#include "chrome/browser/password_manager/password_manager_delegate_impl.h" +#include "chrome/browser/plugin_observer.h" +#include "chrome/browser/prerender/prerender_tab_helper.h" +#include "chrome/browser/printing/print_preview_message_handler.h" +#include "chrome/browser/printing/print_view_manager.h" +#include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" +#include "chrome/browser/sessions/restore_tab_helper.h" +#include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" +#include "chrome/browser/tab_contents/thumbnail_generator.h" +#include "chrome/browser/translate/translate_tab_helper.h" +#include "chrome/browser/ui/alternate_error_tab_observer.h" +#include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" +#include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" +#include "chrome/browser/ui/constrained_window_tab_helper.h" +#include "chrome/browser/ui/find_bar/find_tab_helper.h" +#include "chrome/browser/ui/hung_plugin_tab_helper.h" +#include "chrome/browser/ui/intents/web_intent_picker_controller.h" +#include "chrome/browser/ui/pdf/pdf_tab_observer.h" +#include "chrome/browser/ui/prefs/prefs_tab_helper.h" +#include "chrome/browser/ui/sad_tab_helper.h" +#include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" +#include "chrome/browser/ui/snapshot_tab_helper.h" +#include "chrome/browser/ui/sync/one_click_signin_helper.h" +#include "chrome/browser/ui/sync/tab_contents_wrapper_synced_tab_delegate.h" +#include "chrome/browser/ui/tab_contents/core_tab_helper.h" +#include "chrome/browser/ui/zoom/zoom_controller.h" +#include "chrome/browser/view_type_utils.h" +#include "chrome/common/chrome_notification_types.h" +#include "chrome/common/chrome_switches.h" +#include "chrome/common/thumbnail_support.h" +#include "content/public/browser/notification_service.h" +#include "content/public/browser/web_contents.h" + +#if defined(OS_WIN) +#include "base/win/metro.h" +#endif + +using content::WebContents; + +namespace { + +static base::LazyInstance > + g_tab_contents_wrapper_property_accessor = LAZY_INSTANCE_INITIALIZER; + +} // namespace + +//////////////////////////////////////////////////////////////////////////////// +// TabContents, public: + +TabContents::TabContents(WebContents* contents) + : content::WebContentsObserver(contents), + in_destructor_(false), + web_contents_(contents) { + DCHECK(contents); + DCHECK(!GetCurrentWrapperForContents(contents)); + + chrome::SetViewType(contents, chrome::VIEW_TYPE_TAB_CONTENTS); + + // Stash this in the property bag so it can be retrieved without having to + // go to a Browser. + property_accessor()->SetProperty(contents->GetPropertyBag(), this); + + // Create the tab helpers. + autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); + autofill_manager_ = new AutofillManager(this); + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kExternalAutofillPopup)) { + autofill_external_delegate_.reset( + AutofillExternalDelegate::Create(this, autofill_manager_.get())); + autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); + autocomplete_history_manager_->SetExternalDelegate( + autofill_external_delegate_.get()); + } +#if defined(ENABLE_AUTOMATION) + automation_tab_helper_.reset(new AutomationTabHelper(contents)); +#endif + blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); + bookmark_tab_helper_.reset(new BookmarkTabHelper(this)); + constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); + core_tab_helper_.reset(new CoreTabHelper(contents)); + extension_tab_helper_.reset(new ExtensionTabHelper(this)); + favicon_tab_helper_.reset(new FaviconTabHelper(contents)); + find_tab_helper_.reset(new FindTabHelper(contents)); + history_tab_helper_.reset(new HistoryTabHelper(contents)); + hung_plugin_tab_helper_.reset(new HungPluginTabHelper(contents)); + infobar_tab_helper_.reset(new InfoBarTabHelper(contents)); + password_manager_delegate_.reset(new PasswordManagerDelegateImpl(this)); + password_manager_.reset( + new PasswordManager(contents, password_manager_delegate_.get())); + prefs_tab_helper_.reset(new PrefsTabHelper(contents)); + prerender_tab_helper_.reset(new prerender::PrerenderTabHelper(this)); + restore_tab_helper_.reset(new RestoreTabHelper(contents)); + search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); + snapshot_tab_helper_.reset(new SnapshotTabHelper(contents)); + ssl_helper_.reset(new TabContentsSSLHelper(this)); + synced_tab_delegate_.reset(new TabContentsWrapperSyncedTabDelegate(this)); + content_settings_.reset(new TabSpecificContentSettings(contents)); + translate_tab_helper_.reset(new TranslateTabHelper(contents)); + web_intent_picker_controller_.reset(new WebIntentPickerController(this)); + zoom_controller_.reset(new ZoomController(this)); + +#if !defined(OS_ANDROID) + print_view_manager_.reset(new printing::PrintViewManager(this)); + sad_tab_helper_.reset(new SadTabHelper(contents)); +#endif + + // Create the per-tab observers. + alternate_error_page_tab_observer_.reset( + new AlternateErrorPageTabObserver(contents, profile())); + webnavigation_observer_.reset( + new extensions::WebNavigationTabObserver(contents)); + external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); + pdf_tab_observer_.reset(new PDFTabObserver(this)); + safe_browsing_tab_observer_.reset( + new safe_browsing::SafeBrowsingTabObserver(this)); + +#if defined(OS_WIN) + // Metro mode Chrome on Windows does not support plugins. Avoid registering + // the PluginObserver so we don't popup plugin-related infobars. + if (!base::win::GetMetroModule()) + plugin_observer_.reset(new PluginObserver(this)); +#else + plugin_observer_.reset(new PluginObserver(this)); +#endif + +#if !defined(OS_ANDROID) + if (OmniboxSearchHint::IsEnabled(profile())) + omnibox_search_hint_.reset(new OmniboxSearchHint(this)); + print_preview_.reset(new printing::PrintPreviewMessageHandler(contents)); +#endif + + // Start the in-browser thumbnailing if the feature is enabled. + if (ShouldEnableInBrowserThumbnailing()) { + thumbnail_generator_.reset(new ThumbnailGenerator); + thumbnail_generator_->StartThumbnailing(web_contents_.get()); + } + + // If this is not an incognito window, setup to handle one-click login. + // We don't want to check that the profile is already connected at this time + // because the connected state may change while this tab is open. Having a + // one-click signin helper attached does not cause problems if the profile + // happens to be already connected. +#if defined(ENABLE_ONE_CLICK_SIGNIN) + if (OneClickSigninHelper::CanOffer(contents, false)) + one_click_signin_helper_.reset(new OneClickSigninHelper(contents)); +#endif +} + +TabContents::~TabContents() { + in_destructor_ = true; + + // Need to reset |thumbnail_generator_| here before |web_contents_| is + // deleted because destructing |web_contents_| can end up causing the + // thumbnailer to generate a thumbnail. Since TabContents can be + // destructed during shutdown, trying to generate a thumbnail by sending an + // IPC message to the GPU process is not safe. Sending + // chrome::NOTIFICATION_TAB_CONTENTS_DESTROYED can also cause the thumbnailer + // to generate a thumbnail, so this must be placed before sending the + // notification. + thumbnail_generator_.reset(); + + content::NotificationService::current()->Notify( + chrome::NOTIFICATION_TAB_CONTENTS_DESTROYED, + content::Source(this), + content::NotificationService::NoDetails()); + + // Need to tear down infobars before the WebContents goes away. + // TODO(avi): Can we get this handled by the tab helper itself? + infobar_tab_helper_.reset(); +} + +base::PropertyAccessor* TabContents::property_accessor() { + return g_tab_contents_wrapper_property_accessor.Pointer(); +} + +TabContents* TabContents::Clone() { + WebContents* new_contents = web_contents()->Clone(); + TabContents* new_wrapper = new TabContents(new_contents); + + // TODO(avi): Can we generalize this so that knowledge of the functionings of + // the tab helpers isn't required here? + new_wrapper->extension_tab_helper()->CopyStateFrom( + *extension_tab_helper_.get()); + return new_wrapper; +} + +// static +TabContents* TabContents::GetCurrentWrapperForContents( + WebContents* contents) { + TabContents** wrapper = + property_accessor()->GetProperty(contents->GetPropertyBag()); + + return wrapper ? *wrapper : NULL; +} + +// static +const TabContents* TabContents::GetCurrentWrapperForContents( + const WebContents* contents) { + TabContents* const* wrapper = + property_accessor()->GetProperty(contents->GetPropertyBag()); + + return wrapper ? *wrapper : NULL; +} + +WebContents* TabContents::web_contents() const { + return web_contents_.get(); +} + +Profile* TabContents::profile() const { + return Profile::FromBrowserContext(web_contents()->GetBrowserContext()); +} + +//////////////////////////////////////////////////////////////////////////////// +// WebContentsObserver overrides + +void TabContents::WebContentsDestroyed(WebContents* tab) { + // Destruction of the WebContents should only be done by us from our + // destructor. Otherwise it's very likely we (or one of the helpers we own) + // will attempt to access the WebContents and we'll crash. + DCHECK(in_destructor_); +} diff --git a/chrome/browser/ui/tab_contents/tab_contents.h b/chrome/browser/ui/tab_contents/tab_contents.h new file mode 100644 index 0000000..06abb37 --- /dev/null +++ b/chrome/browser/ui/tab_contents/tab_contents.h @@ -0,0 +1,318 @@ +// Copyright (c) 2012 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_UI_TAB_CONTENTS_TAB_CONTENTS_H_ +#define CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_H_ +#pragma once + +#include "base/basictypes.h" +#include "base/compiler_specific.h" +#include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" +#include "base/property_bag.h" +#include "content/public/browser/web_contents_observer.h" + +class AlternateErrorPageTabObserver; +class AutocompleteHistoryManager; +class AutofillManager; +class AutofillExternalDelegate; +class AutomationTabHelper; +class BlockedContentTabHelper; +class BookmarkTabHelper; +class ConstrainedWindowTabHelper; +class CoreTabHelper; +class ExtensionTabHelper; +class ExternalProtocolObserver; +class FaviconTabHelper; +class FindTabHelper; +class HistoryTabHelper; +class HungPluginTabHelper; +class InfoBarTabHelper; +class OmniboxSearchHint; +class PasswordManager; +class PasswordManagerDelegate; +class PDFTabObserver; +class PluginObserver; +class PrefsTabHelper; +class Profile; +class RestoreTabHelper; +class SadTabHelper; +class SearchEngineTabHelper; +class SnapshotTabHelper; +class TabContentsSSLHelper; +class TabSpecificContentSettings; +class ThumbnailGenerator; +class TranslateTabHelper; +class WebIntentPickerController; +class ZoomController; + +#if defined(ENABLE_ONE_CLICK_SIGNIN) +class OneClickSigninHelper; +#endif + +namespace browser_sync { +class SyncedTabDelegate; +} + +namespace extensions { +class WebNavigationTabObserver; +} + +namespace prerender { +class PrerenderTabHelper; +} + +namespace printing { +class PrintViewManager; +class PrintPreviewMessageHandler; +} + +namespace safe_browsing { +class SafeBrowsingTabObserver; +} + +// Wraps WebContents and all of its supporting objects in order to control +// their ownership and lifetime. +// +// WARNING: Not every place where HTML can run has a TabContents. This class is +// *only* used in a visible, actual, tab inside a browser. Examples of things +// that do not have a TabContents include: +// - Extension background pages and popup bubbles +// - HTML notification bubbles +// - Screensavers on Chrome OS +// - Other random places we decide to display HTML over time +// +// Consider carefully whether your feature is something that makes sense only +// when a tab is displayed, or could make sense in other cases we use HTML. It +// may makes sense to push down into WebContents and make configurable, or at +// least to make easy for other WebContents hosts to include and support. +// +// TODO(avi): Eventually, this class will become TabContents as far as +// the browser front-end is concerned. +class TabContents : public content::WebContentsObserver { + public: + // Takes ownership of |contents|, which must be heap-allocated (as it lives + // in a scoped_ptr) and can not be NULL. + explicit TabContents(content::WebContents* contents); + virtual ~TabContents(); + + // Create a TabContents with the same state as this one. The returned + // heap-allocated pointer is owned by the caller. + TabContents* Clone(); + + // Helper to retrieve the existing instance that owns a given WebContents. + // Returns NULL if there is no such existing instance. + // NOTE: This is not intended for general use. It is intended for situations + // like callbacks from content/ where only a WebContents is available. In the + // general case, please do NOT use this; plumb TabContents through the chrome/ + // code instead of WebContents. + static TabContents* GetCurrentWrapperForContents( + content::WebContents* contents); + static const TabContents* GetCurrentWrapperForContents( + const content::WebContents* contents); + + // Returns the WebContents that this owns. + content::WebContents* web_contents() const; + + // Returns the Profile that is associated with this TabContents. + Profile* profile() const; + + // True if this TabContents is being torn down. + bool in_destructor() const { return in_destructor_; } + + // Tab Helpers --------------------------------------------------------------- + + AutocompleteHistoryManager* autocomplete_history_manager() { + return autocomplete_history_manager_.get(); + } + + AutofillManager* autofill_manager() { return autofill_manager_.get(); } + + // Used only for testing/automation. + AutomationTabHelper* automation_tab_helper() { + return automation_tab_helper_.get(); + } + + BlockedContentTabHelper* blocked_content_tab_helper() { + return blocked_content_tab_helper_.get(); + } + + BookmarkTabHelper* bookmark_tab_helper() { + return bookmark_tab_helper_.get(); + } + + ConstrainedWindowTabHelper* constrained_window_tab_helper() { + return constrained_window_tab_helper_.get(); + } + + CoreTabHelper* core_tab_helper() { return core_tab_helper_.get(); } + + ExtensionTabHelper* extension_tab_helper() { + return extension_tab_helper_.get(); + } + + const ExtensionTabHelper* extension_tab_helper() const { + return extension_tab_helper_.get(); + } + + FaviconTabHelper* favicon_tab_helper() { return favicon_tab_helper_.get(); } + FindTabHelper* find_tab_helper() { return find_tab_helper_.get(); } + HistoryTabHelper* history_tab_helper() { return history_tab_helper_.get(); } + HungPluginTabHelper* hung_plugin_tab_helper() { + return hung_plugin_tab_helper_.get(); + } + InfoBarTabHelper* infobar_tab_helper() { return infobar_tab_helper_.get(); } + +#if defined(ENABLE_ONE_CLICK_SIGNIN) + OneClickSigninHelper* one_click_signin_helper() { + return one_click_signin_helper_.get(); + } +#endif + + PasswordManager* password_manager() { return password_manager_.get(); } + PrefsTabHelper* prefs_tab_helper() { return prefs_tab_helper_.get(); } + + prerender::PrerenderTabHelper* prerender_tab_helper() { + return prerender_tab_helper_.get(); + } + + printing::PrintViewManager* print_view_manager() { + return print_view_manager_.get(); + } + + RestoreTabHelper* restore_tab_helper() { + return restore_tab_helper_.get(); + } + + const RestoreTabHelper* restore_tab_helper() const { + return restore_tab_helper_.get(); + } + + SadTabHelper* sad_tab_helper() { return sad_tab_helper_.get(); } + + SearchEngineTabHelper* search_engine_tab_helper() { + return search_engine_tab_helper_.get(); + } + + SnapshotTabHelper* snapshot_tab_helper() { + return snapshot_tab_helper_.get(); + } + + TabContentsSSLHelper* ssl_helper() { return ssl_helper_.get(); } + + browser_sync::SyncedTabDelegate* synced_tab_delegate() { + return synced_tab_delegate_.get(); + } + + TabSpecificContentSettings* content_settings() { + return content_settings_.get(); + } + + // NOTE: This returns NULL unless in-browser thumbnail generation is enabled. + ThumbnailGenerator* thumbnail_generator() { + return thumbnail_generator_.get(); + } + + TranslateTabHelper* translate_tab_helper() { + return translate_tab_helper_.get(); + } + + WebIntentPickerController* web_intent_picker_controller() { + return web_intent_picker_controller_.get(); + } + + ZoomController* zoom_controller() { + return zoom_controller_.get(); + } + + // Overrides ----------------------------------------------------------------- + + // content::WebContentsObserver overrides: + virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE; + + private: + // Used to retrieve this object from |web_contents_|, which is placed in + // its property bag to avoid adding additional interfaces. + static base::PropertyAccessor* property_accessor(); + + // Tab Helpers --------------------------------------------------------------- + // (These provide API for callers and have a getter function listed in the + // "Tab Helpers" section in the member functions area, above.) + + scoped_ptr autocomplete_history_manager_; + scoped_refptr autofill_manager_; + scoped_ptr autofill_external_delegate_; + scoped_ptr automation_tab_helper_; + scoped_ptr blocked_content_tab_helper_; + scoped_ptr bookmark_tab_helper_; + scoped_ptr constrained_window_tab_helper_; + scoped_ptr core_tab_helper_; + scoped_ptr extension_tab_helper_; + scoped_ptr favicon_tab_helper_; + scoped_ptr find_tab_helper_; + scoped_ptr history_tab_helper_; + scoped_ptr hung_plugin_tab_helper_; + scoped_ptr infobar_tab_helper_; + + // PasswordManager and its delegate. The delegate must outlive the manager, + // per documentation in password_manager.h. + scoped_ptr password_manager_delegate_; + scoped_ptr password_manager_; + + scoped_ptr prefs_tab_helper_; + scoped_ptr prerender_tab_helper_; + + // Handles print job for this contents. + scoped_ptr print_view_manager_; + + scoped_ptr restore_tab_helper_; + scoped_ptr sad_tab_helper_; + scoped_ptr search_engine_tab_helper_; + scoped_ptr snapshot_tab_helper_; + scoped_ptr ssl_helper_; + scoped_ptr synced_tab_delegate_; + + // The TabSpecificContentSettings object is used to query the blocked content + // state by various UI elements. + scoped_ptr content_settings_; + + scoped_ptr thumbnail_generator_; + scoped_ptr translate_tab_helper_; + + // Handles displaying a web intents picker to the user. + scoped_ptr web_intent_picker_controller_; + + scoped_ptr zoom_controller_; + + // Per-tab observers --------------------------------------------------------- + // (These provide no API for callers; objects that need to exist 1:1 with tabs + // and silently do their thing live here.) + + scoped_ptr alternate_error_page_tab_observer_; + scoped_ptr webnavigation_observer_; + scoped_ptr external_protocol_observer_; + scoped_ptr omnibox_search_hint_; +#if defined(ENABLE_ONE_CLICK_SIGNIN) + scoped_ptr one_click_signin_helper_; +#endif + scoped_ptr pdf_tab_observer_; + scoped_ptr plugin_observer_; + scoped_ptr print_preview_; + scoped_ptr + safe_browsing_tab_observer_; + + // WebContents (MUST BE LAST) ------------------------------------------------ + + // If true, we're running the destructor. + bool in_destructor_; + + // The supporting objects need to outlive the WebContents dtor (as they may + // be called upon during its execution). As a result, this must come last + // in the list. + scoped_ptr web_contents_; + + DISALLOW_COPY_AND_ASSIGN(TabContents); +}; + +#endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_H_ diff --git a/chrome/browser/ui/tab_contents/tab_contents_iterator.h b/chrome/browser/ui/tab_contents/tab_contents_iterator.h index 4531c13..25c0781 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_iterator.h +++ b/chrome/browser/ui/tab_contents/tab_contents_iterator.h @@ -11,7 +11,8 @@ #include "base/basictypes.h" #include "chrome/browser/ui/browser_list.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Iterates through all web view hosts in all browser windows. Because the // renderers act asynchronously, getting a host through this interface does diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc deleted file mode 100644 index f07d6b1..0000000 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) 2012 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 "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" - -#include "base/command_line.h" -#include "base/lazy_instance.h" -#include "chrome/browser/autocomplete_history_manager.h" -#include "chrome/browser/autofill/autofill_external_delegate.h" -#include "chrome/browser/autofill/autofill_manager.h" -#include "chrome/browser/automation/automation_tab_helper.h" -#include "chrome/browser/content_settings/tab_specific_content_settings.h" -#include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" -#include "chrome/browser/extensions/extension_tab_helper.h" -#include "chrome/browser/external_protocol/external_protocol_observer.h" -#include "chrome/browser/favicon/favicon_tab_helper.h" -#include "chrome/browser/history/history_tab_helper.h" -#include "chrome/browser/infobars/infobar_tab_helper.h" -#include "chrome/browser/omnibox_search_hint.h" -#include "chrome/browser/password_manager/password_manager.h" -#include "chrome/browser/password_manager/password_manager_delegate_impl.h" -#include "chrome/browser/plugin_observer.h" -#include "chrome/browser/prerender/prerender_tab_helper.h" -#include "chrome/browser/printing/print_preview_message_handler.h" -#include "chrome/browser/printing/print_view_manager.h" -#include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" -#include "chrome/browser/sessions/restore_tab_helper.h" -#include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" -#include "chrome/browser/tab_contents/thumbnail_generator.h" -#include "chrome/browser/translate/translate_tab_helper.h" -#include "chrome/browser/ui/alternate_error_tab_observer.h" -#include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" -#include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" -#include "chrome/browser/ui/constrained_window_tab_helper.h" -#include "chrome/browser/ui/find_bar/find_tab_helper.h" -#include "chrome/browser/ui/hung_plugin_tab_helper.h" -#include "chrome/browser/ui/intents/web_intent_picker_controller.h" -#include "chrome/browser/ui/pdf/pdf_tab_observer.h" -#include "chrome/browser/ui/prefs/prefs_tab_helper.h" -#include "chrome/browser/ui/sad_tab_helper.h" -#include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" -#include "chrome/browser/ui/snapshot_tab_helper.h" -#include "chrome/browser/ui/sync/one_click_signin_helper.h" -#include "chrome/browser/ui/sync/tab_contents_wrapper_synced_tab_delegate.h" -#include "chrome/browser/ui/tab_contents/core_tab_helper.h" -#include "chrome/browser/ui/zoom/zoom_controller.h" -#include "chrome/browser/view_type_utils.h" -#include "chrome/common/chrome_notification_types.h" -#include "chrome/common/chrome_switches.h" -#include "chrome/common/thumbnail_support.h" -#include "content/public/browser/notification_service.h" -#include "content/public/browser/web_contents.h" - -#if defined(OS_WIN) -#include "base/win/metro.h" -#endif - -using content::WebContents; - -namespace { - -static base::LazyInstance > - g_tab_contents_wrapper_property_accessor = LAZY_INSTANCE_INITIALIZER; - -} // namespace - -//////////////////////////////////////////////////////////////////////////////// -// TabContentsWrapper, public: - -TabContentsWrapper::TabContentsWrapper(WebContents* contents) - : content::WebContentsObserver(contents), - in_destructor_(false), - web_contents_(contents) { - DCHECK(contents); - DCHECK(!GetCurrentWrapperForContents(contents)); - - chrome::SetViewType(contents, chrome::VIEW_TYPE_TAB_CONTENTS); - - // Stash this in the property bag so it can be retrieved without having to - // go to a Browser. - property_accessor()->SetProperty(contents->GetPropertyBag(), this); - - // Create the tab helpers. - autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); - autofill_manager_ = new AutofillManager(this); - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kExternalAutofillPopup)) { - autofill_external_delegate_.reset( - AutofillExternalDelegate::Create(this, autofill_manager_.get())); - autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); - autocomplete_history_manager_->SetExternalDelegate( - autofill_external_delegate_.get()); - } -#if defined(ENABLE_AUTOMATION) - automation_tab_helper_.reset(new AutomationTabHelper(contents)); -#endif - blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); - bookmark_tab_helper_.reset(new BookmarkTabHelper(this)); - constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); - core_tab_helper_.reset(new CoreTabHelper(contents)); - extension_tab_helper_.reset(new ExtensionTabHelper(this)); - favicon_tab_helper_.reset(new FaviconTabHelper(contents)); - find_tab_helper_.reset(new FindTabHelper(contents)); - history_tab_helper_.reset(new HistoryTabHelper(contents)); - hung_plugin_tab_helper_.reset(new HungPluginTabHelper(contents)); - infobar_tab_helper_.reset(new InfoBarTabHelper(contents)); - password_manager_delegate_.reset(new PasswordManagerDelegateImpl(this)); - password_manager_.reset( - new PasswordManager(contents, password_manager_delegate_.get())); - prefs_tab_helper_.reset(new PrefsTabHelper(contents)); - prerender_tab_helper_.reset(new prerender::PrerenderTabHelper(this)); - restore_tab_helper_.reset(new RestoreTabHelper(contents)); - search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); - snapshot_tab_helper_.reset(new SnapshotTabHelper(contents)); - ssl_helper_.reset(new TabContentsSSLHelper(this)); - synced_tab_delegate_.reset(new TabContentsWrapperSyncedTabDelegate(this)); - content_settings_.reset(new TabSpecificContentSettings(contents)); - translate_tab_helper_.reset(new TranslateTabHelper(contents)); - web_intent_picker_controller_.reset(new WebIntentPickerController(this)); - zoom_controller_.reset(new ZoomController(this)); - -#if !defined(OS_ANDROID) - print_view_manager_.reset(new printing::PrintViewManager(this)); - sad_tab_helper_.reset(new SadTabHelper(contents)); -#endif - - // Create the per-tab observers. - alternate_error_page_tab_observer_.reset( - new AlternateErrorPageTabObserver(contents, profile())); - webnavigation_observer_.reset( - new extensions::WebNavigationTabObserver(contents)); - external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); - pdf_tab_observer_.reset(new PDFTabObserver(this)); - safe_browsing_tab_observer_.reset( - new safe_browsing::SafeBrowsingTabObserver(this)); - -#if defined(OS_WIN) - // Metro mode Chrome on Windows does not support plugins. Avoid registering - // the PluginObserver so we don't popup plugin-related infobars. - if (!base::win::GetMetroModule()) - plugin_observer_.reset(new PluginObserver(this)); -#else - plugin_observer_.reset(new PluginObserver(this)); -#endif - -#if !defined(OS_ANDROID) - if (OmniboxSearchHint::IsEnabled(profile())) - omnibox_search_hint_.reset(new OmniboxSearchHint(this)); - print_preview_.reset(new printing::PrintPreviewMessageHandler(contents)); -#endif - - // Start the in-browser thumbnailing if the feature is enabled. - if (ShouldEnableInBrowserThumbnailing()) { - thumbnail_generator_.reset(new ThumbnailGenerator); - thumbnail_generator_->StartThumbnailing(web_contents_.get()); - } - - // If this is not an incognito window, setup to handle one-click login. - // We don't want to check that the profile is already connected at this time - // because the connected state may change while this tab is open. Having a - // one-click signin helper attached does not cause problems if the profile - // happens to be already connected. -#if defined(ENABLE_ONE_CLICK_SIGNIN) - if (OneClickSigninHelper::CanOffer(contents, false)) - one_click_signin_helper_.reset(new OneClickSigninHelper(contents)); -#endif -} - -TabContentsWrapper::~TabContentsWrapper() { - in_destructor_ = true; - - // Need to reset |thumbnail_generator_| here before |web_contents_| is - // deleted because destructing |web_contents_| can end up causing the - // thumbnailer to generate a thumbnail. Since TabContentsWrapper can be - // destructed during shutdown, trying to generate a thumbnail by sending an - // IPC message to the GPU process is not safe. Sending - // chrome::NOTIFICATION_TAB_CONTENTS_DESTROYED can also cause the thumbnailer - // to generate a thumbnail, so this must be placed before sending the - // notification. - thumbnail_generator_.reset(); - - content::NotificationService::current()->Notify( - chrome::NOTIFICATION_TAB_CONTENTS_DESTROYED, - content::Source(this), - content::NotificationService::NoDetails()); - - // Need to tear down infobars before the WebContents goes away. - // TODO(avi): Can we get this handled by the tab helper itself? - infobar_tab_helper_.reset(); -} - -base::PropertyAccessor* - TabContentsWrapper::property_accessor() { - return g_tab_contents_wrapper_property_accessor.Pointer(); -} - -TabContentsWrapper* TabContentsWrapper::Clone() { - WebContents* new_contents = web_contents()->Clone(); - TabContentsWrapper* new_wrapper = new TabContentsWrapper(new_contents); - - // TODO(avi): Can we generalize this so that knowledge of the functionings of - // the tab helpers isn't required here? - new_wrapper->extension_tab_helper()->CopyStateFrom( - *extension_tab_helper_.get()); - return new_wrapper; -} - -// static -TabContentsWrapper* TabContentsWrapper::GetCurrentWrapperForContents( - WebContents* contents) { - TabContentsWrapper** wrapper = - property_accessor()->GetProperty(contents->GetPropertyBag()); - - return wrapper ? *wrapper : NULL; -} - -// static -const TabContentsWrapper* TabContentsWrapper::GetCurrentWrapperForContents( - const WebContents* contents) { - TabContentsWrapper* const* wrapper = - property_accessor()->GetProperty(contents->GetPropertyBag()); - - return wrapper ? *wrapper : NULL; -} - -WebContents* TabContentsWrapper::web_contents() const { - return web_contents_.get(); -} - -Profile* TabContentsWrapper::profile() const { - return Profile::FromBrowserContext(web_contents()->GetBrowserContext()); -} - -//////////////////////////////////////////////////////////////////////////////// -// WebContentsObserver overrides - -void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { - // Destruction of the WebContents should only be done by us from our - // destructor. Otherwise it's very likely we (or one of the helpers we own) - // will attempt to access the WebContents and we'll crash. - DCHECK(in_destructor_); -} diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h index 7a16f90..bdbc376 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h @@ -6,313 +6,8 @@ #define CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ #pragma once -#include "base/basictypes.h" -#include "base/compiler_specific.h" -#include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" -#include "base/property_bag.h" -#include "content/public/browser/web_contents_observer.h" +#include "chrome/browser/ui/tab_contents/tab_contents.h" -class AlternateErrorPageTabObserver; -class AutocompleteHistoryManager; -class AutofillManager; -class AutofillExternalDelegate; -class AutomationTabHelper; -class BlockedContentTabHelper; -class BookmarkTabHelper; -class ConstrainedWindowTabHelper; -class CoreTabHelper; -class ExtensionTabHelper; -class ExternalProtocolObserver; -class FaviconTabHelper; -class FindTabHelper; -class HistoryTabHelper; -class HungPluginTabHelper; -class InfoBarTabHelper; -class OmniboxSearchHint; -class PasswordManager; -class PasswordManagerDelegate; -class PDFTabObserver; -class PluginObserver; -class PrefsTabHelper; -class Profile; -class RestoreTabHelper; -class SadTabHelper; -class SearchEngineTabHelper; -class SnapshotTabHelper; -class TabContentsSSLHelper; -class TabSpecificContentSettings; -class ThumbnailGenerator; -class TranslateTabHelper; -class WebIntentPickerController; -class ZoomController; - -#if defined(ENABLE_ONE_CLICK_SIGNIN) -class OneClickSigninHelper; -#endif - -namespace browser_sync { -class SyncedTabDelegate; -} - -namespace extensions { -class WebNavigationTabObserver; -} - -namespace prerender { -class PrerenderTabHelper; -} - -namespace printing { -class PrintViewManager; -class PrintPreviewMessageHandler; -} - -namespace safe_browsing { -class SafeBrowsingTabObserver; -} - -// Wraps WebContents and all of its supporting objects in order to control -// their ownership and lifetime. -// -// WARNING: Not every place where HTML can run has a TabContentsWrapper. This -// class is *only* used in a visible, actual, tab inside a browser. Examples of -// things that do not have tab wrappers include: -// - Extension background pages and popup bubbles -// - HTML notification bubbles -// - Screensavers on Chrome OS -// - Other random places we decide to display HTML over time -// -// Consider carefully whether your feature is something that makes sense only -// when a tab is displayed, or could make sense in other cases we use HTML. It -// may makes sense to push down into WebContents and make configurable, or at -// least to make easy for other WebContents hosts to include and support. -// -// TODO(avi): Eventually, this class will become TabContents as far as -// the browser front-end is concerned. -class TabContentsWrapper : public content::WebContentsObserver { - public: - // Takes ownership of |contents|, which must be heap-allocated (as it lives - // in a scoped_ptr) and can not be NULL. - explicit TabContentsWrapper(content::WebContents* contents); - virtual ~TabContentsWrapper(); - - // Create a TabContentsWrapper with the same state as this one. The returned - // heap-allocated pointer is owned by the caller. - TabContentsWrapper* Clone(); - - // Helper to retrieve the existing instance that wraps a given WebContents. - // Returns NULL if there is no such existing instance. - // NOTE: This is not intended for general use. It is intended for situations - // like callbacks from content/ where only a WebContents is available. In the - // general case, please do NOT use this; plumb TabContentsWrapper through the - // chrome/ code instead of WebContents. - static TabContentsWrapper* GetCurrentWrapperForContents( - content::WebContents* contents); - static const TabContentsWrapper* GetCurrentWrapperForContents( - const content::WebContents* contents); - - // Returns the WebContents that this wraps. - content::WebContents* web_contents() const; - - // Returns the Profile that is associated with this TabContentsWrapper. - Profile* profile() const; - - // True if this TabContentsWrapper is being torn down. - bool in_destructor() const { return in_destructor_; } - - // Tab Helpers --------------------------------------------------------------- - - AutocompleteHistoryManager* autocomplete_history_manager() { - return autocomplete_history_manager_.get(); - } - - AutofillManager* autofill_manager() { return autofill_manager_.get(); } - - // Used only for testing/automation. - AutomationTabHelper* automation_tab_helper() { - return automation_tab_helper_.get(); - } - - BlockedContentTabHelper* blocked_content_tab_helper() { - return blocked_content_tab_helper_.get(); - } - - BookmarkTabHelper* bookmark_tab_helper() { - return bookmark_tab_helper_.get(); - } - - ConstrainedWindowTabHelper* constrained_window_tab_helper() { - return constrained_window_tab_helper_.get(); - } - - CoreTabHelper* core_tab_helper() { return core_tab_helper_.get(); } - - ExtensionTabHelper* extension_tab_helper() { - return extension_tab_helper_.get(); - } - - const ExtensionTabHelper* extension_tab_helper() const { - return extension_tab_helper_.get(); - } - - FaviconTabHelper* favicon_tab_helper() { return favicon_tab_helper_.get(); } - FindTabHelper* find_tab_helper() { return find_tab_helper_.get(); } - HistoryTabHelper* history_tab_helper() { return history_tab_helper_.get(); } - HungPluginTabHelper* hung_plugin_tab_helper() { - return hung_plugin_tab_helper_.get(); - } - InfoBarTabHelper* infobar_tab_helper() { return infobar_tab_helper_.get(); } - -#if defined(ENABLE_ONE_CLICK_SIGNIN) - OneClickSigninHelper* one_click_signin_helper() { - return one_click_signin_helper_.get(); - } -#endif - - PasswordManager* password_manager() { return password_manager_.get(); } - PrefsTabHelper* prefs_tab_helper() { return prefs_tab_helper_.get(); } - - prerender::PrerenderTabHelper* prerender_tab_helper() { - return prerender_tab_helper_.get(); - } - - printing::PrintViewManager* print_view_manager() { - return print_view_manager_.get(); - } - - RestoreTabHelper* restore_tab_helper() { - return restore_tab_helper_.get(); - } - - const RestoreTabHelper* restore_tab_helper() const { - return restore_tab_helper_.get(); - } - - SadTabHelper* sad_tab_helper() { return sad_tab_helper_.get(); } - - SearchEngineTabHelper* search_engine_tab_helper() { - return search_engine_tab_helper_.get(); - } - - SnapshotTabHelper* snapshot_tab_helper() { - return snapshot_tab_helper_.get(); - } - - TabContentsSSLHelper* ssl_helper() { return ssl_helper_.get(); } - - browser_sync::SyncedTabDelegate* synced_tab_delegate() { - return synced_tab_delegate_.get(); - } - - TabSpecificContentSettings* content_settings() { - return content_settings_.get(); - } - - // NOTE: This returns NULL unless in-browser thumbnail generation is enabled. - ThumbnailGenerator* thumbnail_generator() { - return thumbnail_generator_.get(); - } - - TranslateTabHelper* translate_tab_helper() { - return translate_tab_helper_.get(); - } - - WebIntentPickerController* web_intent_picker_controller() { - return web_intent_picker_controller_.get(); - } - - ZoomController* zoom_controller() { - return zoom_controller_.get(); - } - - // Overrides ----------------------------------------------------------------- - - // content::WebContentsObserver overrides: - virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE; - - private: - // Used to retrieve this object from |web_contents_|, which is placed in - // its property bag to avoid adding additional interfaces. - static base::PropertyAccessor* property_accessor(); - - // Tab Helpers --------------------------------------------------------------- - // (These provide API for callers and have a getter function listed in the - // "Tab Helpers" section in the member functions area, above.) - - scoped_ptr autocomplete_history_manager_; - scoped_refptr autofill_manager_; - scoped_ptr autofill_external_delegate_; - scoped_ptr automation_tab_helper_; - scoped_ptr blocked_content_tab_helper_; - scoped_ptr bookmark_tab_helper_; - scoped_ptr constrained_window_tab_helper_; - scoped_ptr core_tab_helper_; - scoped_ptr extension_tab_helper_; - scoped_ptr favicon_tab_helper_; - scoped_ptr find_tab_helper_; - scoped_ptr history_tab_helper_; - scoped_ptr hung_plugin_tab_helper_; - scoped_ptr infobar_tab_helper_; - - // PasswordManager and its delegate. The delegate must outlive the manager, - // per documentation in password_manager.h. - scoped_ptr password_manager_delegate_; - scoped_ptr password_manager_; - - scoped_ptr prefs_tab_helper_; - scoped_ptr prerender_tab_helper_; - - // Handles print job for this contents. - scoped_ptr print_view_manager_; - - scoped_ptr restore_tab_helper_; - scoped_ptr sad_tab_helper_; - scoped_ptr search_engine_tab_helper_; - scoped_ptr snapshot_tab_helper_; - scoped_ptr ssl_helper_; - scoped_ptr synced_tab_delegate_; - - // The TabSpecificContentSettings object is used to query the blocked content - // state by various UI elements. - scoped_ptr content_settings_; - - scoped_ptr thumbnail_generator_; - scoped_ptr translate_tab_helper_; - - // Handles displaying a web intents picker to the user. - scoped_ptr web_intent_picker_controller_; - - scoped_ptr zoom_controller_; - - // Per-tab observers --------------------------------------------------------- - // (These provide no API for callers; objects that need to exist 1:1 with tabs - // and silently do their thing live here.) - - scoped_ptr alternate_error_page_tab_observer_; - scoped_ptr webnavigation_observer_; - scoped_ptr external_protocol_observer_; - scoped_ptr omnibox_search_hint_; -#if defined(ENABLE_ONE_CLICK_SIGNIN) - scoped_ptr one_click_signin_helper_; -#endif - scoped_ptr pdf_tab_observer_; - scoped_ptr plugin_observer_; - scoped_ptr print_preview_; - scoped_ptr - safe_browsing_tab_observer_; - - // WebContents (MUST BE LAST) ------------------------------------------------ - - // If true, we're running the destructor. - bool in_destructor_; - - // The supporting objects need to outlive the WebContents dtor (as they may - // be called upon during its execution). As a result, this must come last - // in the list. - scoped_ptr web_contents_; - - DISALLOW_COPY_AND_ASSIGN(TabContentsWrapper); -}; +typedef TabContents TabContentsWrapper; #endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ diff --git a/chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h b/chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h index 0efccca..cc2a0c2 100644 --- a/chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h +++ b/chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h @@ -9,7 +9,8 @@ #include "base/compiler_specific.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace content { class WebContents; diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h b/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h index dd1958b..804a149 100644 --- a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h +++ b/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h @@ -21,7 +21,8 @@ typedef TabModalConfirmDialogViews TabModalConfirmDialog; #endif class MockTabModalConfirmDialogDelegate; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TabModalConfirmDialogDelegate; class TabModalConfirmDialogTest : public InProcessBrowserTest { diff --git a/chrome/browser/ui/tabs/tab_strip_model.h b/chrome/browser/ui/tabs/tab_strip_model.h index c6d1d9a..4cd01fd 100644 --- a/chrome/browser/ui/tabs/tab_strip_model.h +++ b/chrome/browser/ui/tabs/tab_strip_model.h @@ -16,7 +16,8 @@ #include "content/public/common/page_transition_types.h" class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TabStripModelDelegate; class TabStripModelOrderController; diff --git a/chrome/browser/ui/tabs/tab_strip_model_delegate.h b/chrome/browser/ui/tabs/tab_strip_model_delegate.h index edd5a7e..4c536b8 100644 --- a/chrome/browser/ui/tabs/tab_strip_model_delegate.h +++ b/chrome/browser/ui/tabs/tab_strip_model_delegate.h @@ -14,7 +14,8 @@ class Browser; class DockInfo; class GURL; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace content { class SiteInstance; struct Referrer; diff --git a/chrome/browser/ui/tabs/tab_strip_model_observer.h b/chrome/browser/ui/tabs/tab_strip_model_observer.h index ae5f4be..f613679 100644 --- a/chrome/browser/ui/tabs/tab_strip_model_observer.h +++ b/chrome/browser/ui/tabs/tab_strip_model_observer.h @@ -6,7 +6,8 @@ #define CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_OBSERVER_H_ #pragma once -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TabStripModel; class TabStripSelectionModel; diff --git a/chrome/browser/ui/tabs/tab_strip_model_order_controller.h b/chrome/browser/ui/tabs/tab_strip_model_order_controller.h index bed3372..bcfaee4 100644 --- a/chrome/browser/ui/tabs/tab_strip_model_order_controller.h +++ b/chrome/browser/ui/tabs/tab_strip_model_order_controller.h @@ -9,7 +9,8 @@ #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "content/public/common/page_transition_types.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; /////////////////////////////////////////////////////////////////////////////// // TabStripModelOrderController diff --git a/chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.h b/chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.h index e8f8bd4..6d81eee 100644 --- a/chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.h +++ b/chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.h @@ -20,7 +20,8 @@ class Browser; class ChromeLauncherController; class LauncherFaviconLoader; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace ash { class LauncherModel; diff --git a/chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h b/chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h index 8b74e81..f73adc6 100644 --- a/chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h +++ b/chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h @@ -30,7 +30,8 @@ class BrowserLauncherItemController; class BrowserLauncherItemControllerTest; class PrefService; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // ChromeLauncherController manages the launcher items needed for tabbed // browsers (BrowserLauncherItemController) and browser shortcuts. diff --git a/chrome/browser/ui/views/browser_dialogs.h b/chrome/browser/ui/views/browser_dialogs.h index f178371..c2d4c3b 100644 --- a/chrome/browser/ui/views/browser_dialogs.h +++ b/chrome/browser/ui/views/browser_dialogs.h @@ -22,7 +22,8 @@ class EditSearchEngineControllerDelegate; class FindBar; class GURL; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TemplateURL; namespace content { diff --git a/chrome/browser/ui/views/collected_cookies_views.h b/chrome/browser/ui/views/collected_cookies_views.h index 9c8558a..6b7ec21 100644 --- a/chrome/browser/ui/views/collected_cookies_views.h +++ b/chrome/browser/ui/views/collected_cookies_views.h @@ -18,7 +18,8 @@ class ConstrainedWindow; class CookieInfoView; class CookiesTreeModel; class InfobarView; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace views { class Label; diff --git a/chrome/browser/ui/views/constrained_window_views.h b/chrome/browser/ui/views/constrained_window_views.h index f42a8b5..386c5f2 100644 --- a/chrome/browser/ui/views/constrained_window_views.h +++ b/chrome/browser/ui/views/constrained_window_views.h @@ -12,7 +12,8 @@ #include "ui/gfx/rect.h" #include "ui/views/widget/widget.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace views { namespace internal { diff --git a/chrome/browser/ui/views/create_application_shortcut_view.h b/chrome/browser/ui/views/create_application_shortcut_view.h index f7d5738..1b2648f 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.h +++ b/chrome/browser/ui/views/create_application_shortcut_view.h @@ -16,7 +16,8 @@ #include "ui/views/window/dialog_delegate.h" class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class SkBitmap; namespace extensions { diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.h b/chrome/browser/ui/views/location_bar/location_bar_view.h index 588106d..ea2a195 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.h +++ b/chrome/browser/ui/views/location_bar/location_bar_view.h @@ -48,7 +48,8 @@ class PageActionImageView; class Profile; class SelectedKeywordView; class StarView; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TemplateURLService; namespace views { diff --git a/chrome/browser/ui/views/ssl_client_certificate_selector.h b/chrome/browser/ui/views/ssl_client_certificate_selector.h index 58f96af..5a00c42 100644 --- a/chrome/browser/ui/views/ssl_client_certificate_selector.h +++ b/chrome/browser/ui/views/ssl_client_certificate_selector.h @@ -34,7 +34,8 @@ class TextButton; class CertificateSelectorTableModel; class ConstrainedWindow; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class SSLClientCertificateSelector : public SSLClientAuthObserver, public views::DialogDelegateView, diff --git a/chrome/browser/ui/views/stubs_aura.cc b/chrome/browser/ui/views/stubs_aura.cc index c5a4e30..cbb5950 100644 --- a/chrome/browser/ui/views/stubs_aura.cc +++ b/chrome/browser/ui/views/stubs_aura.cc @@ -22,7 +22,8 @@ #endif class SSLClientAuthHandler; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace net { class HttpNetworkSession; diff --git a/chrome/browser/ui/views/tab_modal_confirm_dialog_views.h b/chrome/browser/ui/views/tab_modal_confirm_dialog_views.h index 97630b6..eaf4dc4 100644 --- a/chrome/browser/ui/views/tab_modal_confirm_dialog_views.h +++ b/chrome/browser/ui/views/tab_modal_confirm_dialog_views.h @@ -9,7 +9,8 @@ #include "ui/gfx/native_widget_types.h" #include "ui/views/window/dialog_delegate.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TabModalConfirmDialogDelegate; namespace views { diff --git a/chrome/browser/ui/web_applications/web_app_ui.h b/chrome/browser/ui/web_applications/web_app_ui.h index 93e9b1b..8d7d422 100644 --- a/chrome/browser/ui/web_applications/web_app_ui.h +++ b/chrome/browser/ui/web_applications/web_app_ui.h @@ -10,7 +10,8 @@ #include "chrome/browser/shell_integration.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace web_app { diff --git a/chrome/browser/ui/website_settings/website_settings.h b/chrome/browser/ui/website_settings/website_settings.h index 94c6c61..7949ab5 100644 --- a/chrome/browser/ui/website_settings/website_settings.h +++ b/chrome/browser/ui/website_settings/website_settings.h @@ -23,7 +23,8 @@ struct SSLStatus; class HostContentSettingsMap; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class WebsiteSettingsUI; // The |WebsiteSettings| provides information about a website's permissions, diff --git a/chrome/browser/ui/website_settings/website_settings_ui.h b/chrome/browser/ui/website_settings/website_settings_ui.h index b5c4b65..083e245d 100644 --- a/chrome/browser/ui/website_settings/website_settings_ui.h +++ b/chrome/browser/ui/website_settings/website_settings_ui.h @@ -19,7 +19,8 @@ class CookieInfoList; class GURL; class PermissionInfoList; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class WebsiteSettings; namespace content { diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.h b/chrome/browser/ui/webui/print_preview/print_preview_handler.h index 24510b2..339e4ce 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_handler.h +++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.h @@ -20,7 +20,8 @@ class FilePath; class PrintSystemTaskProxy; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; namespace base { class DictionaryValue; diff --git a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h b/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h index da3fb08..ddfc86e 100644 --- a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h +++ b/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h @@ -14,7 +14,8 @@ #include "base/memory/scoped_ptr.h" #include "ui/web_dialogs/web_dialog_delegate.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TabModalConfirmDialogDelegate; namespace ui { diff --git a/chrome/browser/ui/zoom/zoom_controller.h b/chrome/browser/ui/zoom/zoom_controller.h index fd0e9a1..7f887c6 100644 --- a/chrome/browser/ui/zoom/zoom_controller.h +++ b/chrome/browser/ui/zoom/zoom_controller.h @@ -13,7 +13,8 @@ #include "content/public/browser/notification_registrar.h" #include "content/public/browser/web_contents_observer.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class ZoomObserver; // Per-tab class to manage the Omnibox zoom icon. diff --git a/chrome/browser/ui/zoom/zoom_observer.h b/chrome/browser/ui/zoom/zoom_observer.h index d674810..4baeede 100644 --- a/chrome/browser/ui/zoom/zoom_observer.h +++ b/chrome/browser/ui/zoom/zoom_observer.h @@ -8,7 +8,8 @@ #include "chrome/browser/ui/zoom/zoom_controller.h" -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; // Interface for objects that wish to be notified of changes in ZoomController. class ZoomObserver { diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 47a0ce4..829f52b 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -3258,10 +3258,10 @@ 'browser/ui/tab_contents/core_tab_helper.h', 'browser/ui/tab_contents/core_tab_helper_delegate.cc', 'browser/ui/tab_contents/core_tab_helper_delegate.h', + 'browser/ui/tab_contents/tab_contents.cc', + 'browser/ui/tab_contents/tab_contents.h', 'browser/ui/tab_contents/tab_contents_iterator.cc', 'browser/ui/tab_contents/tab_contents_iterator.h', - 'browser/ui/tab_contents/tab_contents_wrapper.cc', - 'browser/ui/tab_contents/tab_contents_wrapper.h', 'browser/ui/tab_modal_confirm_dialog_delegate.cc', 'browser/ui/tab_modal_confirm_dialog_delegate.h', 'browser/ui/tabs/dock_info.cc', diff --git a/chrome/test/base/ui_test_utils.h b/chrome/test/base/ui_test_utils.h index 37f491c..086d084 100644 --- a/chrome/test/base/ui_test_utils.h +++ b/chrome/test/base/ui_test_utils.h @@ -51,7 +51,8 @@ class MessageLoop; class Profile; class ScopedTempDir; class SkBitmap; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class TemplateURLService; namespace browser { diff --git a/ui/web_dialogs/constrained_web_dialog_ui.h b/ui/web_dialogs/constrained_web_dialog_ui.h index 4673dac..63b1bdd 100644 --- a/ui/web_dialogs/constrained_web_dialog_ui.h +++ b/ui/web_dialogs/constrained_web_dialog_ui.h @@ -12,7 +12,8 @@ class ConstrainedWindow; class Profile; -class TabContentsWrapper; +class TabContents; +typedef TabContents TabContentsWrapper; class WebDialogWebContentsDelegate; namespace base { -- cgit v1.1