diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-05 06:08:54 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-05 06:08:54 +0000 |
commit | cb4282a066df8b0e1c09c90d3780625579c0a569 (patch) | |
tree | e3bc08313cbca44a0229775c180511f78ab8e278 | |
parent | c31116a991f7cd93a69a7f609d9dded29c87ab85 (diff) | |
download | chromium_src-cb4282a066df8b0e1c09c90d3780625579c0a569.zip chromium_src-cb4282a066df8b0e1c09c90d3780625579c0a569.tar.gz chromium_src-cb4282a066df8b0e1c09c90d3780625579c0a569.tar.bz2 |
Get rid of another bunch of tab_contents.h includes from chrome and switch the code to use WebContents.
BUG=98716
TBR=erg
Review URL: http://codereview.chromium.org/9110003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116466 0039d316-1c4b-4281-b951-d872f2087c98
105 files changed, 299 insertions, 257 deletions
diff --git a/chrome/browser/ui/cocoa/web_intent_picker_cocoa.h b/chrome/browser/ui/cocoa/web_intent_picker_cocoa.h index 0d90539..0d5c529 100644 --- a/chrome/browser/ui/cocoa/web_intent_picker_cocoa.h +++ b/chrome/browser/ui/cocoa/web_intent_picker_cocoa.h @@ -33,7 +33,7 @@ class WebIntentPickerCocoa : public WebIntentPicker { virtual void SetServiceIcon(size_t index, const SkBitmap& icon) OVERRIDE; virtual void SetDefaultServiceIcon(size_t index) OVERRIDE; virtual void Close() OVERRIDE; - virtual TabContents* SetInlineDisposition(const GURL& url) OVERRIDE; + virtual content::WebContents* SetInlineDisposition(const GURL& url) OVERRIDE; private: diff --git a/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm b/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm index 5f219c0..cebd9d7 100644 --- a/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm +++ b/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm @@ -15,6 +15,8 @@ #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" #include "skia/ext/skia_utils_mac.h" +using content::WebContents; + // static WebIntentPicker* WebIntentPicker::Create(Browser* browser, TabContentsWrapper* wrapper, @@ -73,7 +75,7 @@ void WebIntentPickerCocoa::SetDefaultServiceIcon(size_t index) { void WebIntentPickerCocoa::Close() { } -TabContents* WebIntentPickerCocoa::SetInlineDisposition(const GURL& url) { +WebContents* WebIntentPickerCocoa::SetInlineDisposition(const GURL& url) { return NULL; } diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc index a27586f..b431ed5 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc @@ -34,11 +34,11 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/pref_names.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/user_metrics.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/ui_resources.h" diff --git a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc index b90099f..3643935 100644 --- a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc +++ b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc @@ -30,7 +30,6 @@ #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_action.h" #include "chrome/common/extensions/extension_resource.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/gtk/browser_titlebar.cc b/chrome/browser/ui/gtk/browser_titlebar.cc index bc32f99..c304558 100644 --- a/chrome/browser/ui/gtk/browser_titlebar.cc +++ b/chrome/browser/ui/gtk/browser_titlebar.cc @@ -11,6 +11,7 @@ #include <vector> #include "base/command_line.h" +#include "base/i18n/rtl.h" #include "base/memory/singleton.h" #include "base/string_piece.h" #include "base/string_tokenizer.h" @@ -40,8 +41,8 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_service.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" diff --git a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc index c710560..f43b6ca 100644 --- a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc +++ b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc @@ -42,10 +42,10 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/user_metrics.h" +#include "content/public/browser/web_contents.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -60,6 +60,7 @@ #include "ui/gfx/skbitmap_operations.h" using content::UserMetricsAction; +using content::WebContents; namespace { @@ -415,7 +416,7 @@ void BrowserToolbarGtk::Observe(int type, // BrowserToolbarGtk, public --------------------------------------------------- -void BrowserToolbarGtk::UpdateTabContents(TabContents* contents, +void BrowserToolbarGtk::UpdateWebContents(WebContents* contents, bool should_restore_state) { location_bar_->Update(should_restore_state ? contents : NULL); diff --git a/chrome/browser/ui/gtk/browser_toolbar_gtk.h b/chrome/browser/ui/gtk/browser_toolbar_gtk.h index b5dba1d..4ac61e3 100644 --- a/chrome/browser/ui/gtk/browser_toolbar_gtk.h +++ b/chrome/browser/ui/gtk/browser_toolbar_gtk.h @@ -33,9 +33,12 @@ class GtkThemeService; class LocationBar; class LocationBarViewGtk; class ReloadButtonGtk; -class TabContents; class ToolbarModel; +namespace content { +class WebContents; +} + // View class that displays the GTK version of the toolbar and routes gtk // events back to the Browser. class BrowserToolbarGtk : public CommandUpdater::CommandObserver, @@ -103,7 +106,8 @@ class BrowserToolbarGtk : public CommandUpdater::CommandObserver, const content::NotificationDetails& details) OVERRIDE; // Message that we should react to a state change. - void UpdateTabContents(TabContents* contents, bool should_restore_state); + void UpdateWebContents(content::WebContents* contents, + bool should_restore_state); private: // Connect/Disconnect signals for dragging a url onto the home button. diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc index 1e79921..98a68d1 100644 --- a/chrome/browser/ui/gtk/browser_window_gtk.cc +++ b/chrome/browser/ui/gtk/browser_window_gtk.cc @@ -81,11 +81,11 @@ #include "chrome/common/pref_names.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host_view.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" #include "content/public/browser/download_manager.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/notification_service.h" +#include "content/public/browser/web_contents.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -963,7 +963,7 @@ void BrowserWindowGtk::UpdateReloadStopState(bool is_loading, bool force) { void BrowserWindowGtk::UpdateToolbar(TabContentsWrapper* contents, bool should_restore_state) { TRACE_EVENT0("ui::gtk", "BrowserWindowGtk::UpdateToolbar"); - toolbar_->UpdateTabContents(contents->tab_contents(), should_restore_state); + toolbar_->UpdateWebContents(contents->web_contents(), should_restore_state); } void BrowserWindowGtk::FocusToolbar() { @@ -1278,8 +1278,8 @@ void BrowserWindowGtk::ActiveTabChanged(TabContentsWrapper* old_contents, int index, bool user_gesture) { TRACE_EVENT0("ui::gtk", "BrowserWindowGtk::ActiveTabChanged"); - if (old_contents && !old_contents->tab_contents()->IsBeingDestroyed()) - old_contents->tab_contents()->GetView()->StoreFocus(); + if (old_contents && !old_contents->web_contents()->IsBeingDestroyed()) + old_contents->web_contents()->GetView()->StoreFocus(); // Update various elements that are interested in knowing the current // TabContents. @@ -1287,11 +1287,11 @@ void BrowserWindowGtk::ActiveTabChanged(TabContentsWrapper* old_contents, infobar_container_->ChangeTabContents(new_contents->infobar_tab_helper()); contents_container_->SetTab(new_contents); - new_contents->tab_contents()->DidBecomeSelected(); + new_contents->web_contents()->DidBecomeSelected(); // TODO(estade): after we manage browser activation, add a check to make sure // we are the active browser before calling RestoreFocus(). if (!browser_->tabstrip_model()->closing_all()) { - new_contents->tab_contents()->GetView()->RestoreFocus(); + new_contents->web_contents()->GetView()->RestoreFocus(); if (new_contents->find_tab_helper()->find_ui_active()) browser_->GetFindBarController()->find_bar()->SetFocusAndSelection(); } @@ -1477,7 +1477,7 @@ gboolean BrowserWindowGtk::OnConfigure(GtkWidget* widget, TabContentsWrapper* tab = GetDisplayedTab(); if (tab) { - tab->tab_contents()->GetRenderViewHost()->NotifyMoveOrResizeStarted(); + tab->web_contents()->GetRenderViewHost()->NotifyMoveOrResizeStarted(); } if (bounds_.size() != bounds.size()) diff --git a/chrome/browser/ui/gtk/constrained_window_gtk.cc b/chrome/browser/ui/gtk/constrained_window_gtk.cc index 513f72e..570a4539e 100644 --- a/chrome/browser/ui/gtk/constrained_window_gtk.cc +++ b/chrome/browser/ui/gtk/constrained_window_gtk.cc @@ -12,8 +12,8 @@ #include "chrome/browser/ui/constrained_window_tab_helper.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/web_contents.h" #include "ui/base/gtk/gtk_compat.h" #include "ui/base/gtk/gtk_hig_constants.h" @@ -126,7 +126,7 @@ void ConstrainedWindowGtk::FocusConstrainedWindow() { // TODO(estade): this define should not need to be here because this class // should not be used on linux/views. #if defined(TOOLKIT_GTK) - static_cast<TabContentsViewGtk*>(wrapper_->tab_contents()->GetView())-> + static_cast<TabContentsViewGtk*>(wrapper_->web_contents()->GetView())-> SetFocusedWidget(focus_widget); #endif } @@ -136,11 +136,11 @@ ConstrainedWindowGtk::TabContentsViewType* ConstrainedWindowGtk::ContainingView() { #if defined(TOOLKIT_VIEWS) return static_cast<NativeTabContentsViewGtk*>( - static_cast<TabContentsViewViews*>(wrapper_->tab_contents()->GetView())-> + static_cast<TabContentsViewViews*>(wrapper_->web_contents()->GetView())-> native_tab_contents_view()); #else return static_cast<TabContentsViewType*>( - static_cast<TabContentsViewGtk*>(wrapper_->tab_contents()->GetView())-> + static_cast<TabContentsViewGtk*>(wrapper_->web_contents()->GetView())-> wrapper()); #endif } diff --git a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc index 176ef19..34ba9c1 100644 --- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc @@ -16,8 +16,8 @@ #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_resource.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -293,8 +293,8 @@ CreateWebApplicationShortcutsDialogGtk::CreateWebApplicationShortcutsDialogGtk( } void CreateWebApplicationShortcutsDialogGtk::OnCreatedShortcut() { - if (tab_contents_->tab_contents()->GetDelegate()) - tab_contents_->tab_contents()->GetDelegate()->ConvertContentsToApplication( + if (tab_contents_->web_contents()->GetDelegate()) + tab_contents_->web_contents()->GetDelegate()->ConvertContentsToApplication( tab_contents_->web_contents()); } diff --git a/chrome/browser/ui/gtk/find_bar_gtk.cc b/chrome/browser/ui/gtk/find_bar_gtk.cc index 44a12c0..58119c1 100644 --- a/chrome/browser/ui/gtk/find_bar_gtk.cc +++ b/chrome/browser/ui/gtk/find_bar_gtk.cc @@ -33,9 +33,9 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/chrome_notification_types.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" @@ -456,7 +456,7 @@ void FindBarGtk::RestoreSavedFocus() { if (focus_store_.widget()) gtk_widget_grab_focus(focus_store_.widget()); else - find_bar_controller_->tab_contents()->tab_contents()->Focus(); + find_bar_controller_->tab_contents()->web_contents()->Focus(); } FindBarTesting* FindBarGtk::GetFindBarTesting() { @@ -674,7 +674,7 @@ bool FindBarGtk::MaybeForwardKeyEventToRenderer(GdkEventKey* event) { return false; RenderViewHost* render_view_host = - contents->tab_contents()->GetRenderViewHost(); + contents->web_contents()->GetRenderViewHost(); // Make sure we don't have a text field element interfering with keyboard // input. Otherwise Up and Down arrow key strokes get eaten. "Nom Nom Nom". diff --git a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc index 81404e8..d08058a 100644 --- a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc @@ -10,7 +10,6 @@ #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/browser/ui/gtk/rounded_window.h" #include "content/browser/renderer_host/render_widget_host_view.h" -#include "content/browser/tab_contents/tab_contents.h" #include "grit/generated_resources.h" #include "grit/ui_strings.h" #include "ui/base/gtk/gtk_floating_container.h" diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc index f8136d8..54424a4 100644 --- a/chrome/browser/ui/gtk/gtk_util.cc +++ b/chrome/browser/ui/gtk/gtk_util.cc @@ -26,7 +26,7 @@ #include "chrome/browser/ui/gtk/gtk_theme_service.h" #include "content/browser/disposition_utils.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "content/public/common/renderer_preferences.h" #include "googleurl/src/gurl.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc b/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc index f666d03..f8258ae 100644 --- a/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc @@ -15,8 +15,8 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/logging_chrome.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/render_process_host.h" +#include "content/public/browser/web_contents.h" #include "content/public/common/result_codes.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -184,10 +184,10 @@ void HungRendererDialogGtk::ShowForWebContents(WebContents* hung_contents) { GtkTreeIter tree_iter; for (TabContentsIterator it; !it.done(); ++it) { - if (it->tab_contents()->GetRenderProcessHost() == + if (it->web_contents()->GetRenderProcessHost() == hung_contents->GetRenderProcessHost()) { gtk_list_store_append(model_, &tree_iter); - std::string title = UTF16ToUTF8(it->tab_contents()->GetTitle()); + std::string title = UTF16ToUTF8(it->web_contents()->GetTitle()); if (title.empty()) title = UTF16ToUTF8(CoreTabHelper::GetDefaultTitle()); SkBitmap favicon = it->favicon_tab_helper()->GetFavicon(); diff --git a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc index c2feff4..5a66015 100644 --- a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc +++ b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc @@ -16,8 +16,8 @@ #include "chrome/browser/ui/gtk/infobars/infobar_container_gtk.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/chrome_notification_types.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/web_contents.h" #include "ui/base/gtk/gtk_expanded_container.h" #include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/gtk/gtk_signal_registrar.h" diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc index fb99e14..c7a7744 100644 --- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc @@ -53,9 +53,9 @@ #include "chrome/common/extensions/extension_action.h" #include "chrome/common/extensions/extension_resource.h" #include "chrome/common/pref_names.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/notification_service.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" @@ -1387,7 +1387,7 @@ gboolean LocationBarViewGtk::ContentSettingImageViewGtk::OnButtonPressed( ContentSettingBubbleModel::CreateContentSettingBubbleModel( parent_->browser(), tab_contents, profile, content_setting_image_model_->get_content_settings_type()), - profile, tab_contents->tab_contents()); + profile, tab_contents->web_contents()); return TRUE; } diff --git a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc index 0834287..c5d6b8a 100644 --- a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc +++ b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc @@ -33,8 +33,8 @@ #include "chrome/common/extensions/extension.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host_view.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" diff --git a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc index b4b5aac..f7a41ff 100644 --- a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc +++ b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc @@ -10,6 +10,7 @@ #include <algorithm> #include "base/logging.h" +#include "base/property_bag.h" #include "base/string_util.h" #include "base/utf_string_conversion_utils.h" #include "base/utf_string_conversions.h" @@ -28,8 +29,8 @@ #include "chrome/browser/ui/gtk/view_id_util.h" #include "chrome/browser/ui/toolbar/toolbar_model.h" #include "chrome/common/chrome_notification_types.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/web_contents.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" #include "net/base/escape.h" @@ -107,7 +108,7 @@ struct AutocompleteEditState { }; // Returns a lazily initialized property bag accessor for saving our state in a -// TabContents. +// WebContents. base::PropertyAccessor<AutocompleteEditState>* GetStateAccessor() { CR_DEFINE_STATIC_LOCAL( base::PropertyAccessor<AutocompleteEditState>, state, ()); diff --git a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc index f320cbf..bf130af 100644 --- a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc +++ b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc @@ -20,7 +20,6 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/net/x509_certificate_model.h" #include "content/browser/ssl/ssl_client_auth_handler.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" #include "grit/generated_resources.h" #include "net/base/x509_certificate.h" diff --git a/chrome/browser/ui/gtk/tab_contents_container_gtk.cc b/chrome/browser/ui/gtk/tab_contents_container_gtk.cc index 3675ca3..48e45a9 100644 --- a/chrome/browser/ui/gtk/tab_contents_container_gtk.cc +++ b/chrome/browser/ui/gtk/tab_contents_container_gtk.cc @@ -10,7 +10,6 @@ #include "chrome/browser/ui/gtk/status_bubble_gtk.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "content/browser/renderer_host/render_widget_host_view_gtk.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" #include "content/public/browser/web_contents.h" @@ -69,7 +68,7 @@ void TabContentsContainerGtk::SetTab(TabContentsWrapper* tab) { HideTab(tab_); if (tab_) { registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, - content::Source<WebContents>(tab_->tab_contents())); + content::Source<WebContents>(tab_->web_contents())); } tab_ = tab; @@ -82,7 +81,7 @@ void TabContentsContainerGtk::SetTab(TabContentsWrapper* tab) { // Otherwise we actually have to add it to the widget hierarchy. PackTab(tab); registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, - content::Source<WebContents>(tab_->tab_contents())); + content::Source<WebContents>(tab_->web_contents())); } } @@ -100,7 +99,7 @@ void TabContentsContainerGtk::SetPreview(TabContentsWrapper* preview) { PackTab(preview); registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, - content::Source<WebContents>(preview_->tab_contents())); + content::Source<WebContents>(preview_->web_contents())); } void TabContentsContainerGtk::RemovePreview() { @@ -109,12 +108,12 @@ void TabContentsContainerGtk::RemovePreview() { HideTab(preview_); - GtkWidget* preview_widget = preview_->tab_contents()->GetNativeView(); + GtkWidget* preview_widget = preview_->web_contents()->GetNativeView(); if (preview_widget) gtk_container_remove(GTK_CONTAINER(expanded_), preview_widget); registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, - content::Source<WebContents>(preview_->tab_contents())); + content::Source<WebContents>(preview_->web_contents())); preview_ = NULL; } @@ -131,7 +130,7 @@ void TabContentsContainerGtk::PackTab(TabContentsWrapper* tab) { if (!tab) return; - gfx::NativeView widget = tab->tab_contents()->GetNativeView(); + gfx::NativeView widget = tab->web_contents()->GetNativeView(); if (widget) { if (widget->parent != expanded_) gtk_container_add(GTK_CONTAINER(expanded_), widget); @@ -140,29 +139,29 @@ void TabContentsContainerGtk::PackTab(TabContentsWrapper* tab) { // We need to make sure that we are below the findbar. // Sometimes the content native view will be null. - if (tab->tab_contents()->GetContentNativeView()) { + if (tab->web_contents()->GetContentNativeView()) { GdkWindow* content_gdk_window = - tab->tab_contents()->GetContentNativeView()->window; + tab->web_contents()->GetContentNativeView()->window; if (content_gdk_window) gdk_window_lower(content_gdk_window); } - tab->tab_contents()->ShowContents(); + tab->web_contents()->ShowContents(); } void TabContentsContainerGtk::HideTab(TabContentsWrapper* tab) { if (!tab) return; - gfx::NativeView widget = tab->tab_contents()->GetNativeView(); + gfx::NativeView widget = tab->web_contents()->GetNativeView(); if (widget) gtk_widget_hide(widget); - tab->tab_contents()->WasHidden(); + tab->web_contents()->WasHidden(); } void TabContentsContainerGtk::DetachTab(TabContentsWrapper* tab) { - gfx::NativeView widget = tab->tab_contents()->GetNativeView(); + gfx::NativeView widget = tab->web_contents()->GetNativeView(); // It is possible to detach an unrealized, unparented TabContents if you // slow things down enough in valgrind. Might happen in the real world, too. @@ -184,9 +183,9 @@ void TabContentsContainerGtk::Observe( void TabContentsContainerGtk::WebContentsDestroyed(WebContents* contents) { // Sometimes, a WebContents is destroyed before we know about it. This allows // us to clean up our state in case this happens. - if (preview_ && contents == preview_->tab_contents()) + if (preview_ && contents == preview_->web_contents()) PopPreview(); - else if (tab_ && contents == tab_->tab_contents()) + else if (tab_ && contents == tab_->web_contents()) SetTab(NULL); else NOTREACHED(); @@ -198,7 +197,7 @@ void TabContentsContainerGtk::WebContentsDestroyed(WebContents* contents) { gboolean TabContentsContainerGtk::OnFocus(GtkWidget* widget, GtkDirectionType focus) { if (preview_) { - gtk_widget_child_focus(tab_->tab_contents()->GetContentNativeView(), focus); + gtk_widget_child_focus(tab_->web_contents()->GetContentNativeView(), focus); return TRUE; } diff --git a/chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.cc b/chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.cc index 1379187..4457688 100644 --- a/chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.cc @@ -9,7 +9,6 @@ #include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_types.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/ui/gtk/tabs/drag_data.cc b/chrome/browser/ui/gtk/tabs/drag_data.cc index 28ca688..e260413 100644 --- a/chrome/browser/ui/gtk/tabs/drag_data.cc +++ b/chrome/browser/ui/gtk/tabs/drag_data.cc @@ -7,7 +7,7 @@ #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/gtk/tabs/tab_gtk.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" using content::WebContents; @@ -39,7 +39,7 @@ DraggedTabData::~DraggedTabData() { } void DraggedTabData::ResetDelegate() { - contents_->tab_contents()->SetDelegate(original_delegate_); + contents_->web_contents()->SetDelegate(original_delegate_); } DragData::DragData(std::vector<DraggedTabData> drag_data, int source_tab_index) @@ -63,11 +63,11 @@ std::vector<TabGtk*> DragData::GetDraggedTabs() const { return tabs; } -std::vector<TabContents*> DragData::GetDraggedTabsContents() const { - std::vector<TabContents*> tabs_contents; +std::vector<WebContents*> DragData::GetDraggedTabsContents() const { + std::vector<WebContents*> tabs_contents; for (size_t i = 0; i < drag_data_.size(); ++i) { - if (drag_data_[i].contents_->tab_contents()) - tabs_contents.push_back(drag_data_[i].contents_->tab_contents()); + if (drag_data_[i].contents_->web_contents()) + tabs_contents.push_back(drag_data_[i].contents_->web_contents()); } return tabs_contents; } diff --git a/chrome/browser/ui/gtk/tabs/drag_data.h b/chrome/browser/ui/gtk/tabs/drag_data.h index 1cfb749..9b04414 100644 --- a/chrome/browser/ui/gtk/tabs/drag_data.h +++ b/chrome/browser/ui/gtk/tabs/drag_data.h @@ -10,7 +10,6 @@ #include "base/basictypes.h" -class TabContents; class TabContentsWrapper; class TabGtk; @@ -67,7 +66,7 @@ class DragData { std::vector<TabGtk*> GetDraggedTabs() const; // Returns all the |contents_| fields of the tabs in |drag_data_|. - std::vector<TabContents*> GetDraggedTabsContents() const; + std::vector<content::WebContents*> GetDraggedTabsContents() const; // Returns the correct add type for the tab in |drag_data_[i]|. See // TabStripModel::AddTabTypes for available types. diff --git a/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc b/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc index 2857c22..a5ed4d3 100644 --- a/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc @@ -23,12 +23,14 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "content/browser/renderer_host/backing_store_gtk.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "third_party/skia/include/core/SkShader.h" #include "ui/base/gtk/gtk_screen_utils.h" #include "ui/base/x/x11_util.h" #include "ui/gfx/gtk_util.h" +using content::WebContents; + namespace { // The size of the dragged window frame. @@ -63,7 +65,7 @@ DraggedViewGtk::DraggedViewGtk(DragData* drag_data, attached_tab_size_(TabRendererGtk::GetMinimumSelectedSize()), contents_size_(contents_size), close_animation_(this) { - std::vector<TabContents*> data_sources(drag_data_->GetDraggedTabsContents()); + std::vector<WebContents*> data_sources(drag_data_->GetDraggedTabsContents()); for (size_t i = 0; i < data_sources.size(); i++) { renderers_.push_back(new TabRendererGtk(GtkThemeService::GetFrom( Profile::FromBrowserContext(data_sources[i]->GetBrowserContext())))); @@ -72,9 +74,9 @@ DraggedViewGtk::DraggedViewGtk(DragData* drag_data, for (size_t i = 0; i < drag_data_->size(); i++) { TabContentsWrapper* wrapper = TabContentsWrapper::GetCurrentWrapperForContents( - drag_data_->get(i)->contents_->tab_contents()); + drag_data_->get(i)->contents_->web_contents()); renderers_[i]->UpdateData( - drag_data_->get(i)->contents_->tab_contents(), + drag_data_->get(i)->contents_->web_contents(), wrapper->extension_tab_helper()->is_app(), false); // loading_only renderers_[i]->set_is_active( diff --git a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc index 6878d35..3230214 100644 --- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc @@ -21,8 +21,8 @@ #include "chrome/browser/ui/tab_contents/core_tab_helper.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/chrome_notification_types.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" diff --git a/chrome/browser/ui/gtk/web_intent_picker_gtk.cc b/chrome/browser/ui/gtk/web_intent_picker_gtk.cc index d9be02f..ae81564 100644 --- a/chrome/browser/ui/gtk/web_intent_picker_gtk.cc +++ b/chrome/browser/ui/gtk/web_intent_picker_gtk.cc @@ -171,7 +171,7 @@ void WebIntentPickerGtk::Close() { bubble_->Close(); bubble_ = NULL; if (inline_disposition_tab_contents_.get()) - inline_disposition_tab_contents_->tab_contents()->OnCloseStarted(); + inline_disposition_tab_contents_->web_contents()->OnCloseStarted(); } void WebIntentPickerGtk::BubbleClosing(BubbleGtk* bubble, @@ -247,7 +247,7 @@ void RemoveAllHelper(GtkWidget* widget, gpointer data) { gtk_container_remove(GTK_CONTAINER(parent), widget); } -TabContents* WebIntentPickerGtk::SetInlineDisposition(const GURL& url) { +WebContents* WebIntentPickerGtk::SetInlineDisposition(const GURL& url) { TabContents* tab_contents = new TabContents( browser_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); inline_disposition_tab_contents_.reset(new TabContentsWrapper(tab_contents)); @@ -256,7 +256,7 @@ TabContents* WebIntentPickerGtk::SetInlineDisposition(const GURL& url) { tab_contents_container_.reset(new TabContentsContainerGtk(NULL)); tab_contents_container_->SetTab(inline_disposition_tab_contents_.get()); - inline_disposition_tab_contents_->tab_contents()->GetController().LoadURL( + inline_disposition_tab_contents_->web_contents()->GetController().LoadURL( url, content::Referrer(), content::PAGE_TRANSITION_START_PAGE, std::string()); @@ -292,14 +292,14 @@ TabContents* WebIntentPickerGtk::SetInlineDisposition(const GURL& url) { // TODO(gbillock): This size calculation needs more thought. // Move up to WebIntentPicker? - gfx::Size tab_size = wrapper_->tab_contents()->GetView()->GetContainerSize(); + gfx::Size tab_size = wrapper_->web_contents()->GetView()->GetContainerSize(); int width = std::max(tab_size.width()/2, kMainContentWidth); int height = std::max(tab_size.height()/2, kMainContentWidth); gtk_widget_set_size_request(tab_contents_container_->widget(), width, height); gtk_widget_show_all(contents_); - return inline_disposition_tab_contents_->tab_contents(); + return inline_disposition_tab_contents_->web_contents(); } GtkWidget* WebIntentPickerGtk::GetServiceButton(size_t index) { diff --git a/chrome/browser/ui/gtk/web_intent_picker_gtk.h b/chrome/browser/ui/gtk/web_intent_picker_gtk.h index c0020755..204287f 100644 --- a/chrome/browser/ui/gtk/web_intent_picker_gtk.h +++ b/chrome/browser/ui/gtk/web_intent_picker_gtk.h @@ -41,7 +41,7 @@ class WebIntentPickerGtk : public WebIntentPicker, virtual void SetServiceIcon(size_t index, const SkBitmap& icon) OVERRIDE; virtual void SetDefaultServiceIcon(size_t index) OVERRIDE; virtual void Close() OVERRIDE; - virtual TabContents* SetInlineDisposition(const GURL& url) OVERRIDE; + virtual content::WebContents* SetInlineDisposition(const GURL& url) OVERRIDE; // BubbleDelegateGtk implementation. virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; diff --git a/chrome/browser/ui/intents/web_intent_picker.h b/chrome/browser/ui/intents/web_intent_picker.h index 0c49099f..6dadb3e 100644 --- a/chrome/browser/ui/intents/web_intent_picker.h +++ b/chrome/browser/ui/intents/web_intent_picker.h @@ -12,10 +12,13 @@ class Browser; class GURL; class SkBitmap; -class TabContents; class TabContentsWrapper; class WebIntentPickerDelegate; +namespace content { +class WebContents; +} + // Base class for the web intent picker dialog. class WebIntentPicker { public: @@ -40,7 +43,7 @@ class WebIntentPicker { virtual void Close() = 0; // Show the inline disposition UI for the given URL. - virtual TabContents* SetInlineDisposition(const GURL& url) = 0; + virtual content::WebContents* SetInlineDisposition(const GURL& url) = 0; protected: virtual ~WebIntentPicker() {} diff --git a/chrome/browser/ui/intents/web_intent_picker_controller.cc b/chrome/browser/ui/intents/web_intent_picker_controller.cc index d6a88fa..017b972 100644 --- a/chrome/browser/ui/intents/web_intent_picker_controller.cc +++ b/chrome/browser/ui/intents/web_intent_picker_controller.cc @@ -20,13 +20,14 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/webdata/web_data_service.h" #include "content/browser/intents/intent_injector.h" -#include "content/browser/tab_contents/tab_contents.h" -#include "content/public/browser/web_intents_dispatcher.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/web_contents.h" +#include "content/public/browser/web_intents_dispatcher.h" #include "ui/gfx/codec/png_codec.h" #include "webkit/glue/web_intent_service_data.h" using content::NavigationController; +using content::WebContents; namespace { @@ -118,7 +119,7 @@ WebIntentPickerController::WebIntentPickerController( picker_(NULL), pending_async_count_(0), service_tab_(NULL) { - NavigationController* controller = &wrapper->tab_contents()->GetController(); + NavigationController* controller = &wrapper->web_contents()->GetController(); registrar_.Add(this, content::NOTIFICATION_LOAD_START, content::Source<NavigationController>(controller)); registrar_.Add(this, content::NOTIFICATION_TAB_CLOSING, @@ -166,11 +167,11 @@ void WebIntentPickerController::OnServiceChosen(size_t index) { bool inline_disposition = service_data_[index].disposition == webkit_glue::WebIntentServiceData::DISPOSITION_INLINE; - TabContents* new_tab_contents = NULL; + WebContents* new_web_contents = NULL; if (inline_disposition) - new_tab_contents = picker_->SetInlineDisposition(urls_[index]); + new_web_contents = picker_->SetInlineDisposition(urls_[index]); - if (new_tab_contents == NULL) { + if (new_web_contents == NULL) { // TODO(gbillock): This really only handles the 'window' disposition in a // quite prototype way. We need to flesh out what happens to the picker // during the lifetime of the service url context, and that may mean we @@ -182,13 +183,13 @@ void WebIntentPickerController::OnServiceChosen(size_t index) { params.disposition = NEW_FOREGROUND_TAB; params.profile = wrapper_->profile(); browser::Navigate(¶ms); - new_tab_contents = params.target_contents->tab_contents(); - service_tab_ = new_tab_contents; + new_web_contents = params.target_contents->web_contents(); + service_tab_ = new_web_contents; ClosePicker(); } - intents_dispatcher_->DispatchIntent(new_tab_contents); + intents_dispatcher_->DispatchIntent(new_web_contents); } void WebIntentPickerController::OnCancelled() { diff --git a/chrome/browser/ui/intents/web_intent_picker_controller.h b/chrome/browser/ui/intents/web_intent_picker_controller.h index eb5e7a3..278cc3f 100644 --- a/chrome/browser/ui/intents/web_intent_picker_controller.h +++ b/chrome/browser/ui/intents/web_intent_picker_controller.h @@ -19,12 +19,12 @@ class Browser; class GURL; class SkBitmap; -class TabContents; class TabContentsWrapper; class WebIntentPicker; class WebIntentPickerFactory; namespace content { +class WebContents; class WebIntentsDispatcher; } @@ -124,7 +124,7 @@ class WebIntentPickerController : public content::NotificationObserver, // Weak pointer to the tab servicing the intent. Remembered in order to // close it when a reply is sent. - TabContents* service_tab_; + content::WebContents* service_tab_; DISALLOW_COPY_AND_ASSIGN(WebIntentPickerController); }; diff --git a/chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc b/chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc index bfa2842..06faca5 100644 --- a/chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc +++ b/chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc @@ -24,6 +24,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webkit/glue/web_intent_service_data.h" +using content::WebContents; using testing::_; using testing::DoAll; using testing::Return; @@ -67,7 +68,7 @@ class WebIntentPickerMock : public WebIntentPicker { virtual void Close() {} - TabContents* SetInlineDisposition(const GURL& url) { return NULL; } + WebContents* SetInlineDisposition(const GURL& url) { return NULL; } int num_urls_; int num_default_icons_; @@ -109,7 +110,7 @@ class IntentsDispatcherMock : public content::WebIntentsDispatcher { return intent_; } - virtual void DispatchIntent(TabContents* tab_contents) { + virtual void DispatchIntent(WebContents* tab_contents) { dispatched_ = true; } diff --git a/chrome/browser/ui/intents/web_intent_picker_controller_unittest.cc b/chrome/browser/ui/intents/web_intent_picker_controller_unittest.cc index bfa7727..ae2527d 100644 --- a/chrome/browser/ui/intents/web_intent_picker_controller_unittest.cc +++ b/chrome/browser/ui/intents/web_intent_picker_controller_unittest.cc @@ -28,6 +28,7 @@ #include "webkit/glue/web_intent_service_data.h" using content::BrowserThread; +using content::WebContents; using testing::_; using testing::AtMost; using testing::DoAll; @@ -84,7 +85,7 @@ class WebIntentPickerMock : public WebIntentPicker { MOCK_METHOD0(Show, void(void)); MOCK_METHOD0(Close, void(void)); - TabContents* SetInlineDisposition(const GURL& url) { return NULL; } + WebContents* SetInlineDisposition(const GURL& url) { return NULL; } }; class WebIntentPickerFactoryMock : public WebIntentPickerFactory { diff --git a/chrome/browser/ui/intents/web_intent_picker_factory_impl.cc b/chrome/browser/ui/intents/web_intent_picker_factory_impl.cc index 9cf6d83..cb693d29 100644 --- a/chrome/browser/ui/intents/web_intent_picker_factory_impl.cc +++ b/chrome/browser/ui/intents/web_intent_picker_factory_impl.cc @@ -4,8 +4,8 @@ #include "chrome/browser/ui/intents/web_intent_picker_factory_impl.h" +#include "base/logging.h" #include "chrome/browser/ui/intents/web_intent_picker.h" -#include "content/browser/tab_contents/tab_contents.h" WebIntentPickerFactoryImpl::WebIntentPickerFactoryImpl() : picker_(NULL) { diff --git a/chrome/browser/ui/login/login_prompt.cc b/chrome/browser/ui/login/login_prompt.cc index 525f98a..cff6fce 100644 --- a/chrome/browser/ui/login/login_prompt.cc +++ b/chrome/browser/ui/login/login_prompt.cc @@ -19,9 +19,9 @@ #include "content/browser/renderer_host/render_view_host_delegate.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "net/base/auth.h" #include "net/base/net_util.h" @@ -33,6 +33,7 @@ using content::BrowserThread; using content::NavigationController; +using content::WebContents; using webkit::forms::PasswordForm; class LoginHandlerImpl; @@ -116,10 +117,10 @@ void LoginHandler::SetPasswordManager(PasswordManager* password_manager) { password_manager_ = password_manager; } -TabContents* LoginHandler::GetTabContentsForLogin() const { +WebContents* LoginHandler::GetWebContentsForLogin() const { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - return tab_util::GetTabContentsByID(render_process_host_id_, + return tab_util::GetWebContentsByID(render_process_host_id_, tab_contents_id_); } @@ -225,7 +226,7 @@ void LoginHandler::Observe(int type, DCHECK(type == chrome::NOTIFICATION_AUTH_SUPPLIED || type == chrome::NOTIFICATION_AUTH_CANCELLED); - TabContents* requesting_contents = GetTabContentsForLogin(); + WebContents* requesting_contents = GetWebContentsForLogin(); if (!requesting_contents) return; @@ -281,7 +282,7 @@ void LoginHandler::NotifyAuthNeeded() { content::NotificationService::current(); NavigationController* controller = NULL; - TabContents* requesting_contents = GetTabContentsForLogin(); + WebContents* requesting_contents = GetWebContentsForLogin(); if (requesting_contents) controller = &requesting_contents->GetController(); @@ -300,7 +301,7 @@ void LoginHandler::NotifyAuthCancelled() { content::NotificationService::current(); NavigationController* controller = NULL; - TabContents* requesting_contents = GetTabContentsForLogin(); + WebContents* requesting_contents = GetWebContentsForLogin(); if (requesting_contents) controller = &requesting_contents->GetController(); @@ -316,7 +317,7 @@ void LoginHandler::NotifyAuthSupplied(const string16& username, DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(WasAuthHandled()); - TabContents* requesting_contents = GetTabContentsForLogin(); + WebContents* requesting_contents = GetWebContentsForLogin(); if (!requesting_contents) return; @@ -438,7 +439,7 @@ void MakeInputForPasswordManager( void LoginDialogCallback(const GURL& request_url, net::AuthChallengeInfo* auth_info, LoginHandler* handler) { - TabContents* parent_contents = handler->GetTabContentsForLogin(); + WebContents* parent_contents = handler->GetWebContentsForLogin(); if (!parent_contents || handler->WasAuthHandled()) { // The request may have been cancelled, or it may be for a renderer // not hosted by a tab (e.g. an extension). Cancel just in case diff --git a/chrome/browser/ui/login/login_prompt.h b/chrome/browser/ui/login/login_prompt.h index 2aa1bb6..6bdc6ae 100644 --- a/chrome/browser/ui/login/login_prompt.h +++ b/chrome/browser/ui/login/login_prompt.h @@ -52,8 +52,8 @@ class LoginHandler : public ResourceDispatcherHostLoginDelegate, void SetPasswordForm(const webkit::forms::PasswordForm& form); void SetPasswordManager(PasswordManager* password_manager); - // Returns the TabContents that needs authentication. - TabContents* GetTabContentsForLogin() const; + // Returns the WebContents that needs authentication. + content::WebContents* GetWebContentsForLogin() const; // Returns the RenderViewHostDelegate for the page that needs authentication. RenderViewHostDelegate* GetRenderViewHostDelegate() const; diff --git a/chrome/browser/ui/login/login_prompt_gtk.cc b/chrome/browser/ui/login/login_prompt_gtk.cc index 753d74b..5e34e4f 100644 --- a/chrome/browser/ui/login/login_prompt_gtk.cc +++ b/chrome/browser/ui/login/login_prompt_gtk.cc @@ -16,8 +16,8 @@ #include "chrome/browser/ui/login/login_model.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "grit/generated_resources.h" #include "net/url_request/url_request.h" @@ -27,6 +27,7 @@ #include "ui/base/l10n/l10n_util.h" using content::BrowserThread; +using content::WebContents; using webkit::forms::PasswordForm; // ---------------------------------------------------------------------------- @@ -115,7 +116,7 @@ class LoginHandlerGtk : public LoginHandler, // control). However, that's OK since any UI interaction in those functions // will occur via an InvokeLater on the UI thread, which is guaranteed // to happen after this is called (since this was InvokeLater'd first). - TabContents* requesting_contents = GetTabContentsForLogin(); + WebContents* requesting_contents = GetWebContentsForLogin(); DCHECK(requesting_contents); TabContentsWrapper* wrapper = diff --git a/chrome/browser/ui/login/login_prompt_mac.mm b/chrome/browser/ui/login/login_prompt_mac.mm index b5c7947..31ea547 100644 --- a/chrome/browser/ui/login/login_prompt_mac.mm +++ b/chrome/browser/ui/login/login_prompt_mac.mm @@ -16,14 +16,15 @@ #include "chrome/browser/ui/login/login_model.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "net/url_request/url_request.h" #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" #include "ui/base/l10n/l10n_util.h" using content::BrowserThread; +using content::WebContents; using webkit::forms::PasswordForm; // ---------------------------------------------------------------------------- @@ -73,7 +74,7 @@ class LoginHandlerMac : public LoginHandler, // control). However, that's OK since any UI interaction in those functions // will occur via an InvokeLater on the UI thread, which is guaranteed // to happen after this is called (since this was InvokeLater'd first). - TabContents* requesting_contents = GetTabContentsForLogin(); + WebContents* requesting_contents = GetWebContentsForLogin(); DCHECK(requesting_contents); TabContentsWrapper* wrapper = diff --git a/chrome/browser/ui/login/login_prompt_ui.cc b/chrome/browser/ui/login/login_prompt_ui.cc index 95b2bf7..23333f2 100644 --- a/chrome/browser/ui/login/login_prompt_ui.cc +++ b/chrome/browser/ui/login/login_prompt_ui.cc @@ -19,7 +19,7 @@ #include "chrome/browser/ui/webui/html_dialog_ui.h" #include "chrome/common/jstemplate_builder.h" #include "chrome/common/url_constants.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui_message_handler.h" #include "grit/browser_resources.h" #include "grit/generated_resources.h" @@ -245,9 +245,9 @@ void LoginHandlerHtml::BuildViewForPasswordManager( PasswordManager* manager, const string16& explanation) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - TabContents* tab_contents = GetTabContentsForLogin(); + WebContents* web_contents = GetWebContentsForLogin(); TabContentsWrapper* wrapper = - TabContentsWrapper::GetCurrentWrapperForContents(tab_contents); + TabContentsWrapper::GetCurrentWrapperForContents(web_contents); Profile* profile = wrapper->profile(); LoginHandlerSource::RegisterDataSource(profile); delegate_ = new LoginHandlerHtmlDelegate(this, explanation); diff --git a/chrome/browser/ui/login/login_prompt_win.cc b/chrome/browser/ui/login/login_prompt_win.cc index 6286969..c21dac5 100644 --- a/chrome/browser/ui/login/login_prompt_win.cc +++ b/chrome/browser/ui/login/login_prompt_win.cc @@ -13,14 +13,15 @@ #include "chrome/browser/ui/views/login_view.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "net/url_request/url_request.h" #include "ui/base/l10n/l10n_util.h" #include "ui/views/window/dialog_delegate.h" using content::BrowserThread; +using content::WebContents; using webkit::forms::PasswordForm; // ---------------------------------------------------------------------------- @@ -59,7 +60,7 @@ class LoginHandlerWin : public LoginHandler, virtual void WindowClosing() OVERRIDE { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - TabContents* tab = GetTabContentsForLogin(); + WebContents* tab = GetWebContentsForLogin(); if (tab) tab->GetRenderViewHost()->set_ignore_input_events(false); @@ -126,7 +127,7 @@ class LoginHandlerWin : public LoginHandler, // control). However, that's OK since any UI interaction in those functions // will occur via an InvokeLater on the UI thread, which is guaranteed // to happen after this is called (since this was InvokeLater'd first). - TabContents* requesting_contents = GetTabContentsForLogin(); + WebContents* requesting_contents = GetWebContentsForLogin(); TabContentsWrapper* wrapper = TabContentsWrapper::GetCurrentWrapperForContents(requesting_contents); SetDialog(new ConstrainedWindowViews(wrapper, this)); diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc index e5429a3..ad43f58 100644 --- a/chrome/browser/ui/panels/panel.cc +++ b/chrome/browser/ui/panels/panel.cc @@ -17,10 +17,10 @@ #include "chrome/browser/web_applications/web_app.h" #include "chrome/common/extensions/extension.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" +#include "content/public/browser/web_contents.h" #include "ui/gfx/rect.h" #if defined(USE_AURA) diff --git a/chrome/browser/ui/panels/panel_browser_frame_view.cc b/chrome/browser/ui/panels/panel_browser_frame_view.cc index db24fe5..2034aee 100644 --- a/chrome/browser/ui/panels/panel_browser_frame_view.cc +++ b/chrome/browser/ui/panels/panel_browser_frame_view.cc @@ -14,7 +14,7 @@ #include "chrome/browser/ui/panels/panel_manager.h" #include "chrome/browser/ui/panels/panel_settings_menu_model.h" #include "chrome/common/extensions/extension.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" diff --git a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm index 6b24cc2..c1ed457 100644 --- a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm +++ b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm @@ -33,8 +33,8 @@ #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" #include "chrome/common/chrome_notification_types.h" #include "content/browser/renderer_host/render_widget_host_view.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_service.h" +#include "content/public/browser/web_contents.h" #include "grit/ui_resources.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" diff --git a/chrome/browser/ui/pdf/pdf_tab_observer.cc b/chrome/browser/ui/pdf/pdf_tab_observer.cc index fa91143..e416a53 100644 --- a/chrome/browser/ui/pdf/pdf_tab_observer.cc +++ b/chrome/browser/ui/pdf/pdf_tab_observer.cc @@ -7,10 +7,9 @@ #include "chrome/browser/ui/pdf/pdf_unsupported_feature.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/render_messages.h" -#include "content/browser/tab_contents/tab_contents.h" PDFTabObserver::PDFTabObserver(TabContentsWrapper* wrapper) - : content::WebContentsObserver(wrapper->tab_contents()), + : content::WebContentsObserver(wrapper->web_contents()), wrapper_(wrapper) { } diff --git a/chrome/browser/ui/sync/tab_contents_wrapper_synced_tab_delegate.cc b/chrome/browser/ui/sync/tab_contents_wrapper_synced_tab_delegate.cc index 70b8d5d..cc7c126 100644 --- a/chrome/browser/ui/sync/tab_contents_wrapper_synced_tab_delegate.cc +++ b/chrome/browser/ui/sync/tab_contents_wrapper_synced_tab_delegate.cc @@ -4,13 +4,13 @@ #include "chrome/browser/ui/sync/tab_contents_wrapper_synced_tab_delegate.h" -#include "content/browser/tab_contents/tab_contents.h" #include "chrome/browser/extensions/extension_tab_helper.h" #include "chrome/browser/sessions/restore_tab_helper.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/extensions/extension.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" +#include "content/public/browser/web_contents.h" using content::NavigationEntry; @@ -29,7 +29,7 @@ SessionID::id_type TabContentsWrapperSyncedTabDelegate::GetSessionId() const { } bool TabContentsWrapperSyncedTabDelegate::IsBeingDestroyed() const { - return tab_contents_wrapper_->tab_contents()->IsBeingDestroyed(); + return tab_contents_wrapper_->web_contents()->IsBeingDestroyed(); } Profile* TabContentsWrapperSyncedTabDelegate::profile() const { @@ -48,31 +48,31 @@ const std::string& TabContentsWrapperSyncedTabDelegate::GetExtensionAppId() } int TabContentsWrapperSyncedTabDelegate::GetCurrentEntryIndex() const { - return tab_contents_wrapper_->tab_contents()->GetController(). + return tab_contents_wrapper_->web_contents()->GetController(). GetCurrentEntryIndex(); } int TabContentsWrapperSyncedTabDelegate::GetEntryCount() const { - return tab_contents_wrapper_->tab_contents()->GetController().GetEntryCount(); + return tab_contents_wrapper_->web_contents()->GetController().GetEntryCount(); } int TabContentsWrapperSyncedTabDelegate::GetPendingEntryIndex() const { - return tab_contents_wrapper_->tab_contents()->GetController(). + return tab_contents_wrapper_->web_contents()->GetController(). GetPendingEntryIndex(); } NavigationEntry* TabContentsWrapperSyncedTabDelegate::GetPendingEntry() const { return - tab_contents_wrapper_->tab_contents()->GetController().GetPendingEntry(); + tab_contents_wrapper_->web_contents()->GetController().GetPendingEntry(); } NavigationEntry* TabContentsWrapperSyncedTabDelegate::GetEntryAtIndex(int i) const { return - tab_contents_wrapper_->tab_contents()->GetController().GetEntryAtIndex(i); + tab_contents_wrapper_->web_contents()->GetController().GetEntryAtIndex(i); } NavigationEntry* TabContentsWrapperSyncedTabDelegate::GetActiveEntry() const { return - tab_contents_wrapper_->tab_contents()->GetController().GetActiveEntry(); + tab_contents_wrapper_->web_contents()->GetController().GetActiveEntry(); } diff --git a/chrome/browser/ui/toolbar/toolbar_model.cc b/chrome/browser/ui/toolbar/toolbar_model.cc index cd5217b..87d9baa 100644 --- a/chrome/browser/ui/toolbar/toolbar_model.cc +++ b/chrome/browser/ui/toolbar/toolbar_model.cc @@ -15,11 +15,11 @@ #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/browser/cert_store.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/webui/web_ui.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/ssl_status.h" +#include "content/public/browser/web_contents.h" #include "content/public/common/content_constants.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc index 63875e5..34a8afa 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.cc +++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc @@ -33,11 +33,11 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/common/profiling.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" #include "content/public/browser/user_metrics.h" +#include "content/public/browser/web_contents.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/views/aura/app_list_window.cc b/chrome/browser/ui/views/aura/app_list_window.cc index 28cdda8..7bfcaa2 100644 --- a/chrome/browser/ui/views/aura/app_list_window.cc +++ b/chrome/browser/ui/views/aura/app_list_window.cc @@ -11,7 +11,7 @@ #include "chrome/common/url_constants.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host_view.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "ui/views/widget/widget.h" using content::WebContents; @@ -61,7 +61,7 @@ void AppListWindow::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { bool AppListWindow::TakeFocus(bool reverse) { // Forward the focus back to web contents. - contents_->dom_contents()->tab_contents()->FocusThroughTabTraversal(reverse); + contents_->dom_contents()->web_contents()->FocusThroughTabTraversal(reverse); return true; } @@ -96,7 +96,7 @@ void AppListWindow::Init(const gfx::Rect& bounds) { contents_ = new DOMView(); contents_->Init(ProfileManager::GetDefaultProfile(), NULL); - TabContents* tab = contents_->dom_contents()->tab_contents(); + WebContents* tab = contents_->dom_contents()->web_contents(); tab_watcher_.reset(new TabFirstRenderWatcher(tab, this)); tab->SetDelegate(this); diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc index 5aeb19b..df81afd 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc @@ -37,11 +37,11 @@ #include "chrome/common/pref_names.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host_view.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/page_navigator.h" #include "content/public/browser/user_metrics.h" +#include "content/public/browser/web_contents.h" #include "content/public/common/page_transition_types.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc index 188e939..be2963f 100644 --- a/chrome/browser/ui/views/browser_actions_container.cc +++ b/chrome/browser/ui/views/browser_actions_container.cc @@ -28,7 +28,6 @@ #include "chrome/common/pref_names.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host_view.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_source.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/views/collected_cookies_win.cc b/chrome/browser/ui/views/collected_cookies_win.cc index ec81dba..9f8031e 100644 --- a/chrome/browser/ui/views/collected_cookies_win.cc +++ b/chrome/browser/ui/views/collected_cookies_win.cc @@ -17,9 +17,9 @@ #include "chrome/browser/ui/views/cookie_info_view.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" @@ -494,7 +494,7 @@ void CollectedCookiesWin::AddContentException(views::TreeView* tree_view, // window, while NativeWidgetWin::SetBounds wants screen coordinates. Do the // translation here until http://crbug.com/52851 is fixed. POINT topleft = {bounds.x(), bounds.y()}; - MapWindowPoints(HWND_DESKTOP, wrapper_->tab_contents()->GetNativeView(), + MapWindowPoints(HWND_DESKTOP, wrapper_->web_contents()->GetNativeView(), &topleft, 1); gfx::Size size = GetWidget()->GetRootView()->GetPreferredSize(); bounds.SetRect(topleft.x, topleft.y, size.width(), size.height()); diff --git a/chrome/browser/ui/views/constrained_html_delegate_views.cc b/chrome/browser/ui/views/constrained_html_delegate_views.cc index 818ed3b..e3a9950 100644 --- a/chrome/browser/ui/views/constrained_html_delegate_views.cc +++ b/chrome/browser/ui/views/constrained_html_delegate_views.cc @@ -76,7 +76,7 @@ class ConstrainedHtmlDelegateViews : public TabContentsContainer, views::View* child) OVERRIDE { TabContentsContainer::ViewHierarchyChanged(is_add, parent, child); if (is_add && child == this) { - ChangeWebContents(html_tab_contents_->tab_contents()); + ChangeWebContents(html_tab_contents_->web_contents()); } } @@ -116,7 +116,7 @@ ConstrainedHtmlDelegateViews::ConstrainedHtmlDelegateViews( // Set |this| as a property so the ConstrainedHtmlUI can retrieve it. ConstrainedHtmlUI::GetPropertyAccessor().SetProperty( - html_tab_contents_->tab_contents()->GetPropertyBag(), this); + html_tab_contents_->web_contents()->GetPropertyBag(), this); tab_contents->GetController().LoadURL(delegate->GetDialogContentURL(), content::Referrer(), content::PAGE_TRANSITION_START_PAGE, diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc index 8522392..899cc02 100644 --- a/chrome/browser/ui/views/constrained_window_views.cc +++ b/chrome/browser/ui/views/constrained_window_views.cc @@ -17,8 +17,8 @@ #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_notification_types.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" +#include "content/public/browser/web_contents.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -557,7 +557,7 @@ ConstrainedWindowViews::ConstrainedWindowViews( params.delegate = widget_delegate; params.native_widget = native_constrained_window_->AsNativeWidget(); params.child = true; - params.parent = wrapper->tab_contents()->GetNativeView(); + params.parent = wrapper->web_contents()->GetNativeView(); Init(params); wrapper_->constrained_window_tab_helper()->AddConstrainedDialog(this); diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc index 3eddf90..34c4048 100644 --- a/chrome/browser/ui/views/content_setting_bubble_contents.cc +++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc @@ -18,7 +18,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" #include "chrome/browser/ui/views/browser_dialogs.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" #include "content/public/browser/plugin_service.h" diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc index a6c976c..e0e53f2 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.cc +++ b/chrome/browser/ui/views/create_application_shortcut_view.cc @@ -21,8 +21,8 @@ #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_resource.h" #include "chrome/common/pref_names.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/web_contents_delegate.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" @@ -436,8 +436,8 @@ bool CreateUrlApplicationShortcutView::Accept() { return false; tab_contents_->extension_tab_helper()->SetAppIcon(shortcut_info_.favicon); - if (tab_contents_->tab_contents()->GetDelegate()) { - tab_contents_->tab_contents()->GetDelegate()->ConvertContentsToApplication( + if (tab_contents_->web_contents()->GetDelegate()) { + tab_contents_->web_contents()->GetDelegate()->ConvertContentsToApplication( tab_contents_->web_contents()); } return true; diff --git a/chrome/browser/ui/views/dropdown_bar_host.h b/chrome/browser/ui/views/dropdown_bar_host.h index f6fdb6c..17c7aa0 100644 --- a/chrome/browser/ui/views/dropdown_bar_host.h +++ b/chrome/browser/ui/views/dropdown_bar_host.h @@ -18,7 +18,10 @@ class BrowserView; class DropdownBarHostDelegate; class DropdownBarView; -class TabContents; + +namespace content { +class WebContents; +} namespace ui { class SlideAnimation; @@ -145,7 +148,7 @@ class DropdownBarHost : public ui::AcceleratorTarget, // Returns a keyboard event suitable for forwarding. NativeWebKeyboardEvent GetKeyboardEvent( - const TabContents* contents, + const content::WebContents* contents, const views::KeyEvent& key_event); // Returns the animation for the dropdown. diff --git a/chrome/browser/ui/views/dropdown_bar_host_aura.cc b/chrome/browser/ui/views/dropdown_bar_host_aura.cc index 3c21a8e..28a24b5 100644 --- a/chrome/browser/ui/views/dropdown_bar_host_aura.cc +++ b/chrome/browser/ui/views/dropdown_bar_host_aura.cc @@ -8,8 +8,10 @@ #include "ui/aura/window.h" #include "ui/views/widget/widget.h" +using content::WebContents; + NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent( - const TabContents* contents, + const WebContents* contents, const views::KeyEvent& key_event) { return NativeWebKeyboardEvent(key_event.native_event()); } diff --git a/chrome/browser/ui/views/dropdown_bar_host_gtk.cc b/chrome/browser/ui/views/dropdown_bar_host_gtk.cc index bb47ea7..77a0887 100644 --- a/chrome/browser/ui/views/dropdown_bar_host_gtk.cc +++ b/chrome/browser/ui/views/dropdown_bar_host_gtk.cc @@ -7,10 +7,11 @@ #include <gdk/gdkkeysyms.h> #include "chrome/browser/ui/views/frame/browser_view.h" -#include "content/browser/tab_contents/tab_contents.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/widget/widget.h" +using content::WebContents; + void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos, bool no_redraw) { host_->SetBounds(new_pos); @@ -18,7 +19,7 @@ void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos, } NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent( - const TabContents* contents, + const WebContents* contents, const views::KeyEvent& key_event) { return NativeWebKeyboardEvent(key_event.gdk_event()); } diff --git a/chrome/browser/ui/views/dropdown_bar_host_win.cc b/chrome/browser/ui/views/dropdown_bar_host_win.cc index a74508c..0737d52 100644 --- a/chrome/browser/ui/views/dropdown_bar_host_win.cc +++ b/chrome/browser/ui/views/dropdown_bar_host_win.cc @@ -7,13 +7,15 @@ #include "chrome/browser/ui/find_bar/find_bar_controller.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" +#include "content/public/browser/web_contents.h" #include "ui/base/keycodes/keyboard_code_conversion_win.h" #include "ui/views/controls/scrollbar/native_scroll_bar.h" +using content::WebContents; + NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent( - const TabContents* contents, + const WebContents* contents, const views::KeyEvent& key_event) { HWND hwnd = contents->GetContentNativeView(); WORD key = WindowsKeyCodeForKeyboardCode(key_event.key_code()); diff --git a/chrome/browser/ui/views/extensions/extension_dialog.cc b/chrome/browser/ui/views/extensions/extension_dialog.cc index 00f3012..61d9b2e 100644 --- a/chrome/browser/ui/views/extensions/extension_dialog.cc +++ b/chrome/browser/ui/views/extensions/extension_dialog.cc @@ -21,6 +21,8 @@ #include "googleurl/src/gurl.h" #include "ui/views/widget/widget.h" +using content::WebContents; + ExtensionDialog::ExtensionDialog(ExtensionHost* host, ExtensionDialogObserver* observer) : window_(NULL), @@ -40,7 +42,7 @@ ExtensionDialog::~ExtensionDialog() { ExtensionDialog* ExtensionDialog::Show( const GURL& url, Browser* browser, - TabContents* tab_contents, + WebContents* web_contents, int width, int height, const string16& title, @@ -49,7 +51,7 @@ ExtensionDialog* ExtensionDialog::Show( ExtensionHost* host = CreateExtensionHost(url, browser); if (!host) return NULL; - host->set_associated_web_contents(tab_contents); + host->set_associated_web_contents(web_contents); ExtensionDialog* dialog = new ExtensionDialog(host, observer); dialog->set_title(title); diff --git a/chrome/browser/ui/views/extensions/extension_dialog.h b/chrome/browser/ui/views/extensions/extension_dialog.h index 8686e2a..dfef7fb7 100644 --- a/chrome/browser/ui/views/extensions/extension_dialog.h +++ b/chrome/browser/ui/views/extensions/extension_dialog.h @@ -15,7 +15,10 @@ class Browser; class ExtensionDialogObserver; class ExtensionHost; class GURL; -class TabContents; + +namespace content { +class WebContents; +} // Modal dialog containing contents provided by an extension. // Dialog is automatically centered in the browser window and has fixed size. @@ -28,10 +31,10 @@ class ExtensionDialog : public views::WidgetDelegate, // Create and show a dialog with |url| centered over the browser window. // |browser| is the browser to which the pop-up will be attached. - // |tab_contents| is the tab that spawned the dialog. + // |web_contents| is the tab that spawned the dialog. // |width| and |height| are the size of the dialog in pixels. static ExtensionDialog* Show(const GURL& url, Browser* browser, - TabContents* tab_contents, + content::WebContents* web_contents, int width, int height, const string16& title, diff --git a/chrome/browser/ui/views/external_protocol_dialog.cc b/chrome/browser/ui/views/external_protocol_dialog.cc index f363194..101d0a9 100644 --- a/chrome/browser/ui/views/external_protocol_dialog.cc +++ b/chrome/browser/ui/views/external_protocol_dialog.cc @@ -12,7 +12,7 @@ #include "base/win/registry.h" #include "chrome/browser/external_protocol/external_protocol_handler.h" #include "chrome/browser/tab_contents/tab_util.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -20,6 +20,8 @@ #include "ui/views/controls/message_box_view.h" #include "ui/views/widget/widget.h" +using content::WebContents; + namespace { const int kMessageWidth = 400; @@ -38,11 +40,11 @@ void ExternalProtocolHandler::RunExternalProtocolDialog( // ShellExecute won't do anything. Don't bother warning the user. return; } - TabContents* tab_contents = tab_util::GetTabContentsByID( + WebContents* web_contents = tab_util::GetWebContentsByID( render_process_host_id, routing_id); - DCHECK(tab_contents); + DCHECK(web_contents); // Windowing system takes ownership. - new ExternalProtocolDialog(tab_contents, url, command); + new ExternalProtocolDialog(web_contents, url, command); } /////////////////////////////////////////////////////////////////////////////// @@ -120,10 +122,10 @@ const views::Widget* ExternalProtocolDialog::GetWidget() const { /////////////////////////////////////////////////////////////////////////////// // ExternalProtocolDialog, private: -ExternalProtocolDialog::ExternalProtocolDialog(TabContents* tab_contents, +ExternalProtocolDialog::ExternalProtocolDialog(WebContents* web_contents, const GURL& url, const std::wstring& command) - : tab_contents_(tab_contents), + : web_contents_(web_contents), url_(url), creation_time_(base::TimeTicks::Now()) { const int kMaxUrlWithoutSchemeSize = 256; @@ -154,8 +156,8 @@ ExternalProtocolDialog::ExternalProtocolDialog(TabContents* tab_contents, l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT)); HWND root_hwnd; - if (tab_contents_) { - root_hwnd = GetAncestor(tab_contents_->GetContentNativeView(), GA_ROOT); + if (web_contents_) { + root_hwnd = GetAncestor(web_contents_->GetContentNativeView(), GA_ROOT); } else { // Dialog is top level if we don't have a tab_contents associated with us. root_hwnd = NULL; diff --git a/chrome/browser/ui/views/external_protocol_dialog.h b/chrome/browser/ui/views/external_protocol_dialog.h index 9929b2f..0608baa 100644 --- a/chrome/browser/ui/views/external_protocol_dialog.h +++ b/chrome/browser/ui/views/external_protocol_dialog.h @@ -12,7 +12,9 @@ #include "googleurl/src/gurl.h" #include "ui/views/window/dialog_delegate.h" -class TabContents; +namespace content { +class WebContents; +} namespace views { class MessageBoxView; @@ -21,7 +23,7 @@ class MessageBoxView; class ExternalProtocolDialog : public views::DialogDelegate { public: // RunExternalProtocolDialog calls this private constructor. - ExternalProtocolDialog(TabContents* tab_contents, + ExternalProtocolDialog(content::WebContents* web_contents, const GURL& url, const std::wstring& command); @@ -49,8 +51,8 @@ class ExternalProtocolDialog : public views::DialogDelegate { // The message box view whose commands we handle. views::MessageBoxView* message_box_view_; - // The associated TabContents. - TabContents* tab_contents_; + // The associated WebContents. + content::WebContents* web_contents_; // URL of the external protocol request. GURL url_; diff --git a/chrome/browser/ui/views/find_bar_host.cc b/chrome/browser/ui/views/find_bar_host.cc index 2324bf2..2320445 100644 --- a/chrome/browser/ui/views/find_bar_host.cc +++ b/chrome/browser/ui/views/find_bar_host.cc @@ -13,8 +13,8 @@ #include "chrome/browser/ui/views/find_bar_view.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" +#include "content/public/browser/web_contents.h" #include "ui/base/keycodes/keyboard_codes.h" #include "ui/views/focus/external_focus_tracker.h" #include "ui/views/focus/view_storage.h" @@ -70,12 +70,12 @@ bool FindBarHost::MaybeForwardKeyEventToWebpage( return false; RenderViewHost* render_view_host = - contents->tab_contents()->GetRenderViewHost(); + contents->web_contents()->GetRenderViewHost(); // Make sure we don't have a text field element interfering with keyboard // input. Otherwise Up and Down arrow key strokes get eaten. "Nom Nom Nom". render_view_host->ClearFocusedNode(); - NativeWebKeyboardEvent event = GetKeyboardEvent(contents->tab_contents(), + NativeWebKeyboardEvent event = GetKeyboardEvent(contents->web_contents(), key_event); render_view_host->ForwardKeyboardEvent(event); return true; @@ -158,7 +158,7 @@ bool FindBarHost::IsFindBarVisible() { void FindBarHost::RestoreSavedFocus() { if (focus_tracker() == NULL) { // TODO(brettw) Focus() should be on TabContentsView. - find_bar_controller_->tab_contents()->tab_contents()->Focus(); + find_bar_controller_->tab_contents()->web_contents()->Focus(); } else { focus_tracker()->FocusLastFocusedExternalView(); } @@ -325,7 +325,7 @@ void FindBarHost::UnregisterAccelerators() { void FindBarHost::GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect) { gfx::Rect frame_rect = host()->GetTopLevelWidget()->GetWindowScreenBounds(); TabContentsView* tab_view = - find_bar_controller_->tab_contents()->tab_contents()->GetView(); + find_bar_controller_->tab_contents()->web_contents()->GetView(); gfx::Rect webcontents_rect; tab_view->GetViewBounds(&webcontents_rect); avoid_overlapping_rect->Offset(0, webcontents_rect.y() - frame_rect.y()); diff --git a/chrome/browser/ui/views/find_bar_host_win.cc b/chrome/browser/ui/views/find_bar_host_win.cc index 5fb81c9..2e8b46b 100644 --- a/chrome/browser/ui/views/find_bar_host_win.cc +++ b/chrome/browser/ui/views/find_bar_host_win.cc @@ -8,7 +8,6 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" #include "ui/views/controls/scrollbar/native_scroll_bar.h" #include "ui/views/widget/widget.h" diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc index 819c01e..397a7de 100644 --- a/chrome/browser/ui/views/find_bar_view.cc +++ b/chrome/browser/ui/views/find_bar_view.cc @@ -18,7 +18,6 @@ #include "chrome/browser/ui/view_ids.h" #include "chrome/browser/ui/views/find_bar_host.h" #include "chrome/browser/ui/views/frame/browser_view.h" -#include "content/browser/tab_contents/tab_contents.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" diff --git a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc index 52e5361..239d880 100644 --- a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc @@ -8,7 +8,7 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/ui/views/frame/browser_frame.h" #include "chrome/browser/ui/views/frame/browser_view.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources_standard.h" diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 1d74f8e..b45a85a 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -925,7 +925,7 @@ void BrowserView::UpdateReloadStopState(bool is_loading, bool force) { void BrowserView::UpdateToolbar(TabContentsWrapper* contents, bool should_restore_state) { - toolbar_->Update(contents->tab_contents(), should_restore_state); + toolbar_->Update(contents->web_contents(), should_restore_state); } void BrowserView::FocusToolbar() { @@ -1319,7 +1319,7 @@ void BrowserView::Paste() { void BrowserView::ShowInstant(TabContentsWrapper* preview) { if (!preview_container_) preview_container_ = new TabContentsContainer(); - contents_->SetPreview(preview_container_, preview->tab_contents()); + contents_->SetPreview(preview_container_, preview->web_contents()); preview_container_->ChangeWebContents(preview->web_contents()); } @@ -1436,8 +1436,8 @@ void BrowserView::TabDeactivated(TabContentsWrapper* contents) { // We do not store the focus when closing the tab to work-around bug 4633. // Some reports seem to show that the focus manager and/or focused view can // be garbage at that point, it is not clear why. - if (!contents->tab_contents()->IsBeingDestroyed()) - contents->tab_contents()->GetView()->StoreFocus(); + if (!contents->web_contents()->IsBeingDestroyed()) + contents->web_contents()->GetView()->StoreFocus(); } void BrowserView::ActiveTabChanged(TabContentsWrapper* old_contents, @@ -1454,7 +1454,7 @@ void BrowserView::TabReplacedAt(TabStripModel* tab_strip_model, if (index != browser_->tabstrip_model()->active_index()) return; - if (contents_->preview_tab_contents() == new_contents->tab_contents()) { + if (contents_->preview_web_contents() == new_contents->web_contents()) { // If 'preview' is becoming active, swap the 'active' and 'preview' and // delete what was the active. contents_->MakePreviewContentsActiveContents(); @@ -2081,7 +2081,7 @@ bool BrowserView::MaybeShowBookmarkBar(TabContentsWrapper* contents) { browser_->bookmark_bar_state(), BookmarkBar::DONT_ANIMATE_STATE_CHANGE); } - bookmark_bar_view_->SetPageNavigator(contents->tab_contents()); + bookmark_bar_view_->SetPageNavigator(contents->web_contents()); new_bookmark_bar_view = bookmark_bar_view_.get(); } return UpdateChildViewAndLayout(new_bookmark_bar_view, &active_bookmark_bar_); @@ -2599,7 +2599,7 @@ void BrowserView::ProcessTabSelected(TabContentsWrapper* new_contents) { // the TabContents window. DCHECK(new_contents); bool change_tab_contents = - contents_container_->web_contents() != new_contents->tab_contents(); + contents_container_->web_contents() != new_contents->web_contents(); // Update various elements that are interested in knowing the current // TabContents. @@ -2625,12 +2625,12 @@ void BrowserView::ProcessTabSelected(TabContentsWrapper* new_contents) { // am striving for parity now rather than cleanliness. This is // required to make features like Duplicate Tab, Undo Close Tab, // etc not result in sad tab. - new_contents->tab_contents()->DidBecomeSelected(); + new_contents->web_contents()->DidBecomeSelected(); if (BrowserList::GetLastActive() == browser_ && !browser_->tabstrip_model()->closing_all() && GetWidget()->IsVisible()) { // We only restore focus if our window is visible, to avoid invoking blur // handlers when we are eventually shown. - new_contents->tab_contents()->GetView()->RestoreFocus(); + new_contents->web_contents()->GetView()->RestoreFocus(); } // Update all the UI bits. diff --git a/chrome/browser/ui/views/frame/contents_container.cc b/chrome/browser/ui/views/frame/contents_container.cc index e0a6724e..7b6981f 100644 --- a/chrome/browser/ui/views/frame/contents_container.cc +++ b/chrome/browser/ui/views/frame/contents_container.cc @@ -6,6 +6,8 @@ #include "base/logging.h" +using content::WebContents; + // static const char ContentsContainer::kViewClassName[] = "browser/ui/views/frame/ContentsContainer"; @@ -13,7 +15,7 @@ const char ContentsContainer::kViewClassName[] = ContentsContainer::ContentsContainer(views::View* active) : active_(active), preview_(NULL), - preview_tab_contents_(NULL), + preview_web_contents_(NULL), active_top_margin_(0) { AddChildView(active_); } @@ -26,19 +28,19 @@ void ContentsContainer::MakePreviewContentsActiveContents() { active_ = preview_; preview_ = NULL; - preview_tab_contents_ = NULL; + preview_web_contents_ = NULL; Layout(); } void ContentsContainer::SetPreview(views::View* preview, - TabContents* preview_tab_contents) { + WebContents* preview_web_contents) { if (preview == preview_) return; if (preview_) RemoveChildView(preview_); preview_ = preview; - preview_tab_contents_ = preview_tab_contents; + preview_web_contents_ = preview_web_contents; if (preview_) AddChildView(preview_); diff --git a/chrome/browser/ui/views/frame/contents_container.h b/chrome/browser/ui/views/frame/contents_container.h index f36882f..43b88e3 100644 --- a/chrome/browser/ui/views/frame/contents_container.h +++ b/chrome/browser/ui/views/frame/contents_container.h @@ -8,7 +8,9 @@ #include "ui/views/view.h" -class TabContents; +namespace content { +class WebContents; +} // ContentsContainer is responsible for managing the TabContents views. // ContentsContainer has up to two children: one for the currently active @@ -27,9 +29,12 @@ class ContentsContainer : public views::View { void MakePreviewContentsActiveContents(); // Sets the preview view. This does not delete the old. - void SetPreview(views::View* preview, TabContents* preview_tab_contents); + void SetPreview(views::View* preview, + content::WebContents* preview_web_contents); - TabContents* preview_tab_contents() const { return preview_tab_contents_; } + content::WebContents* preview_web_contents() const { + return preview_web_contents_; + } // Sets the active top margin. void SetActiveTopMargin(int margin); @@ -45,7 +50,7 @@ class ContentsContainer : public views::View { private: views::View* active_; views::View* preview_; - TabContents* preview_tab_contents_; + content::WebContents* preview_web_contents_; // The margin between the top and the active view. This is used to make the // preview overlap the bookmark bar on the new tab page. diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc index e65dc57..09637c1 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc @@ -20,8 +20,8 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_service.h" +#include "content/public/browser/web_contents.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/views/html_dialog_view.cc b/chrome/browser/ui/views/html_dialog_view.cc index 9e2270b..cf9bc8c 100644 --- a/chrome/browser/ui/views/html_dialog_view.cc +++ b/chrome/browser/ui/views/html_dialog_view.cc @@ -10,11 +10,11 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/views/window.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" +#include "content/public/browser/web_contents.h" #include "ui/base/keycodes/keyboard_codes.h" #include "ui/views/events/event.h" #include "ui/views/widget/root_view.h" @@ -252,14 +252,14 @@ void HtmlDialogView::InitDialog() { // Now Init the DOMView. This view runs in its own process to render the html. DOMView::Init(profile(), NULL); - TabContents* tab_contents = dom_contents_->tab_contents(); - tab_contents->SetDelegate(this); + WebContents* web_contents = dom_contents_->web_contents(); + web_contents->SetDelegate(this); // Set the delegate. This must be done before loading the page. See // the comment above HtmlDialogUI in its header file for why. HtmlDialogUI::GetPropertyAccessor().SetProperty( - tab_contents->GetPropertyBag(), this); - tab_watcher_.reset(new TabFirstRenderWatcher(tab_contents, this)); + web_contents->GetPropertyBag(), this); + tab_watcher_.reset(new TabFirstRenderWatcher(web_contents, this)); DOMView::LoadURL(GetDialogContentURL()); } diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc index 42df19f..d2356a4 100644 --- a/chrome/browser/ui/views/hung_renderer_view.cc +++ b/chrome/browser/ui/views/hung_renderer_view.cc @@ -14,8 +14,8 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/logging_chrome.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/render_process_host.h" +#include "content/public/browser/web_contents.h" #include "content/public/common/result_codes.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc b/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc index a32d725..a1fcac6 100644 --- a/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc +++ b/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc @@ -12,7 +12,6 @@ #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/keyboard_overlay_delegate.h" #include "chrome/browser/ui/views/window.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/native_web_keyboard_event.h" #include "grit/generated_resources.h" #include "ui/base/keycodes/keyboard_codes.h" diff --git a/chrome/browser/ui/views/location_bar/click_handler.cc b/chrome/browser/ui/views/location_bar/click_handler.cc index 4c69b7f..0e3f7ca 100644 --- a/chrome/browser/ui/views/location_bar/click_handler.cc +++ b/chrome/browser/ui/views/location_bar/click_handler.cc @@ -6,12 +6,13 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" +#include "content/public/browser/web_contents.h" #include "ui/views/view.h" using content::NavigationEntry; +using content::WebContents; ClickHandler::ClickHandler(const views::View* owner, LocationBarView* location_bar) @@ -28,7 +29,7 @@ void ClickHandler::OnMouseReleased(const views::MouseEvent& event) { if (location_bar_->location_entry()->IsEditingOrEmpty()) return; - TabContents* tab = location_bar_->GetTabContentsWrapper()->tab_contents(); + WebContents* tab = location_bar_->GetTabContentsWrapper()->web_contents(); NavigationEntry* nav_entry = tab->GetController().GetActiveEntry(); if (!nav_entry) { NOTREACHED(); diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc index a4e72f1..db1aed1 100644 --- a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc +++ b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc @@ -13,7 +13,7 @@ #include "chrome/browser/ui/views/content_setting_bubble_contents.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/window.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "third_party/skia/include/core/SkShader.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" @@ -139,7 +139,7 @@ void ContentSettingImageView::OnMouseReleased(const views::MouseEvent& event) { profile, content_setting_image_model_->get_content_settings_type()), profile, - tab_contents->tab_contents(), + tab_contents->web_contents(), this, views::BubbleBorder::TOP_RIGHT); browser::CreateViewsBubble(bubble); diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index a916884..297c50d 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc @@ -43,8 +43,8 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "content/browser/renderer_host/render_widget_host_view.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_service.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" @@ -1080,8 +1080,8 @@ void LocationBarView::WriteDragDataForView(views::View* sender, TabContentsWrapper* tab_contents = delegate_->GetTabContentsWrapper(); DCHECK(tab_contents); drag_utils::SetURLAndDragImage( - tab_contents->tab_contents()->GetURL(), - tab_contents->tab_contents()->GetTitle(), + tab_contents->web_contents()->GetURL(), + tab_contents->web_contents()->GetTitle(), tab_contents->favicon_tab_helper()->GetFavicon(), data); } diff --git a/chrome/browser/ui/views/notifications/balloon_view.cc b/chrome/browser/ui/views/notifications/balloon_view.cc index 0e369b5..717746e 100644 --- a/chrome/browser/ui/views/notifications/balloon_view.cc +++ b/chrome/browser/ui/views/notifications/balloon_view.cc @@ -19,10 +19,10 @@ #include "chrome/common/chrome_notification_types.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host_view.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc index b4fe1dc4..b0f6ac2 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc @@ -4,6 +4,7 @@ #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" +#include "base/property_bag.h" #include "base/logging.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" @@ -17,7 +18,7 @@ #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/common/chrome_notification_types.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "googleurl/src/gurl.h" #include "grit/app_locale_settings.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc index 48e99b3..ead6933 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc @@ -16,6 +16,7 @@ #include "base/i18n/rtl.h" #include "base/lazy_instance.h" #include "base/memory/ref_counted.h" +#include "base/property_bag.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "base/win/iat_patch_function.h" @@ -31,8 +32,8 @@ #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" #include "chrome/common/chrome_notification_types.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/user_metrics.h" +#include "content/public/browser/web_contents.h" #include "googleurl/src/url_util.h" #include "grit/generated_resources.h" #include "net/base/escape.h" diff --git a/chrome/browser/ui/views/select_file_dialog_extension.cc b/chrome/browser/ui/views/select_file_dialog_extension.cc index b204124..9b58a16 100644 --- a/chrome/browser/ui/views/select_file_dialog_extension.cc +++ b/chrome/browser/ui/views/select_file_dialog_extension.cc @@ -17,7 +17,6 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/views/extensions/extension_dialog.h" #include "chrome/browser/ui/views/window.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" using content::BrowserThread; @@ -244,7 +243,7 @@ void SelectFileDialogExtension::SelectFileImpl( default_extension); ExtensionDialog* dialog = ExtensionDialog::Show(file_browser_url, - owner_browser, tab->tab_contents(), + owner_browser, tab->web_contents(), kFileManagerWidth, kFileManagerHeight, string16(), this /* ExtensionDialog::Observer */); if (!dialog) { diff --git a/chrome/browser/ui/views/ssl_client_certificate_selector.cc b/chrome/browser/ui/views/ssl_client_certificate_selector.cc index 3beacb4..d84fdfe 100644 --- a/chrome/browser/ui/views/ssl_client_certificate_selector.cc +++ b/chrome/browser/ui/views/ssl_client_certificate_selector.cc @@ -11,8 +11,9 @@ #include "chrome/browser/certificate_viewer.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/views/constrained_window_views.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/tab_contents/tab_contents_view.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "net/base/x509_certificate.h" #include "ui/base/l10n/l10n_util.h" @@ -228,8 +229,9 @@ void SSLClientCertificateSelector::ButtonPressed( if (sender == view_cert_button_) { net::X509Certificate* cert = GetSelectedCert(); if (cert) - ShowCertificateViewer(wrapper_->tab_contents()->GetDialogRootWindow(), - cert); + ShowCertificateViewer( + wrapper_->web_contents()->GetView()->GetTopLevelNativeWindow(), + cert); } } diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_aura.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_aura.cc index e0d9efd..782bcde 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_aura.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_aura.cc @@ -8,7 +8,7 @@ #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" #include "content/browser/tab_contents/interstitial_page.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "ui/aura/window.h" #include "ui/base/accessibility/accessible_view_state.h" #include "ui/views/focus/focus_manager.h" diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc index 2424d28..f7fe97b 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc @@ -9,7 +9,7 @@ #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" #include "content/browser/renderer_host/render_widget_host_view.h" #include "content/browser/tab_contents/interstitial_page.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "ui/base/accessibility/accessible_view_state.h" #include "ui/views/focus/focus_manager.h" diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_win.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_win.cc index b738795..ed950a7 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_win.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_win.cc @@ -9,7 +9,7 @@ #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" #include "content/browser/renderer_host/render_widget_host_view_win.h" #include "content/browser/tab_contents/interstitial_page.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "ui/base/accessibility/accessible_view_state.h" #include "ui/views/focus/focus_manager.h" #include "ui/views/focus/widget_focus_manager.h" diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc index 1809774..7a97857 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc @@ -9,8 +9,8 @@ #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host_view_aura.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" +#include "content/public/browser/web_contents.h" #include "ui/aura/client/drag_drop_client.h" #include "ui/aura/client/drag_drop_delegate.h" #include "ui/aura/root_window.h" diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc index 0f7f585..7e5e611 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc @@ -9,10 +9,10 @@ #include "chrome/browser/tab_contents/web_drag_bookmark_handler_gtk.h" #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate.h" #include "content/browser/renderer_host/render_widget_host_view_gtk.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" #include "content/browser/tab_contents/web_drag_dest_gtk.h" #include "content/browser/tab_contents/web_drag_source_gtk.h" +#include "content/public/browser/web_contents.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc index 68ef095..699f31e 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc @@ -8,8 +8,8 @@ #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate.h" #include "chrome/browser/ui/views/tab_contents/tab_contents_drag_win.h" #include "content/browser/renderer_host/render_widget_host_view_win.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" +#include "content/public/browser/web_contents.h" #include "ui/views/views_delegate.h" #include "ui/views/widget/widget.h" diff --git a/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc b/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc index ad7e585..de2d6d6 100644 --- a/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc +++ b/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc @@ -9,8 +9,8 @@ #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" #include "content/browser/renderer_host/render_widget_host_view.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "ui/base/accelerators/accelerator.h" #include "ui/base/keycodes/keyboard_codes.h" diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_container.cc b/chrome/browser/ui/views/tab_contents/tab_contents_container.cc index eb143f9..be7e5de1 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_container.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_container.cc @@ -7,12 +7,13 @@ #include "chrome/browser/ui/view_ids.h" #include "chrome/browser/ui/views/tab_contents/native_tab_contents_container.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/renderer_host/render_widget_host_view.h" +#include "content/browser/tab_contents/render_view_host_manager.h" #include "content/browser/tab_contents/interstitial_page.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/browser/renderer_host/render_widget_host_view.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" +#include "content/public/browser/web_contents.h" #include "ui/base/accessibility/accessible_view_state.h" using content::NavigationController; diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc b/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc index b6122ad..a104b37 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc @@ -23,9 +23,9 @@ #include "chrome/common/url_constants.h" #include "content/browser/download/drag_download_file.h" #include "content/browser/download/drag_download_util.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/content_browser_client.h" +#include "content/public/browser/web_contents.h" #include "net/base/net_util.h" #include "ui/views/drag_utils.h" #include "webkit/glue/webdropdata.h" diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc index 25c1975..4541173 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc @@ -16,8 +16,8 @@ #include "content/browser/renderer_host/render_view_host_factory.h" #include "content/browser/renderer_host/render_widget_host_view.h" #include "content/browser/tab_contents/interstitial_page.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/render_process_host.h" +#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "ui/gfx/screen.h" #include "ui/views/focus/focus_manager.h" diff --git a/chrome/browser/ui/views/tab_modal_confirm_dialog_views.cc b/chrome/browser/ui/views/tab_modal_confirm_dialog_views.cc index 9193527..82a7c0b 100644 --- a/chrome/browser/ui/views/tab_modal_confirm_dialog_views.cc +++ b/chrome/browser/ui/views/tab_modal_confirm_dialog_views.cc @@ -11,7 +11,6 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" #include "chrome/browser/ui/views/constrained_window_views.h" -#include "content/browser/tab_contents/tab_contents.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" #include "ui/views/controls/message_box_view.h" diff --git a/chrome/browser/ui/views/tabs/base_tab.cc b/chrome/browser/ui/views/tabs/base_tab.cc index 7a61bc8..628faa6 100644 --- a/chrome/browser/ui/views/tabs/base_tab.cc +++ b/chrome/browser/ui/views/tabs/base_tab.cc @@ -14,7 +14,6 @@ #include "chrome/browser/ui/view_ids.h" #include "chrome/browser/ui/views/tabs/tab_controller.h" #include "chrome/common/chrome_switches.h" -#include "content/browser/tab_contents/tab_contents.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc index 203623c..8b5d4c8 100644 --- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc @@ -19,18 +19,19 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/url_constants.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/user_metrics.h" +#include "content/public/browser/web_contents.h" #include "ui/views/controls/menu/menu_item_view.h" #include "ui/views/controls/menu/menu_model_adapter.h" #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/widget/widget.h" using content::UserMetricsAction; +using content::WebContents; static TabRendererData::NetworkState TabContentsNetworkState( - TabContents* contents) { + WebContents* contents) { if (!contents || !contents->IsLoading()) return TabRendererData::NETWORK_STATE_NONE; if (contents->IsWaitingForResponse()) @@ -212,7 +213,7 @@ bool BrowserTabStripController::IsTabCloseable(int model_index) const { bool BrowserTabStripController::IsNewTabPage(int model_index) const { return model_->ContainsIndex(model_index) && - model_->GetTabContentsAt(model_index)->tab_contents()->GetURL() == + model_->GetTabContentsAt(model_index)->web_contents()->GetURL() == GURL(chrome::kChromeUINewTabURL); } @@ -259,7 +260,7 @@ void BrowserTabStripController::UpdateLoadingAnimations() { if (model_->ContainsIndex(model_index)) { TabContentsWrapper* contents = model_->GetTabContentsAt(model_index); tab->UpdateLoadingAnimation( - TabContentsNetworkState(contents->tab_contents())); + TabContentsNetworkState(contents->web_contents())); } } } @@ -328,7 +329,7 @@ void BrowserTabStripController::TabInsertedAt(TabContentsWrapper* contents, hover_tab_selector_.CancelTabTransition(); TabRendererData data; - SetTabRendererDataFromModel(contents->tab_contents(), model_index, &data, + SetTabRendererDataFromModel(contents->web_contents(), model_index, &data, NEW_TAB); tabstrip_->AddTabAt(model_index, data); } @@ -355,7 +356,7 @@ void BrowserTabStripController::TabMoved(TabContentsWrapper* contents, // Update the data first as the pinned state may have changed. TabRendererData data; - SetTabRendererDataFromModel(contents->tab_contents(), to_model_index, &data, + SetTabRendererDataFromModel(contents->web_contents(), to_model_index, &data, EXISTING_TAB); tabstrip_->SetTabData(from_model_index, data); @@ -416,7 +417,7 @@ void BrowserTabStripController::Observe(int type, } void BrowserTabStripController::SetTabRendererDataFromModel( - TabContents* contents, + WebContents* contents, int model_index, TabRendererData* data, TabStatus tab_status) { @@ -449,7 +450,7 @@ void BrowserTabStripController::SetTabDataAt( TabContentsWrapper* contents, int model_index) { TabRendererData data; - SetTabRendererDataFromModel(contents->tab_contents(), model_index, &data, + SetTabRendererDataFromModel(contents->web_contents(), model_index, &data, EXISTING_TAB); tabstrip_->SetTabData(model_index, data); } diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h index bdc28a1..6d1d31b 100644 --- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h +++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h @@ -18,9 +18,12 @@ class BaseTab; class Browser; class TabStrip; class TabStripSelectionModel; - struct TabRendererData; +namespace content { +class WebContents; +} + // An implementation of TabStripController that sources data from the // TabContentsWrappers in a TabStripModel. class BrowserTabStripController : public TabStripController, @@ -105,7 +108,7 @@ class BrowserTabStripController : public TabStripController, }; // Sets the TabRendererData from the TabStripModel. - virtual void SetTabRendererDataFromModel(TabContents* contents, + virtual void SetTabRendererDataFromModel(content::WebContents* contents, int model_index, TabRendererData* data, TabStatus tab_status); diff --git a/chrome/browser/ui/views/tabs/native_view_photobooth_win.cc b/chrome/browser/ui/views/tabs/native_view_photobooth_win.cc index 25d603c..71e3c41 100644 --- a/chrome/browser/ui/views/tabs/native_view_photobooth_win.cc +++ b/chrome/browser/ui/views/tabs/native_view_photobooth_win.cc @@ -4,7 +4,6 @@ #include "chrome/browser/ui/views/tabs/native_view_photobooth_win.h" -#include "content/browser/tab_contents/tab_contents.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/gfx/canvas_skia.h" #include "ui/gfx/point.h" diff --git a/chrome/browser/ui/views/web_intent_picker_view.cc b/chrome/browser/ui/views/web_intent_picker_view.cc index 75c3ffe..9186ac2 100644 --- a/chrome/browser/ui/views/web_intent_picker_view.cc +++ b/chrome/browser/ui/views/web_intent_picker_view.cc @@ -28,6 +28,8 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" +using content::WebContents; + namespace { // The space in pixels between the top-level groups in the dialog. @@ -102,7 +104,7 @@ class WebIntentPickerView : public views::BubbleDelegateView, virtual void SetServiceIcon(size_t index, const SkBitmap& icon) OVERRIDE; virtual void SetDefaultServiceIcon(size_t index) OVERRIDE; virtual void Close() OVERRIDE; - virtual TabContents* SetInlineDisposition(const GURL& url) OVERRIDE; + virtual content::WebContents* SetInlineDisposition(const GURL& url) OVERRIDE; protected: // views::BubbleDelegateView overrides: @@ -211,7 +213,7 @@ void WebIntentPickerView::Close() { GetWidget()->Close(); } -TabContents* WebIntentPickerView::SetInlineDisposition(const GURL& url) { +WebContents* WebIntentPickerView::SetInlineDisposition(const GURL& url) { // TODO(gbillock): add support here. return NULL; } diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc index c5864af..74a7631 100644 --- a/chrome/browser/ui/views/wrench_menu.cc +++ b/chrome/browser/ui/views/wrench_menu.cc @@ -17,12 +17,12 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h" #include "chrome/common/chrome_notification_types.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" #include "content/public/browser/user_metrics.h" +#include "content/public/browser/web_contents.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/web_applications/web_app_ui.cc b/chrome/browser/ui/web_applications/web_app_ui.cc index 024a181..f3f36a2 100644 --- a/chrome/browser/ui/web_applications/web_app_ui.cc +++ b/chrome/browser/ui/web_applications/web_app_ui.cc @@ -16,12 +16,12 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/web_applications/web_app.h" #include "chrome/common/chrome_paths.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" +#include "content/public/browser/web_contents.h" #if defined(OS_POSIX) && !defined(OS_MACOSX) #include "base/environment.h" @@ -29,6 +29,7 @@ using content::BrowserThread; using content::NavigationController; +using content::WebContents; namespace { @@ -296,16 +297,16 @@ namespace web_app { void GetShortcutInfoForTab(TabContentsWrapper* tab_contents_wrapper, ShellIntegration::ShortcutInfo* info) { DCHECK(info); // Must provide a valid info. - const TabContents* tab_contents = tab_contents_wrapper->tab_contents(); + const WebContents* web_contents = tab_contents_wrapper->web_contents(); const WebApplicationInfo& app_info = tab_contents_wrapper->extension_tab_helper()->web_app_info(); - info->url = app_info.app_url.is_empty() ? tab_contents->GetURL() : + info->url = app_info.app_url.is_empty() ? web_contents->GetURL() : app_info.app_url; info->title = app_info.title.empty() ? - (tab_contents->GetTitle().empty() ? UTF8ToUTF16(info->url.spec()) : - tab_contents->GetTitle()) : + (web_contents->GetTitle().empty() ? UTF8ToUTF16(info->url.spec()) : + web_contents->GetTitle()) : app_info.title; info->description = app_info.description; info->favicon = tab_contents_wrapper->favicon_tab_helper()->GetFavicon(); diff --git a/chrome/browser/ui/webui/bookmark_all_tabs_dialog.cc b/chrome/browser/ui/webui/bookmark_all_tabs_dialog.cc index b0da874..d5af999 100644 --- a/chrome/browser/ui/webui/bookmark_all_tabs_dialog.cc +++ b/chrome/browser/ui/webui/bookmark_all_tabs_dialog.cc @@ -78,7 +78,7 @@ void BookmarkAllTabsDialogBuilder::Show() { ExtensionDialog* dialog = ExtensionDialog::Show( url, - browser, tab->tab_contents(), + browser, tab->web_contents(), kDialogWidth, kDialogHeight, title, this ); diff --git a/content/browser/intents/intent_injector.cc b/content/browser/intents/intent_injector.cc index 439ec19..65daff0 100644 --- a/content/browser/intents/intent_injector.cc +++ b/content/browser/intents/intent_injector.cc @@ -17,10 +17,10 @@ using content::WebContents; -IntentInjector::IntentInjector(TabContents* tab_contents) - : content::WebContentsObserver(tab_contents), +IntentInjector::IntentInjector(WebContents* web_contents) + : content::WebContentsObserver(web_contents), intents_dispatcher_(NULL) { - DCHECK(tab_contents); + DCHECK(web_contents); } IntentInjector::~IntentInjector() { diff --git a/content/browser/intents/intent_injector.h b/content/browser/intents/intent_injector.h index 8fc5833..e5e9896 100644 --- a/content/browser/intents/intent_injector.h +++ b/content/browser/intents/intent_injector.h @@ -28,8 +28,8 @@ struct WebIntentData; // when that TabContents is closed. class CONTENT_EXPORT IntentInjector : public content::WebContentsObserver { public: - // |tab_contents| must not be NULL. - explicit IntentInjector(TabContents* tab_contents); + // |web_contents| must not be NULL. + explicit IntentInjector(content::WebContents* web_contents); virtual ~IntentInjector(); // content::WebContentsObserver implementation. diff --git a/content/browser/intents/web_intents_dispatcher_impl.cc b/content/browser/intents/web_intents_dispatcher_impl.cc index 989cc3e..35b2c4c 100644 --- a/content/browser/intents/web_intents_dispatcher_impl.cc +++ b/content/browser/intents/web_intents_dispatcher_impl.cc @@ -27,7 +27,7 @@ const webkit_glue::WebIntentData& WebIntentsDispatcherImpl::GetIntent() { return intent_; } -void WebIntentsDispatcherImpl::DispatchIntent(TabContents* destination_tab) { +void WebIntentsDispatcherImpl::DispatchIntent(WebContents* destination_tab) { DCHECK(!intent_injector_); intent_injector_ = new IntentInjector(destination_tab); intent_injector_->SetIntent(this, intent_); diff --git a/content/browser/intents/web_intents_dispatcher_impl.h b/content/browser/intents/web_intents_dispatcher_impl.h index 321c65e..bfd4655 100644 --- a/content/browser/intents/web_intents_dispatcher_impl.h +++ b/content/browser/intents/web_intents_dispatcher_impl.h @@ -32,7 +32,7 @@ class WebIntentsDispatcherImpl : public content::WebIntentsDispatcher, // WebIntentsDispatcher implementation. virtual const webkit_glue::WebIntentData& GetIntent() OVERRIDE; - virtual void DispatchIntent(TabContents* destination_tab) OVERRIDE; + virtual void DispatchIntent(content::WebContents* destination_tab) OVERRIDE; virtual void SendReplyMessage(webkit_glue::WebIntentReplyType reply_type, const string16& data) OVERRIDE; virtual void RegisterReplyNotification(const base::Closure& closure) OVERRIDE; diff --git a/content/public/browser/web_intents_dispatcher.h b/content/public/browser/web_intents_dispatcher.h index 5e0a540..33b10e7 100644 --- a/content/public/browser/web_intents_dispatcher.h +++ b/content/public/browser/web_intents_dispatcher.h @@ -8,16 +8,16 @@ #include "base/callback.h" #include "webkit/glue/web_intent_reply_data.h" -class TabContents; - namespace webkit_glue { struct WebIntentData; } namespace content { +class WebContents; + // This class is the coordinator for dispatching web intents and seeing that -// return messages are sent to the correct invoking context. The TabContents +// return messages are sent to the correct invoking context. TheWebContents // for the invoking context will create one of these for each intent and hand // ownership to the client WebContentsDelegate code. The WebContentsDelegate // code can then read the intent data, create UI to pick the service, and @@ -31,7 +31,7 @@ class CONTENT_EXPORT WebIntentsDispatcher { virtual const webkit_glue::WebIntentData& GetIntent() = 0; // Attach the intent to a new context in which the service is loaded. - virtual void DispatchIntent(TabContents* tab_contents) = 0; + virtual void DispatchIntent(WebContents* web_contents) = 0; // Return a success or failure message to the source context which invoked // the intent. |