summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/interstitial_page.cc8
-rw-r--r--chrome/browser/tab_contents/interstitial_page.h14
-rw-r--r--chrome/browser/tab_contents/navigation_controller.cc2
-rw-r--r--chrome/browser/tab_contents/navigation_controller.h6
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc94
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.h6
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu_gtk.cc2
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu_gtk.h2
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu_mac.h2
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu_mac.mm2
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu_win.cc4
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu_win.h2
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.cc18
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.h8
-rw-r--r--chrome/browser/tab_contents/render_view_host_manager.h16
-rw-r--r--chrome/browser/tab_contents/render_view_host_manager_unittest.cc2
-rw-r--r--chrome/browser/tab_contents/site_instance.h6
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc75
-rw-r--r--chrome/browser/tab_contents/tab_contents.h39
-rw-r--r--chrome/browser/tab_contents/tab_contents_delegate.h2
-rw-r--r--chrome/browser/tab_contents/tab_contents_view.cc22
-rw-r--r--chrome/browser/tab_contents/tab_contents_view.h24
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_gtk.cc44
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_gtk.h4
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_mac.h4
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_mac.mm52
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_win.cc76
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_win.h8
-rw-r--r--chrome/browser/tab_contents/tab_util.cc6
-rw-r--r--chrome/browser/tab_contents/tab_util.h6
-rw-r--r--chrome/browser/tab_contents/test_web_contents.cc6
-rw-r--r--chrome/browser/tab_contents/test_web_contents.h16
-rw-r--r--chrome/browser/tab_contents/web_contents.cc46
-rw-r--r--chrome/browser/tab_contents/web_contents.h30
-rw-r--r--chrome/browser/tab_contents/web_contents_unittest.cc68
-rw-r--r--chrome/browser/tab_contents/web_drag_source.h2
-rw-r--r--chrome/browser/tab_contents/web_drop_target.cc42
-rw-r--r--chrome/browser/tab_contents/web_drop_target.h14
38 files changed, 343 insertions, 437 deletions
diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc
index ca9be04..9384988 100644
--- a/chrome/browser/tab_contents/interstitial_page.cc
+++ b/chrome/browser/tab_contents/interstitial_page.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
-#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
#include "chrome/common/notification_service.h"
#include "chrome/views/window/window_delegate.h"
@@ -100,7 +100,7 @@ class InterstitialPage::InterstitialPageRVHViewDelegate
InterstitialPage::InterstitialPageMap*
InterstitialPage::tab_to_interstitial_page_ = NULL;
-InterstitialPage::InterstitialPage(WebContents* tab,
+InterstitialPage::InterstitialPage(TabContents* tab,
bool new_navigation,
const GURL& url)
: tab_(tab),
@@ -446,10 +446,10 @@ void InterstitialPage::InitInterstitialPageMap() {
// static
InterstitialPage* InterstitialPage::GetInterstitialPage(
- WebContents* web_contents) {
+ TabContents* tab_contents) {
InitInterstitialPageMap();
InterstitialPageMap::const_iterator iter =
- tab_to_interstitial_page_->find(web_contents);
+ tab_to_interstitial_page_->find(tab_contents);
if (iter == tab_to_interstitial_page_->end())
return NULL;
diff --git a/chrome/browser/tab_contents/interstitial_page.h b/chrome/browser/tab_contents/interstitial_page.h
index 1e35ea4..40cf6a1 100644
--- a/chrome/browser/tab_contents/interstitial_page.h
+++ b/chrome/browser/tab_contents/interstitial_page.h
@@ -15,7 +15,7 @@
class MessageLoop;
class NavigationEntry;
-class WebContents;
+class TabContents;
class TabContentsView;
// This class is a base class for interstitial pages, pages that show some
@@ -27,7 +27,7 @@ class TabContentsView;
// that when the interstitial shows, the current entry is the target URL.
//
// InterstitialPage instances take care of deleting themselves when closed
-// through a navigation, the WebContents closing them or the tab containing them
+// through a navigation, the TabContents closing them or the tab containing them
// being closed.
enum ResourceRequestAction {
@@ -45,7 +45,7 @@ class InterstitialPage : public NotificationObserver,
// added to the navigation controller (so the interstitial page appears as a
// new navigation entry). |new_navigation| should be false when the
// interstitial was triggered by a loading a sub-resource in a page.
- InterstitialPage(WebContents* tab, bool new_navigation, const GURL& url);
+ InterstitialPage(TabContents* tab, bool new_navigation, const GURL& url);
virtual ~InterstitialPage();
// Shows the interstitial page in the tab.
@@ -56,7 +56,7 @@ class InterstitialPage : public NotificationObserver,
// Retrieves the InterstitialPage if any associated with the specified
// |tab_contents| (used by ui tests).
- static InterstitialPage* GetInterstitialPage(WebContents* web_contents);
+ static InterstitialPage* GetInterstitialPage(TabContents* tab_contents);
// Sub-classes should return the HTML that should be displayed in the page.
virtual std::string GetHTMLContents() { return std::string(); }
@@ -108,7 +108,7 @@ class InterstitialPage : public NotificationObserver,
// |create_navigation_entry| set to true.
virtual void UpdateEntry(NavigationEntry* entry) { }
- WebContents* tab() const { return tab_; }
+ TabContents* tab() const { return tab_; }
const GURL& url() const { return url_; }
RenderViewHost* render_view_host() const { return render_view_host_; }
@@ -142,7 +142,7 @@ class InterstitialPage : public NotificationObserver,
void TakeActionOnResourceDispatcher(ResourceRequestAction action);
// The tab in which we are displayed.
- WebContents* tab_;
+ TabContents* tab_;
// The URL that is shown when the interstitial is showing.
GURL url_;
@@ -192,7 +192,7 @@ class InterstitialPage : public NotificationObserver,
// We keep a map of the various blocking pages shown as the UI tests need to
// be able to retrieve them.
- typedef std::map<WebContents*,InterstitialPage*> InterstitialPageMap;
+ typedef std::map<TabContents*,InterstitialPage*> InterstitialPageMap;
static InterstitialPageMap* tab_to_interstitial_page_;
DISALLOW_COPY_AND_ASSIGN(InterstitialPage);
diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc
index d8aca75..30dabe3 100644
--- a/chrome/browser/tab_contents/navigation_controller.cc
+++ b/chrome/browser/tab_contents/navigation_controller.cc
@@ -746,7 +746,7 @@ void NavigationController::CommitPendingEntry() {
// it new again, since InsertEntry expects to take ownership and also
// discard the pending entry. We also need to synthesize a page ID. We can
// only do this because this function will only be called by our custom
- // TabContents types. For WebContents, the IDs are generated by the
+ // TabContents types. For TabContents, the IDs are generated by the
// renderer, so we can't do this.
details.type = NavigationType::NEW_PAGE;
pending_entry_->set_page_id(tab_contents_->GetMaxPageID() + 1);
diff --git a/chrome/browser/tab_contents/navigation_controller.h b/chrome/browser/tab_contents/navigation_controller.h
index e42f4ad..015bdaa 100644
--- a/chrome/browser/tab_contents/navigation_controller.h
+++ b/chrome/browser/tab_contents/navigation_controller.h
@@ -23,7 +23,7 @@ class Profile;
class TabContents;
class SiteInstance;
class SkBitmap;
-class WebContents;
+class TabContents;
class TabContentsCollector;
class TabNavigation;
struct ViewHostMsg_FrameNavigate_Params;
@@ -293,7 +293,7 @@ class NavigationController {
// For use by TabContents ----------------------------------------------------
// Handles updating the navigation state after the renderer has navigated.
- // This is used by the WebContents. Simpler tab contents types can use
+ // This is used by the TabContents. Simpler tab contents types can use
// CommitPendingEntry below.
//
// If a new entry is created, it will return true and will have filled the
@@ -471,7 +471,7 @@ class NavigationController {
TabContents* tab_contents_;
// The max restored page ID in this controller, if it was restored. We must
- // store this so that WebContents can tell any renderer in charge of one of
+ // store this so that TabContents can tell any renderer in charge of one of
// the restored entries to update its max page ID.
int max_restored_page_id_;
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index c77d8d5..228efc7 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -15,7 +15,7 @@
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/spellchecker.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
-#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/clipboard_service.h"
#include "chrome/common/l10n_util.h"
@@ -31,11 +31,11 @@
#endif
RenderViewContextMenu::RenderViewContextMenu(
- WebContents* web_contents,
+ TabContents* tab_contents,
const ContextMenuParams& params)
: params_(params),
- source_web_contents_(web_contents),
- profile_(web_contents->profile()) {
+ source_tab_contents_(tab_contents),
+ profile_(tab_contents->profile()) {
}
RenderViewContextMenu::~RenderViewContextMenu() {
@@ -203,16 +203,16 @@ bool RenderViewContextMenu::IsItemCommandEnabled(int id) const {
// Allow Spell Check language items on sub menu for text area context menu.
if ((id >= IDC_SPELLCHECK_LANGUAGES_FIRST) &&
(id < IDC_SPELLCHECK_LANGUAGES_LAST)) {
- return source_web_contents_->profile()->GetPrefs()->GetBoolean(
+ return source_tab_contents_->profile()->GetPrefs()->GetBoolean(
prefs::kEnableSpellCheck);
}
switch (id) {
case IDS_CONTENT_CONTEXT_BACK:
- return source_web_contents_->controller().CanGoBack();
+ return source_tab_contents_->controller().CanGoBack();
case IDS_CONTENT_CONTEXT_FORWARD:
- return source_web_contents_->controller().CanGoForward();
+ return source_tab_contents_->controller().CanGoForward();
case IDS_CONTENT_CONTEXT_VIEWPAGESOURCE:
case IDS_CONTENT_CONTEXT_VIEWFRAMESOURCE:
@@ -247,7 +247,7 @@ bool RenderViewContextMenu::IsItemCommandEnabled(int id) const {
return params_.image_url.is_valid();
case IDS_CONTENT_CONTEXT_SAVEPAGEAS:
- return SavePackage::IsSavableURL(source_web_contents_->GetURL());
+ return SavePackage::IsSavableURL(source_tab_contents_->GetURL());
case IDS_CONTENT_CONTEXT_OPENFRAMENEWTAB:
case IDS_CONTENT_CONTEXT_OPENFRAMENEWWINDOW:
@@ -275,18 +275,18 @@ bool RenderViewContextMenu::IsItemCommandEnabled(int id) const {
return !!(params_.edit_flags & ContextNode::CAN_SELECT_ALL);
case IDS_CONTENT_CONTEXT_OPENLINKOFFTHERECORD:
- return !source_web_contents_->profile()->IsOffTheRecord() &&
+ return !source_tab_contents_->profile()->IsOffTheRecord() &&
params_.link_url.is_valid();
case IDS_CONTENT_CONTEXT_OPENFRAMEOFFTHERECORD:
- return !source_web_contents_->profile()->IsOffTheRecord() &&
+ return !source_tab_contents_->profile()->IsOffTheRecord() &&
params_.frame_url.is_valid();
case IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY:
return !params_.misspelled_word.empty();
case IDS_CONTENT_CONTEXT_VIEWPAGEINFO:
- return (source_web_contents_->controller().GetActiveEntry() != NULL);
+ return (source_tab_contents_->controller().GetActiveEntry() != NULL);
case IDS_CONTENT_CONTEXT_RELOAD:
case IDS_CONTENT_CONTEXT_COPYIMAGE:
@@ -303,7 +303,7 @@ bool RenderViewContextMenu::IsItemCommandEnabled(int id) const {
return true;
case IDC_CHECK_SPELLING_OF_THIS_FIELD:
- return source_web_contents_->profile()->GetPrefs()->GetBoolean(
+ return source_tab_contents_->profile()->GetPrefs()->GetBoolean(
prefs::kEnableSpellCheck);
case IDS_CONTENT_CONTEXT_SAVEFRAMEAS:
@@ -317,7 +317,7 @@ bool RenderViewContextMenu::IsItemCommandEnabled(int id) const {
bool RenderViewContextMenu::ItemIsChecked(int id) const {
// Check box for 'Check the Spelling of this field'.
if (id == IDC_CHECK_SPELLING_OF_THIS_FIELD) {
- PrefService* prefs = source_web_contents_->profile()->GetPrefs();
+ PrefService* prefs = source_tab_contents_->profile()->GetPrefs();
return (params_.spellcheck_enabled &&
prefs->GetBoolean(prefs::kEnableSpellCheck));
}
@@ -330,7 +330,7 @@ bool RenderViewContextMenu::ItemIsChecked(int id) const {
SpellChecker::Languages languages;
return SpellChecker::GetSpellCheckLanguages(
- source_web_contents_->profile(), &languages) ==
+ source_tab_contents_->profile(), &languages) ==
(id - IDC_SPELLCHECK_LANGUAGES_FIRST);
}
@@ -341,11 +341,11 @@ void RenderViewContextMenu::ExecuteItemCommand(int id) {
const size_t language_number = id - IDC_SPELLCHECK_LANGUAGES_FIRST;
SpellChecker::Languages languages;
SpellChecker::GetSpellCheckLanguages(
- source_web_contents_->profile(), &languages);
+ source_tab_contents_->profile(), &languages);
if (language_number < languages.size()) {
StringPrefMember dictionary_language;
dictionary_language.Init(prefs::kSpellCheckDictionary,
- source_web_contents_->profile()->GetPrefs(), NULL);
+ source_tab_contents_->profile()->GetPrefs(), NULL);
dictionary_language.SetValue(ASCIIToWide(languages[language_number]));
}
@@ -374,9 +374,9 @@ void RenderViewContextMenu::ExecuteItemCommand(int id) {
(id == IDS_CONTENT_CONTEXT_SAVELINKAS ? params_.link_url :
params_.image_url);
DownloadManager* dlm =
- source_web_contents_->profile()->GetDownloadManager();
+ source_tab_contents_->profile()->GetDownloadManager();
dlm->DownloadUrl(url, referrer, params_.frame_charset,
- source_web_contents_);
+ source_tab_contents_);
break;
}
@@ -397,23 +397,23 @@ void RenderViewContextMenu::ExecuteItemCommand(int id) {
break;
case IDS_CONTENT_CONTEXT_BACK:
- source_web_contents_->controller().GoBack();
+ source_tab_contents_->controller().GoBack();
break;
case IDS_CONTENT_CONTEXT_FORWARD:
- source_web_contents_->controller().GoForward();
+ source_tab_contents_->controller().GoForward();
break;
case IDS_CONTENT_CONTEXT_SAVEPAGEAS:
- source_web_contents_->OnSavePage();
+ source_tab_contents_->OnSavePage();
break;
case IDS_CONTENT_CONTEXT_RELOAD:
- source_web_contents_->controller().Reload(true);
+ source_tab_contents_->controller().Reload(true);
break;
case IDS_CONTENT_CONTEXT_PRINT:
- source_web_contents_->PrintPreview();
+ source_tab_contents_->PrintPreview();
break;
case IDS_CONTENT_CONTEXT_VIEWPAGESOURCE:
@@ -428,11 +428,11 @@ void RenderViewContextMenu::ExecuteItemCommand(int id) {
case IDS_CONTENT_CONTEXT_VIEWPAGEINFO: {
#if defined(OS_WIN)
NavigationEntry* nav_entry =
- source_web_contents_->controller().GetActiveEntry();
+ source_tab_contents_->controller().GetActiveEntry();
PageInfoWindow::CreatePageInfo(
- source_web_contents_->profile(),
+ source_tab_contents_->profile(),
nav_entry,
- source_web_contents_->GetContentNativeView(),
+ source_tab_contents_->GetContentNativeView(),
PageInfoWindow::SECURITY);
#else
// TODO(port): port PageInfoWindow.
@@ -492,44 +492,44 @@ void RenderViewContextMenu::ExecuteItemCommand(int id) {
ssl.set_security_bits(security_bits);
}
PageInfoWindow::CreateFrameInfo(
- source_web_contents_->profile(),
+ source_tab_contents_->profile(),
params_.frame_url,
ssl,
- source_web_contents_->GetContentNativeView(),
+ source_tab_contents_->GetContentNativeView(),
PageInfoWindow::SECURITY);
break;
}
case IDS_CONTENT_CONTEXT_UNDO:
- source_web_contents_->render_view_host()->Undo();
+ source_tab_contents_->render_view_host()->Undo();
break;
case IDS_CONTENT_CONTEXT_REDO:
- source_web_contents_->render_view_host()->Redo();
+ source_tab_contents_->render_view_host()->Redo();
break;
case IDS_CONTENT_CONTEXT_CUT:
- source_web_contents_->render_view_host()->Cut();
+ source_tab_contents_->render_view_host()->Cut();
break;
case IDS_CONTENT_CONTEXT_COPY:
- source_web_contents_->render_view_host()->Copy();
+ source_tab_contents_->render_view_host()->Copy();
break;
case IDS_CONTENT_CONTEXT_PASTE:
- source_web_contents_->render_view_host()->Paste();
+ source_tab_contents_->render_view_host()->Paste();
break;
case IDS_CONTENT_CONTEXT_DELETE:
- source_web_contents_->render_view_host()->Delete();
+ source_tab_contents_->render_view_host()->Delete();
break;
case IDS_CONTENT_CONTEXT_SELECTALL:
- source_web_contents_->render_view_host()->SelectAll();
+ source_tab_contents_->render_view_host()->SelectAll();
break;
case IDS_CONTENT_CONTEXT_SEARCHWEBFOR: {
- const TemplateURL* const default_provider = source_web_contents_->
+ const TemplateURL* const default_provider = source_tab_contents_->
profile()->GetTemplateURLModel()->GetDefaultSearchProvider();
DCHECK(default_provider); // The context menu should not contain this
// item when there is no provider.
@@ -546,15 +546,15 @@ void RenderViewContextMenu::ExecuteItemCommand(int id) {
case IDC_SPELLCHECK_SUGGESTION_2:
case IDC_SPELLCHECK_SUGGESTION_3:
case IDC_SPELLCHECK_SUGGESTION_4:
- source_web_contents_->render_view_host()->Replace(
+ source_tab_contents_->render_view_host()->Replace(
params_.dictionary_suggestions[id - IDC_SPELLCHECK_SUGGESTION_0]);
break;
case IDC_CHECK_SPELLING_OF_THIS_FIELD:
- source_web_contents_->render_view_host()->ToggleSpellCheck();
+ source_tab_contents_->render_view_host()->ToggleSpellCheck();
break;
case IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY:
- source_web_contents_->render_view_host()->AddToDictionary(
+ source_tab_contents_->render_view_host()->AddToDictionary(
params_.misspelled_word);
break;
@@ -563,10 +563,10 @@ void RenderViewContextMenu::ExecuteItemCommand(int id) {
// TODO(yusukes): This should be moved to some shared place of commands
// for the options stuff so that we don't have to do all this work here.
FontsLanguagesWindowView* window_ = new FontsLanguagesWindowView(
- source_web_contents_->profile());
+ source_tab_contents_->profile());
views::Window::CreateChromeWindow(
platform_util::GetTopLevel(
- source_web_contents_->GetContentNativeView()),
+ source_tab_contents_->GetContentNativeView()),
gfx::Rect(), window_)->Show();
window_->SelectLanguagesTab();
#else
@@ -588,7 +588,7 @@ bool RenderViewContextMenu::IsDevCommandEnabled(int id) const {
return true;
NavigationEntry *active_entry =
- source_web_contents_->controller().GetActiveEntry();
+ source_tab_contents_->controller().GetActiveEntry();
if (!active_entry)
return false;
@@ -613,7 +613,7 @@ bool RenderViewContextMenu::IsDevCommandEnabled(int id) const {
// Don't enable the web inspector if JavaScript is disabled
if (id == IDS_CONTENT_CONTEXT_INSPECTELEMENT) {
- PrefService* prefs = source_web_contents_->profile()->GetPrefs();
+ PrefService* prefs = source_tab_contents_->profile()->GetPrefs();
if (!prefs->GetBoolean(prefs::kWebKitJavascriptEnabled) ||
command_line.HasSwitch(switches::kDisableJavaScript))
return false;
@@ -628,20 +628,20 @@ void RenderViewContextMenu::OpenURL(
const GURL& url,
WindowOpenDisposition disposition,
PageTransition::Type transition) {
- source_web_contents_->OpenURL(url, GURL(), disposition, transition);
+ source_tab_contents_->OpenURL(url, GURL(), disposition, transition);
}
void RenderViewContextMenu::CopyImageAt(int x, int y) {
- source_web_contents_->render_view_host()->CopyImageAt(x, y);
+ source_tab_contents_->render_view_host()->CopyImageAt(x, y);
}
void RenderViewContextMenu::Inspect(int x, int y) {
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableOutOfProcessDevTools)) {
g_browser_process->devtools_manager()->InspectElement(
- source_web_contents_, x, y);
+ source_tab_contents_, x, y);
} else {
- source_web_contents_->render_view_host()->InspectElementAt(x, y);
+ source_tab_contents_->render_view_host()->InspectElementAt(x, y);
}
}
diff --git a/chrome/browser/tab_contents/render_view_context_menu.h b/chrome/browser/tab_contents/render_view_context_menu.h
index d6dfaf1..54c611f 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.h
+++ b/chrome/browser/tab_contents/render_view_context_menu.h
@@ -11,12 +11,12 @@
#include "webkit/glue/window_open_disposition.h"
class Profile;
-class WebContents;
+class TabContents;
class RenderViewContextMenu {
public:
RenderViewContextMenu(
- WebContents* web_contents,
+ TabContents* tab_contents,
const ContextMenuParams& params);
virtual ~RenderViewContextMenu();
@@ -86,7 +86,7 @@ class RenderViewContextMenu {
bool IsDevCommandEnabled(int id) const;
ContextMenuParams params_;
- WebContents* source_web_contents_;
+ TabContents* source_tab_contents_;
Profile* profile_;
DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu);
diff --git a/chrome/browser/tab_contents/render_view_context_menu_gtk.cc b/chrome/browser/tab_contents/render_view_context_menu_gtk.cc
index 1ccb4c0..0362366 100644
--- a/chrome/browser/tab_contents/render_view_context_menu_gtk.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu_gtk.cc
@@ -8,7 +8,7 @@
#include "webkit/glue/context_menu.h"
RenderViewContextMenuGtk::RenderViewContextMenuGtk(
- WebContents* web_contents,
+ TabContents* web_contents,
const ContextMenuParams& params,
guint32 triggering_event_time)
: RenderViewContextMenu(web_contents, params),
diff --git a/chrome/browser/tab_contents/render_view_context_menu_gtk.h b/chrome/browser/tab_contents/render_view_context_menu_gtk.h
index 5563dc5..b6855f2 100644
--- a/chrome/browser/tab_contents/render_view_context_menu_gtk.h
+++ b/chrome/browser/tab_contents/render_view_context_menu_gtk.h
@@ -19,7 +19,7 @@ class ContextMenuParams;
class RenderViewContextMenuGtk : public RenderViewContextMenu,
public MenuGtk::Delegate {
public:
- RenderViewContextMenuGtk(WebContents* web_contents,
+ RenderViewContextMenuGtk(TabContents* web_contents,
const ContextMenuParams& params,
uint32_t triggering_event_time);
diff --git a/chrome/browser/tab_contents/render_view_context_menu_mac.h b/chrome/browser/tab_contents/render_view_context_menu_mac.h
index 9a4f60e..4b39b56 100644
--- a/chrome/browser/tab_contents/render_view_context_menu_mac.h
+++ b/chrome/browser/tab_contents/render_view_context_menu_mac.h
@@ -17,7 +17,7 @@
class RenderViewContextMenuMac : public RenderViewContextMenu {
public:
- RenderViewContextMenuMac(WebContents* web_contents,
+ RenderViewContextMenuMac(TabContents* web_contents,
const ContextMenuParams& params,
NSView* parent_view);
virtual ~RenderViewContextMenuMac();
diff --git a/chrome/browser/tab_contents/render_view_context_menu_mac.mm b/chrome/browser/tab_contents/render_view_context_menu_mac.mm
index fc614ff..b2cc94f 100644
--- a/chrome/browser/tab_contents/render_view_context_menu_mac.mm
+++ b/chrome/browser/tab_contents/render_view_context_menu_mac.mm
@@ -40,7 +40,7 @@
@end
RenderViewContextMenuMac::RenderViewContextMenuMac(
- WebContents* web_contents,
+ TabContents* web_contents,
const ContextMenuParams& params,
NSView* parent_view)
: RenderViewContextMenu(web_contents, params),
diff --git a/chrome/browser/tab_contents/render_view_context_menu_win.cc b/chrome/browser/tab_contents/render_view_context_menu_win.cc
index 0adcf72..ea2a2d0 100644
--- a/chrome/browser/tab_contents/render_view_context_menu_win.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu_win.cc
@@ -10,10 +10,10 @@
#include "grit/generated_resources.h"
RenderViewContextMenuWin::RenderViewContextMenuWin(
- WebContents* web_contents,
+ TabContents* tab_contents,
const ContextMenuParams& params,
HWND owner)
- : RenderViewContextMenu(web_contents, params),
+ : RenderViewContextMenu(tab_contents, params),
ALLOW_THIS_IN_INITIALIZER_LIST(menu_(this, Menu::TOPLEFT, owner)),
sub_menu_(NULL) {
InitMenu(params.node);
diff --git a/chrome/browser/tab_contents/render_view_context_menu_win.h b/chrome/browser/tab_contents/render_view_context_menu_win.h
index db74b5e..32426b4 100644
--- a/chrome/browser/tab_contents/render_view_context_menu_win.h
+++ b/chrome/browser/tab_contents/render_view_context_menu_win.h
@@ -12,7 +12,7 @@
class RenderViewContextMenuWin : public RenderViewContextMenu,
public Menu::Delegate{
public:
- RenderViewContextMenuWin(WebContents* web_contents,
+ RenderViewContextMenuWin(TabContents* tab_contents,
const ContextMenuParams& params,
HWND window);
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
index 49fe017..8390d6e 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/renderer_host/render_widget_host.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/tab_contents/site_instance.h"
-#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -24,8 +24,8 @@ void RenderViewHostDelegateViewHelper::CreateNewWindow(int route_id,
SiteInstance* site) {
// Create the new web contents. This will automatically create the new
// TabContentsView. In the future, we may want to create the view separately.
- WebContents* new_contents =
- new WebContents(profile,
+ TabContents* new_contents =
+ new TabContents(profile,
site,
route_id,
modal_dialog_event);
@@ -51,26 +51,26 @@ RenderWidgetHostView* RenderViewHostDelegateViewHelper::CreateNewWidget(
return widget_view;
}
-WebContents* RenderViewHostDelegateViewHelper::GetCreatedWindow(int route_id) {
+TabContents* RenderViewHostDelegateViewHelper::GetCreatedWindow(int route_id) {
PendingContents::iterator iter = pending_contents_.find(route_id);
if (iter == pending_contents_.end()) {
DCHECK(false);
return NULL;
}
- WebContents* new_web_contents = iter->second;
+ TabContents* new_tab_contents = iter->second;
pending_contents_.erase(route_id);
- if (!new_web_contents->render_view_host()->view() ||
- !new_web_contents->process()->channel()) {
+ if (!new_tab_contents->render_view_host()->view() ||
+ !new_tab_contents->process()->channel()) {
// The view has gone away or the renderer crashed. Nothing to do.
return NULL;
}
// TODO(brettw) this seems bogus to reach into here and initialize the host.
- new_web_contents->render_view_host()->Init();
+ new_tab_contents->render_view_host()->Init();
- return new_web_contents;
+ return new_tab_contents;
}
RenderWidgetHostView* RenderViewHostDelegateViewHelper::GetCreatedWidget(
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.h b/chrome/browser/tab_contents/render_view_host_delegate_helper.h
index 2263829..4f9e600 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.h
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.h
@@ -21,7 +21,7 @@ class RenderViewHost;
class RenderWidgetHost;
class RenderWidgetHostView;
class SiteInstance;
-class WebContents;
+class TabContents;
// Provides helper methods that provide common implementations of some
// RenderViewHostDelegate::View methods.
@@ -34,14 +34,14 @@ class RenderViewHostDelegateViewHelper {
Profile* profile, SiteInstance* site);
virtual RenderWidgetHostView* CreateNewWidget(int route_id, bool activatable,
RenderProcessHost* process);
- virtual WebContents* GetCreatedWindow(int route_id);
+ virtual TabContents* GetCreatedWindow(int route_id);
virtual RenderWidgetHostView* GetCreatedWidget(int route_id);
void RenderWidgetHostDestroyed(RenderWidgetHost* host);
private:
- // Tracks created WebContents objects that have not been shown yet. They are
+ // Tracks created TabContents objects that have not been shown yet. They are
// identified by the route ID passed to CreateNewWindow.
- typedef std::map<int, WebContents*> PendingContents;
+ typedef std::map<int, TabContents*> PendingContents;
PendingContents pending_contents_;
// These maps hold on to the widgets that we created on behalf of the
diff --git a/chrome/browser/tab_contents/render_view_host_manager.h b/chrome/browser/tab_contents/render_view_host_manager.h
index a91d488..d77e649 100644
--- a/chrome/browser/tab_contents/render_view_host_manager.h
+++ b/chrome/browser/tab_contents/render_view_host_manager.h
@@ -20,23 +20,23 @@ class RenderViewHostDelegate;
class RenderWidgetHostView;
class SiteInstance;
-// Manages RenderViewHosts for a WebContents. Normally there is only one and
+// Manages RenderViewHosts for a TabContents. Normally there is only one and
// it is easy to do. But we can also have transitions of processes (and hence
// RenderViewHosts) that can get complex.
class RenderViewHostManager : public NotificationObserver {
public:
// Functions implemented by our owner that we need.
//
- // TODO(brettw) Clean this up! These are all the functions in WebContents that
+ // TODO(brettw) Clean this up! These are all the functions in TabContents that
// are required to run this class. The design should probably be better such
// that these are more clear.
//
// There is additional complexity that some of the functions we need in
- // WebContents are inherited and non-virtual. These are named with
+ // TabContents are inherited and non-virtual. These are named with
// "RenderManager" so that the duplicate implementation of them will be clear.
class Delegate {
public:
- // See web_contents.h's implementation for more.
+ // See tab_contents.h's implementation for more.
virtual bool CreateRenderViewForRenderManager(
RenderViewHost* render_view_host) = 0;
virtual void BeforeUnloadFiredFromRenderManager(
@@ -69,7 +69,7 @@ class RenderViewHostManager : public NotificationObserver {
Delegate* delegate);
~RenderViewHostManager();
- // For arguments, see WebContents constructor.
+ // For arguments, see TabContents constructor.
void Init(Profile* profile,
SiteInstance* site_instance,
int routing_id,
@@ -126,7 +126,7 @@ class RenderViewHostManager : public NotificationObserver {
// Called when a renderer's main frame navigates.
void DidNavigateMainFrame(RenderViewHost* render_view_host);
- // Allows the WebContents to react when a cross-site response is ready to be
+ // Allows the TabContents to react when a cross-site response is ready to be
// delivered to a pending RenderViewHost. We must first run the onunload
// handler of the old RenderViewHost before we can allow it to proceed.
void OnCrossSiteResponse(int new_render_process_host_id,
@@ -140,7 +140,7 @@ class RenderViewHostManager : public NotificationObserver {
void RendererAbortedProvisionalLoad(RenderViewHost* render_view_host);
// Actually implements this RenderViewHostDelegate function for the
- // WebContents.
+ // TabContents.
void ShouldClosePage(bool proceed);
// Forwards the message to the RenderViewHost, which is the original one.
@@ -174,7 +174,7 @@ class RenderViewHostManager : public NotificationObserver {
const NotificationDetails& details);
private:
- friend class TestWebContents;
+ friend class TestTabContents;
// Returns whether this tab should transition to a new renderer for
// cross-site URLs. Enabled unless we see the --process-per-tab command line
diff --git a/chrome/browser/tab_contents/render_view_host_manager_unittest.cc b/chrome/browser/tab_contents/render_view_host_manager_unittest.cc
index f0caccd..324c547 100644
--- a/chrome/browser/tab_contents/render_view_host_manager_unittest.cc
+++ b/chrome/browser/tab_contents/render_view_host_manager_unittest.cc
@@ -23,7 +23,7 @@ TEST_F(RenderViewHostManagerTest, NewTabPageProcesses) {
NavigateAndCommit(dest);
// Make a second tab.
- TestWebContents contents2(profile_.get(), NULL);
+ TestTabContents contents2(profile_.get(), NULL);
// Load the two URLs in the second tab. Note that the first navigation creates
// a RVH that's not pending (since there is no cross-site transition), so
diff --git a/chrome/browser/tab_contents/site_instance.h b/chrome/browser/tab_contents/site_instance.h
index 2e6a51b..18cebbd 100644
--- a/chrome/browser/tab_contents/site_instance.h
+++ b/chrome/browser/tab_contents/site_instance.h
@@ -21,8 +21,8 @@
// to the other). We represent instances using the BrowsingInstance class.
//
// In --process-per-tab, one SiteInstance is created for each tab (i.e., in the
-// WebContents constructor), unless the tab is created by script (i.e., in
-// WebContents::CreateNewView). This corresponds to one process per
+// TabContents constructor), unless the tab is created by script (i.e., in
+// TabContents::CreateNewView). This corresponds to one process per
// BrowsingInstance.
//
// In process-per-site-instance (the current default process model),
@@ -36,7 +36,7 @@
// throughout the entire profile. This ensures that only one process will be
// dedicated to each site.
//
-// Each NavigationEntry for a WebContents points to the SiteInstance that
+// Each NavigationEntry for a TabContents points to the SiteInstance that
// rendered it. Each RenderViewHost also points to the SiteInstance that it is
// associated with. A SiteInstance keeps track of the number of these
// references and deletes itself when the count goes to zero. This means that
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 37b370c..035203e 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -30,9 +30,9 @@
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/renderer_host/web_cache_manager.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
-#include "chrome/browser/tab_contents/web_contents.h"
#include "chrome/browser/search_engines/template_url_fetcher.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/common/chrome_switches.h"
@@ -86,12 +86,12 @@
// it is a download. If so, it sends a message to the new renderer causing
// it to cancel the request, and the download proceeds in the download
// thread. For now, we stay in a PENDING state (with a pending RVH) until
-// the next DidNavigate event for this WebContents. This isn't ideal, but it
+// the next DidNavigate event for this TabContents. This isn't ideal, but it
// doesn't affect any functionality.
// - After RDH receives a response and determines that it is safe and not a
// download, it pauses the response to first run the old page's onunload
// handler. It does this by asynchronously calling the OnCrossSiteResponse
-// method of WebContents on the UI thread, which sends a ClosePage message
+// method of TabContents on the UI thread, which sends a ClosePage message
// to the current RVH.
// - Once the onunload handler is finished, a ClosePage_ACK message is sent to
// the ResourceDispatcherHost, who unpauses the response. Data is then sent
@@ -167,9 +167,9 @@ BOOL CALLBACK InvalidateWindow(HWND hwnd, LPARAM lparam) {
}
#endif
-// TODO(brettw) WebContents should be removed, then this hack is unnecessary.
-WebContents* AsWC(TabContents* tc) {
- return static_cast<WebContents*>(tc);
+// TODO(brettw) TabContents should be removed, then this hack is unnecessary.
+TabContents* AsWC(TabContents* tc) {
+ return static_cast<TabContents*>(tc);
}
} // namespace
@@ -197,8 +197,8 @@ class TabContents::GearsCreateShortcutCallbackFunctor {
TabContents* contents_;
};
-// TODO(brettw) many of the data members here have casts to WebContents.
-// This object is the same as WebContents and is currently being merged.
+// TODO(brettw) many of the data members here have casts to TabContents.
+// This object is the same as TabContents and is currently being merged.
// When this merge is done, the casts can be removed.
TabContents::TabContents(Profile* profile,
SiteInstance* site_instance,
@@ -206,20 +206,20 @@ TabContents::TabContents(Profile* profile,
base::WaitableEvent* modal_dialog_event)
: delegate_(NULL),
controller_(this, profile),
- view_(TabContentsView::Create(static_cast<WebContents*>(this))),
+ view_(TabContentsView::Create(static_cast<TabContents*>(this))),
ALLOW_THIS_IN_INITIALIZER_LIST(render_manager_(
- static_cast<WebContents*>(this),
- static_cast<WebContents*>(this))),
+ static_cast<TabContents*>(this),
+ static_cast<TabContents*>(this))),
property_bag_(),
registrar_(),
- printing_(*static_cast<WebContents*>(this)),
+ printing_(*static_cast<TabContents*>(this)),
save_package_(),
cancelable_consumer_(),
autofill_manager_(),
password_manager_(),
plugin_installer_(),
ALLOW_THIS_IN_INITIALIZER_LIST(fav_icon_helper_(
- static_cast<WebContents*>(this))),
+ static_cast<TabContents*>(this))),
select_file_dialog_(),
pending_install_(),
is_loading_(false),
@@ -298,7 +298,7 @@ TabContents::~TabContents() {
view_->OnContentsDestroy();
NotifyDisconnected();
- HungRendererWarning::HideForWebContents(AsWC(this));
+ HungRendererWarning::HideForTabContents(AsWC(this));
if (pending_install_.callback_functor)
pending_install_.callback_functor->Cancel();
@@ -396,11 +396,6 @@ void TabContents::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterBooleanPref(prefs::kBlockPopups, false);
}
- // TODO(brettw) Remove WebContents.
-WebContents* TabContents::AsWebContents() {
- return AsWC(this);
-}
-
bool TabContents::SupportsURL(GURL* url) {
// TODO(brettw) remove this function.
return true;
@@ -471,15 +466,11 @@ int32 TabContents::GetMaxPageID() {
void TabContents::UpdateMaxPageID(int32 page_id) {
// Ensure both the SiteInstance and RenderProcessHost update their max page
- // IDs in sync. Only WebContents will also have site instances, except during
+ // IDs in sync. Only TabContents will also have site instances, except during
// testing.
if (GetSiteInstance())
GetSiteInstance()->UpdateMaxPageID(page_id);
-
- if (AsWebContents())
- AsWebContents()->process()->UpdateMaxPageID(page_id);
- else
- max_page_id_ = std::max(max_page_id_, page_id);
+ process()->UpdateMaxPageID(page_id);
}
SiteInstance* TabContents::GetSiteInstance() const {
@@ -657,7 +648,7 @@ void TabContents::HideContents() {
// about the order in which these get called. In addition to making the code
// here practically impossible to understand, this also means we end up
// calling TabContents::WasHidden() twice if callers call both versions of
- // HideContents() on a WebContents.
+ // HideContents() on a TabContents.
WasHidden();
}
@@ -1488,16 +1479,16 @@ void TabContents::NotifySwapped() {
// pointer. See Bug 1230284.
notify_disconnection_ = true;
NotificationService::current()->Notify(
- NotificationType::WEB_CONTENTS_SWAPPED,
- Source<WebContents>(AsWC(this)),
+ NotificationType::TAB_CONTENTS_SWAPPED,
+ Source<TabContents>(AsWC(this)),
NotificationService::NoDetails());
}
void TabContents::NotifyConnected() {
notify_disconnection_ = true;
NotificationService::current()->Notify(
- NotificationType::WEB_CONTENTS_CONNECTED,
- Source<WebContents>(AsWC(this)),
+ NotificationType::TAB_CONTENTS_CONNECTED,
+ Source<TabContents>(AsWC(this)),
NotificationService::NoDetails());
}
@@ -1507,8 +1498,8 @@ void TabContents::NotifyDisconnected() {
notify_disconnection_ = false;
NotificationService::current()->Notify(
- NotificationType::WEB_CONTENTS_DISCONNECTED,
- Source<WebContents>(AsWC(this)),
+ NotificationType::TAB_CONTENTS_DISCONNECTED,
+ Source<TabContents>(AsWC(this)),
NotificationService::NoDetails());
}
@@ -1598,10 +1589,6 @@ Profile* TabContents::GetProfile() const {
return profile();
}
-WebContents* TabContents::GetAsWebContents() {
- return AsWC(this);
-}
-
ExtensionFunctionDispatcher* TabContents::CreateExtensionFunctionDispatcher(
RenderViewHost* render_view_host,
const std::string& extension_id) {
@@ -1609,6 +1596,10 @@ ExtensionFunctionDispatcher* TabContents::CreateExtensionFunctionDispatcher(
extension_id);
}
+TabContents* TabContents::GetAsTabContents() {
+ return this;
+}
+
void TabContents::RenderViewCreated(RenderViewHost* render_view_host) {
NavigationEntry* entry = controller_.GetActiveEntry();
if (!entry)
@@ -1656,7 +1647,7 @@ void TabContents::RenderViewGone(RenderViewHost* rvh) {
view_->Invalidate();
// Hide any visible hung renderer warning for this web contents' process.
- HungRendererWarning::HideForWebContents(AsWC(this));
+ HungRendererWarning::HideForTabContents(AsWC(this));
}
void TabContents::DidNavigate(RenderViewHost* rvh,
@@ -1959,7 +1950,7 @@ void TabContents::DomOperationResponse(const std::string& json_string,
int automation_id) {
DomOperationNotificationDetails details(json_string, automation_id);
NotificationService::current()->Notify(
- NotificationType::DOM_OPERATION_RESPONSE, Source<WebContents>(AsWC(this)),
+ NotificationType::DOM_OPERATION_RESPONSE, Source<TabContents>(AsWC(this)),
Details<DomOperationNotificationDetails>(&details));
}
@@ -2157,7 +2148,7 @@ void TabContents::InspectElementReply(int num_resources) {
// We have received reply from inspect element request. Notify the
// automation provider in case we need to notify automation client.
NotificationService::current()->Notify(
- NotificationType::DOM_INSPECT_ELEMENT_RESPONSE, Source<WebContents>(AsWC(this)),
+ NotificationType::DOM_INSPECT_ELEMENT_RESPONSE, Source<TabContents>(AsWC(this)),
Details<int>(&num_resources));
}
@@ -2233,7 +2224,7 @@ void TabContents::ShouldClosePage(bool proceed) {
void TabContents::OnCrossSiteResponse(int new_render_process_host_id,
int new_request_id) {
- // Allows the WebContents to react when a cross-site response is ready to be
+ // Allows the TabContents to react when a cross-site response is ready to be
// delivered to a pending RenderViewHost. We must first run the onunload
// handler of the old RenderViewHost before we can allow it to proceed.
render_manager_.OnCrossSiteResponse(new_render_process_host_id,
@@ -2269,11 +2260,11 @@ void TabContents::RendererUnresponsive(RenderViewHost* rvh,
}
if (render_view_host() && render_view_host()->IsRenderViewLive())
- HungRendererWarning::ShowForWebContents(AsWC(this));
+ HungRendererWarning::ShowForTabContents(AsWC(this));
}
void TabContents::RendererResponsive(RenderViewHost* render_view_host) {
- HungRendererWarning::HideForWebContents(AsWC(this));
+ HungRendererWarning::HideForTabContents(AsWC(this));
}
void TabContents::LoadStateChanged(const GURL& url,
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index 4ce03c5..eadc025 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -79,9 +79,9 @@ class TabContentsView;
struct ThumbnailScore;
struct ViewHostMsg_FrameNavigate_Params;
struct ViewHostMsg_DidPrintPage_Params;
-class WebContents;
+class TabContents;
-// Describes what goes in the main content area of a tab. WebContents is
+// Describes what goes in the main content area of a tab. TabContents is
// the only type of TabContents, and these should be merged together.
class TabContents : public PageNavigator,
public NotificationObserver,
@@ -118,15 +118,6 @@ class TabContents : public PageNavigator,
const PropertyBag* property_bag() const { return &property_bag_; }
PropertyBag* property_bag() { return &property_bag_; }
- // Returns this object as a WebContents if it is one, and NULL otherwise.
- // TODO(brettw) this should not be necessary.
- WebContents* AsWebContents();
-
- // Const version of above for situations where const TabContents*'s are used.
- WebContents* AsWebContents() const {
- return const_cast<TabContents*>(this)->AsWebContents();
- }
-
// Returns this object as a DOMUIContents if it is one, and NULL otherwise.
virtual DOMUIContents* AsDOMUIContents() { return NULL; }
@@ -187,7 +178,7 @@ class TabContents : public PageNavigator,
// The max PageID of any page that this TabContents has loaded. PageIDs
// increase with each new page that is loaded by a tab. If this is a
- // WebContents, then the max PageID is kept separately on each SiteInstance.
+ // TabContents, then the max PageID is kept separately on each SiteInstance.
// Returns -1 if no PageIDs have yet been seen.
int32 GetMaxPageID();
@@ -195,7 +186,7 @@ class TabContents : public PageNavigator,
void UpdateMaxPageID(int32 page_id);
// Returns the site instance associated with the current page. By default,
- // there is no site instance. WebContents overrides this to provide proper
+ // there is no site instance. TabContents overrides this to provide proper
// access to its site instance.
virtual SiteInstance* GetSiteInstance() const;
@@ -500,7 +491,7 @@ class TabContents : public PageNavigator,
current_find_request_id_ = current_find_request_id;
}
- // Accessor for find_text_. Used to determine if this WebContents has any
+ // Accessor for find_text_. Used to determine if this TabContents has any
// active searches.
string16 find_text() const { return find_text_; }
@@ -552,7 +543,7 @@ class TabContents : public PageNavigator,
return contents_mime_type_;
}
- // Returns true if this WebContents will notify about disconnection.
+ // Returns true if this TabContents will notify about disconnection.
bool notify_disconnection() const { return notify_disconnection_; }
// Override the encoding and reload the page by sending down
@@ -579,7 +570,7 @@ class TabContents : public PageNavigator,
// automation purposes.
friend class AutomationProvider;
- FRIEND_TEST(WebContentsTest, UpdateTitle);
+ FRIEND_TEST(TabContentsTest, UpdateTitle);
// Temporary until the view/contents separation is complete.
friend class TabContentsView;
@@ -605,12 +596,12 @@ class TabContents : public PageNavigator,
std::wstring title;
GURL url;
// This object receives the GearsCreateShortcutCallback and routes the
- // message back to the WebContents, if we haven't been deleted.
+ // message back to the TabContents, if we haven't been deleted.
GearsCreateShortcutCallbackFunctor* callback_functor;
};
- // TODO(brettw) TestWebContents shouldn't exist!
- friend class TestWebContents;
+ // TODO(brettw) TestTabContents shouldn't exist!
+ friend class TestTabContents;
RenderWidgetHostView* render_widget_host_view() const {
return render_manager_.current_view();
@@ -730,9 +721,9 @@ class TabContents : public PageNavigator,
virtual RenderViewHostDelegate::Save* GetSaveDelegate() const;
virtual Profile* GetProfile() const;
virtual ExtensionFunctionDispatcher *CreateExtensionFunctionDispatcher(
- RenderViewHost* render_view_host,
- const std::string& extension_id);
- virtual WebContents* GetAsWebContents();
+ RenderViewHost* render_view_host,
+ const std::string& extension_id);
+ virtual TabContents* GetAsTabContents();
virtual void RenderViewCreated(RenderViewHost* render_view_host);
virtual void RenderViewReady(RenderViewHost* render_view_host);
virtual void RenderViewGone(RenderViewHost* render_view_host);
@@ -875,7 +866,7 @@ class TabContents : public PageNavigator,
// Initializes the given renderer if necessary and creates the view ID
// corresponding to this view host. If this method is not called and the
- // process is not shared, then the WebContents will act as though the renderer
+ // process is not shared, then the TabContents will act as though the renderer
// is not running (i.e., it will render "sad tab"). This method is
// automatically called from LoadURL.
//
@@ -953,7 +944,7 @@ class TabContents : public PageNavigator,
bool waiting_for_response_;
// Indicates the largest PageID we've seen. This field is ignored if we are
- // a WebContents, in which case the max page ID is stored separately with
+ // a TabContents, in which case the max page ID is stored separately with
// each SiteInstance.
// TODO(brettw) this seems like it can be removed according to the comment.
int32 max_page_id_;
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h
index 01e7369..6eff8d26 100644
--- a/chrome/browser/tab_contents/tab_contents_delegate.h
+++ b/chrome/browser/tab_contents/tab_contents_delegate.h
@@ -94,7 +94,7 @@ class TabContentsDelegate {
virtual bool IsApplication() { return false; }
// Detach the given tab and convert it to a "webapp" view. The tab must be
- // a WebContents with a valid WebApp set.
+ // a TabContents with a valid WebApp set.
virtual void ConvertContentsToApplication(TabContents* source) { }
// Informs the TabContentsDelegate that some of our state has changed
diff --git a/chrome/browser/tab_contents/tab_contents_view.cc b/chrome/browser/tab_contents/tab_contents_view.cc
index 326e20f..da6c894 100644
--- a/chrome/browser/tab_contents/tab_contents_view.cc
+++ b/chrome/browser/tab_contents/tab_contents_view.cc
@@ -7,11 +7,11 @@
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_widget_host.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
-#include "chrome/browser/tab_contents/web_contents.h"
-TabContentsView::TabContentsView(WebContents* web_contents)
- : web_contents_(web_contents) {
+TabContentsView::TabContentsView(TabContents* tab_contents)
+ : tab_contents_(tab_contents) {
}
void TabContentsView::CreateView() {
@@ -24,8 +24,8 @@ void TabContentsView::RenderWidgetHostDestroyed(RenderWidgetHost* host) {
void TabContentsView::CreateNewWindow(int route_id,
base::WaitableEvent* modal_dialog_event) {
delegate_view_helper_.CreateNewWindow(route_id, modal_dialog_event,
- web_contents_->profile(),
- web_contents_->GetSiteInstance());
+ tab_contents_->profile(),
+ tab_contents_->GetSiteInstance());
}
void TabContentsView::CreateNewWidget(int route_id, bool activatable) {
@@ -36,9 +36,9 @@ void TabContentsView::ShowCreatedWindow(int route_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
bool user_gesture) {
- WebContents* contents = delegate_view_helper_.GetCreatedWindow(route_id);
+ TabContents* contents = delegate_view_helper_.GetCreatedWindow(route_id);
if (contents) {
- web_contents()->AddNewContents(contents, disposition, initial_pos,
+ tab_contents()->AddNewContents(contents, disposition, initial_pos,
user_gesture);
}
}
@@ -53,15 +53,15 @@ void TabContentsView::ShowCreatedWidget(int route_id,
RenderWidgetHostView* TabContentsView::CreateNewWidgetInternal(
int route_id, bool activatable) {
return delegate_view_helper_.CreateNewWidget(route_id, activatable,
- web_contents()->render_view_host()->process());
+ tab_contents()->render_view_host()->process());
}
void TabContentsView::ShowCreatedWidgetInternal(
RenderWidgetHostView* widget_host_view, const gfx::Rect& initial_pos) {
- if (web_contents_->delegate())
- web_contents_->delegate()->RenderWidgetShowing();
+ if (tab_contents_->delegate())
+ tab_contents_->delegate()->RenderWidgetShowing();
- widget_host_view->InitAsPopup(web_contents_->render_widget_host_view(),
+ widget_host_view->InitAsPopup(tab_contents_->render_widget_host_view(),
initial_pos);
widget_host_view->GetRenderWidgetHost()->Init();
}
diff --git a/chrome/browser/tab_contents/tab_contents_view.h b/chrome/browser/tab_contents/tab_contents_view.h
index 7095bf8..1887f13 100644
--- a/chrome/browser/tab_contents/tab_contents_view.h
+++ b/chrome/browser/tab_contents/tab_contents_view.h
@@ -19,7 +19,7 @@ class Browser;
class RenderViewHost;
class RenderWidgetHost;
class RenderWidgetHostView;
-class WebContents;
+class TabContents;
class WebKeyboardEvent;
namespace base {
@@ -27,7 +27,7 @@ class WaitableEvent;
}
// The TabContentsView is an interface that is implemented by the platform-
-// dependent web contents views. The WebContents uses this interface to talk to
+// dependent web contents views. The TabContents uses this interface to talk to
// them. View-related messages will also get forwarded directly to this class
// from RenderViewHost via RenderViewHostDelegate::View.
//
@@ -35,21 +35,21 @@ class WaitableEvent;
// that should be the same for all platforms.
class TabContentsView : public RenderViewHostDelegate::View {
public:
- explicit TabContentsView(WebContents* web_contents);
+ explicit TabContentsView(TabContents* tab_contents);
virtual ~TabContentsView() {}
// Creates the appropriate type of TabContentsView for the current system.
// The return value is a new heap allocated view with ownership passing to
// the caller.
- static TabContentsView* Create(WebContents* web_contents);
+ static TabContentsView* Create(TabContents* tab_contents);
- WebContents* web_contents() const { return web_contents_; }
+ TabContents* tab_contents() const { return tab_contents_; }
virtual void CreateView() = 0;
// Sets up the View that holds the rendered web page, receives messages for
// it and contains page plugins. The host view should be sized to the current
- // size of the WebContents.
+ // size of the TabContents.
virtual RenderWidgetHostView* CreateViewForWidget(
RenderWidgetHost* render_widget_host) = 0;
@@ -77,11 +77,11 @@ class TabContentsView : public RenderViewHostDelegate::View {
return gfx::Size(rc.width(), rc.height());
}
- // Called when the WebContents is being destroyed. This should clean up child
+ // Called when the TabContents is being destroyed. This should clean up child
// windows that are part of the view.
//
// TODO(brettw) It seems like this might be able to be done internally as the
- // window is being torn down without input from the WebContents. Try to
+ // window is being torn down without input from the TabContents. Try to
// implement functions that way rather than adding stuff here.
virtual void OnContentsDestroy() = 0;
@@ -157,12 +157,12 @@ class TabContentsView : public RenderViewHostDelegate::View {
bool user_gesture);
virtual void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos);
- // The WebContents whose contents we display.
- WebContents* web_contents_;
+ // The TabContents whose contents we display.
+ TabContents* tab_contents_;
- // Tracks created WebContents objects that have not been shown yet. They are
+ // Tracks created TabContents objects that have not been shown yet. They are
// identified by the route ID passed to CreateNewWindow.
- typedef std::map<int, WebContents*> PendingContents;
+ typedef std::map<int, TabContents*> PendingContents;
PendingContents pending_contents_;
// These maps hold on to the widgets that we created on behalf of the
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
index 35304d9..9c82b47 100644
--- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc
+++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
@@ -15,8 +15,8 @@
#include "chrome/browser/renderer_host/render_view_host_factory.h"
#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#include "chrome/browser/tab_contents/render_view_context_menu_gtk.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
-#include "chrome/browser/tab_contents/web_contents.h"
#include "chrome/common/gtk_util.h"
namespace {
@@ -24,8 +24,8 @@ namespace {
// Called when the content view gtk widget is tabbed to. We always return true
// and grab focus if we don't have it. The call to SetInitialFocus(bool)
// forwards the tab to webkit. We leave focus via TakeFocus().
-// We cast the WebContents to a TabContents because SetInitialFocus is public
-// in TabContents and protected in WebContents.
+// We cast the TabContents to a TabContents because SetInitialFocus is public
+// in TabContents and protected in TabContents.
gboolean OnFocus(GtkWidget* widget, GtkDirectionType focus,
TabContents* tab_contents) {
if (GTK_WIDGET_HAS_FOCUS(widget))
@@ -39,29 +39,29 @@ gboolean OnFocus(GtkWidget* widget, GtkDirectionType focus,
// Called when the mouse leaves the widget. We notify our delegate.
gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event,
- WebContents* web_contents) {
- if (web_contents->delegate())
- web_contents->delegate()->ContentsMouseEvent(web_contents, false);
+ TabContents* tab_contents) {
+ if (tab_contents->delegate())
+ tab_contents->delegate()->ContentsMouseEvent(tab_contents, false);
return FALSE;
}
// Called when the mouse moves within the widget. We notify our delegate.
gboolean OnMouseMove(GtkWidget* widget, GdkEventMotion* event,
- WebContents* web_contents) {
- if (web_contents->delegate())
- web_contents->delegate()->ContentsMouseEvent(web_contents, true);
+ TabContents* tab_contents) {
+ if (tab_contents->delegate())
+ tab_contents->delegate()->ContentsMouseEvent(tab_contents, true);
return FALSE;
}
} // namespace
// static
-TabContentsView* TabContentsView::Create(WebContents* web_contents) {
- return new TabContentsViewGtk(web_contents);
+TabContentsView* TabContentsView::Create(TabContents* tab_contents) {
+ return new TabContentsViewGtk(tab_contents);
}
-TabContentsViewGtk::TabContentsViewGtk(WebContents* web_contents)
- : TabContentsView(web_contents),
+TabContentsViewGtk::TabContentsViewGtk(TabContents* tab_contents)
+ : TabContentsView(tab_contents),
vbox_(gtk_vbox_new(FALSE, 0)),
content_view_(NULL) {
}
@@ -91,11 +91,11 @@ RenderWidgetHostView* TabContentsViewGtk::CreateViewForWidget(
view->InitAsChild();
content_view_ = view->native_view();
g_signal_connect(content_view_, "focus",
- G_CALLBACK(OnFocus), web_contents());
+ G_CALLBACK(OnFocus), tab_contents());
g_signal_connect(view->native_view(), "leave-notify-event",
- G_CALLBACK(OnLeaveNotify), web_contents());
+ G_CALLBACK(OnLeaveNotify), tab_contents());
g_signal_connect(view->native_view(), "motion-notify-event",
- G_CALLBACK(OnMouseMove), web_contents());
+ G_CALLBACK(OnMouseMove), tab_contents());
gtk_widget_add_events(view->native_view(), GDK_LEAVE_NOTIFY_MASK |
GDK_POINTER_MOTION_MASK);
g_signal_connect(view->native_view(), "button-press-event",
@@ -170,8 +170,8 @@ void TabContentsViewGtk::Focus() {
}
void TabContentsViewGtk::SetInitialFocus() {
- if (web_contents()->FocusLocationBarByDefault())
- web_contents()->delegate()->SetFocusToLocationBar();
+ if (tab_contents()->FocusLocationBarByDefault())
+ tab_contents()->delegate()->SetFocusToLocationBar();
else
gtk_widget_grab_focus(content_view_);
}
@@ -192,7 +192,7 @@ void TabContentsViewGtk::UpdateDragCursor(bool is_drop_target) {
// This is called when we the renderer asks us to take focus back (i.e., it has
// iterated past the last focusable element on the page).
void TabContentsViewGtk::TakeFocus(bool reverse) {
- web_contents()->delegate()->SetFocusToLocationBar();
+ tab_contents()->delegate()->SetFocusToLocationBar();
}
void TabContentsViewGtk::HandleKeyboardEvent(
@@ -225,7 +225,7 @@ void TabContentsViewGtk::OnFindReply(int request_id,
}
void TabContentsViewGtk::ShowContextMenu(const ContextMenuParams& params) {
- context_menu_.reset(new RenderViewContextMenuGtk(web_contents(), params,
+ context_menu_.reset(new RenderViewContextMenuGtk(tab_contents(), params,
last_mouse_down_time_));
context_menu_->Popup();
}
@@ -237,8 +237,8 @@ void TabContentsViewGtk::StartDragging(const WebDropData& drop_data) {
// already done with the drag and drop so we don't get stuck
// thinking we're in mid-drag.
// TODO(port): remove me when the above NOTIMPLEMENTED is fixed.
- if (web_contents()->render_view_host())
- web_contents()->render_view_host()->DragSourceSystemDragEnded();
+ if (tab_contents()->render_view_host())
+ tab_contents()->render_view_host()->DragSourceSystemDragEnded();
}
gboolean TabContentsViewGtk::OnMouseDown(GtkWidget* widget,
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.h b/chrome/browser/tab_contents/tab_contents_view_gtk.h
index 08c4388..6d24598 100644
--- a/chrome/browser/tab_contents/tab_contents_view_gtk.h
+++ b/chrome/browser/tab_contents/tab_contents_view_gtk.h
@@ -13,10 +13,10 @@ class RenderViewContextMenuGtk;
class TabContentsViewGtk : public TabContentsView {
public:
- // The corresponding WebContents is passed in the constructor, and manages our
+ // The corresponding TabContents is passed in the constructor, and manages our
// lifetime. This doesn't need to be the case, but is this way currently
// because that's what was easiest when they were split.
- explicit TabContentsViewGtk(WebContents* web_contents);
+ explicit TabContentsViewGtk(TabContents* tab_contents);
virtual ~TabContentsViewGtk();
// TabContentsView implementation --------------------------------------------
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.h b/chrome/browser/tab_contents/tab_contents_view_mac.h
index afd95bb1..0fd3c89 100644
--- a/chrome/browser/tab_contents/tab_contents_view_mac.h
+++ b/chrome/browser/tab_contents/tab_contents_view_mac.h
@@ -30,10 +30,10 @@ class TabContentsViewMac;
class TabContentsViewMac : public TabContentsView,
public NotificationObserver {
public:
- // The corresponding WebContents is passed in the constructor, and manages our
+ // The corresponding TabContents is passed in the constructor, and manages our
// lifetime. This doesn't need to be the case, but is this way currently
// because that's what was easiest when they were split.
- explicit TabContentsViewMac(WebContents* web_contents);
+ explicit TabContentsViewMac(TabContents* web_contents);
virtual ~TabContentsViewMac();
// TabContentsView implementation --------------------------------------------
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm
index cb4d8924..97cbf68 100644
--- a/chrome/browser/tab_contents/tab_contents_view_mac.mm
+++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm
@@ -9,7 +9,7 @@
#include "chrome/browser/renderer_host/render_widget_host.h"
#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
#include "chrome/browser/tab_contents/render_view_context_menu_mac.h"
-#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/notification_type.h"
#include "chrome/common/notification_service.h"
@@ -21,16 +21,16 @@
@end
// static
-TabContentsView* TabContentsView::Create(WebContents* web_contents) {
- return new TabContentsViewMac(web_contents);
+TabContentsView* TabContentsView::Create(TabContents* tab_contents) {
+ return new TabContentsViewMac(tab_contents);
}
-TabContentsViewMac::TabContentsViewMac(WebContents* web_contents)
- : TabContentsView(web_contents) {
- registrar_.Add(this, NotificationType::WEB_CONTENTS_CONNECTED,
- Source<WebContents>(web_contents));
- registrar_.Add(this, NotificationType::WEB_CONTENTS_DISCONNECTED,
- Source<WebContents>(web_contents));
+TabContentsViewMac::TabContentsViewMac(TabContents* tab_contents)
+ : TabContentsView(tab_contents) {
+ registrar_.Add(this, NotificationType::TAB_CONTENTS_CONNECTED,
+ Source<TabContents>(tab_contents));
+ registrar_.Add(this, NotificationType::TAB_CONTENTS_DISCONNECTED,
+ Source<TabContents>(tab_contents));
}
TabContentsViewMac::~TabContentsViewMac() {
@@ -63,9 +63,9 @@ gfx::NativeView TabContentsViewMac::GetNativeView() const {
}
gfx::NativeView TabContentsViewMac::GetContentNativeView() const {
- if (!web_contents()->render_widget_host_view())
+ if (!tab_contents()->render_widget_host_view())
return NULL;
- return web_contents()->render_widget_host_view()->GetPluginNativeView();
+ return tab_contents()->render_widget_host_view()->GetPluginNativeView();
}
gfx::NativeWindow TabContentsViewMac::GetTopLevelNativeWindow() const {
@@ -83,8 +83,8 @@ void TabContentsViewMac::StartDragging(const WebDropData& drop_data) {
// already done with the drag and drop so we don't get stuck
// thinking we're in mid-drag.
// TODO(port): remove me when the above NOTIMPLEMENTED is fixed.
- if (web_contents()->render_view_host())
- web_contents()->render_view_host()->DragSourceSystemDragEnded();
+ if (tab_contents()->render_view_host())
+ tab_contents()->render_view_host()->DragSourceSystemDragEnded();
}
void TabContentsViewMac::OnContentsDestroy() {
@@ -107,8 +107,8 @@ void TabContentsViewMac::Focus() {
}
void TabContentsViewMac::SetInitialFocus() {
- if (web_contents()->FocusLocationBarByDefault())
- web_contents()->delegate()->SetFocusToLocationBar();
+ if (tab_contents()->FocusLocationBarByDefault())
+ tab_contents()->delegate()->SetFocusToLocationBar();
else
[[cocoa_view_.get() window] makeFirstResponder:GetContentNativeView()];
}
@@ -143,7 +143,7 @@ void TabContentsViewMac::HandleKeyboardEvent(
}
void TabContentsViewMac::ShowContextMenu(const ContextMenuParams& params) {
- RenderViewContextMenuMac menu(web_contents(),
+ RenderViewContextMenuMac menu(tab_contents(),
params,
GetNativeView());
}
@@ -182,14 +182,14 @@ void TabContentsViewMac::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
switch (type.value) {
- case NotificationType::WEB_CONTENTS_CONNECTED: {
+ case NotificationType::tab_contents_CONNECTED: {
if (sad_tab_.get()) {
[sad_tab_.get() removeFromSuperview];
sad_tab_.reset();
}
break;
}
- case NotificationType::WEB_CONTENTS_DISCONNECTED: {
+ case NotificationType::tab_contents_DISCONNECTED: {
SadTabView* view = [[SadTabView alloc] initWithFrame:NSZeroRect];
sad_tab_.reset(view);
@@ -222,13 +222,13 @@ void TabContentsViewMac::Observe(NotificationType type,
}
- (void)mouseEvent:(NSEvent *)theEvent {
- if (TabContentsView_->web_contents()->delegate()) {
+ if (TabContentsView_->tab_contents()->delegate()) {
if ([theEvent type] == NSMouseMoved)
- TabContentsView_->web_contents()->delegate()->
- ContentsMouseEvent(TabContentsView_->web_contents(), true);
+ TabContentsView_->tab_contents()->delegate()->
+ ContentsMouseEvent(TabContentsView_->tab_contents(), true);
if ([theEvent type] == NSMouseExited)
- TabContentsView_->web_contents()->delegate()->
- ContentsMouseEvent(TabContentsView_->web_contents(), false);
+ TabContentsView_->tab_contents()->delegate()->
+ ContentsMouseEvent(TabContentsView_->tab_contents(), false);
}
}
@@ -237,15 +237,15 @@ void TabContentsViewMac::Observe(NotificationType type,
// WebCore.
- (void)cut:(id)sender {
- TabContentsView_->web_contents()->Cut();
+ TabContentsView_->tab_contents()->Cut();
}
- (void)copy:(id)sender {
- TabContentsView_->web_contents()->Copy();
+ TabContentsView_->tab_contents()->Copy();
}
- (void)paste:(id)sender {
- TabContentsView_->web_contents()->Paste();
+ TabContentsView_->tab_contents()->Paste();
}
// Tons of stuff goes here, where we grab events going on in Cocoaland and send
diff --git a/chrome/browser/tab_contents/tab_contents_view_win.cc b/chrome/browser/tab_contents/tab_contents_view_win.cc
index 6fee9c3..a1805a1 100644
--- a/chrome/browser/tab_contents/tab_contents_view_win.cc
+++ b/chrome/browser/tab_contents/tab_contents_view_win.cc
@@ -16,8 +16,8 @@
#include "chrome/browser/renderer_host/render_widget_host_view_win.h"
#include "chrome/browser/tab_contents/render_view_context_menu_win.h"
#include "chrome/browser/tab_contents/interstitial_page.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
-#include "chrome/browser/tab_contents/web_contents.h"
#include "chrome/browser/tab_contents/web_drag_source.h"
#include "chrome/browser/tab_contents/web_drop_target.h"
#include "chrome/browser/views/sad_tab_view.h"
@@ -47,12 +47,12 @@ BOOL CALLBACK DetachPluginWindowsCallback(HWND window, LPARAM param) {
} // namespace
// static
-TabContentsView* TabContentsView::Create(WebContents* web_contents) {
- return new TabContentsViewWin(web_contents);
+TabContentsView* TabContentsView::Create(TabContents* tab_contents) {
+ return new TabContentsViewWin(tab_contents);
}
-TabContentsViewWin::TabContentsViewWin(WebContents* web_contents)
- : TabContentsView(web_contents),
+TabContentsViewWin::TabContentsViewWin(TabContents* tab_contents)
+ : TabContentsView(tab_contents),
ignore_next_char_event_(false) {
last_focused_view_storage_id_ =
views::ViewStorage::GetSharedInstance()->CreateStorageID();
@@ -77,7 +77,7 @@ void TabContentsViewWin::CreateView() {
// Remove the root view drop target so we can register our own.
RevokeDragDrop(GetNativeView());
- drop_target_ = new WebDropTarget(GetNativeView(), web_contents());
+ drop_target_ = new WebDropTarget(GetNativeView(), tab_contents());
}
RenderWidgetHostView* TabContentsViewWin::CreateViewForWidget(
@@ -104,9 +104,9 @@ gfx::NativeView TabContentsViewWin::GetNativeView() const {
}
gfx::NativeView TabContentsViewWin::GetContentNativeView() const {
- if (!web_contents()->render_widget_host_view())
+ if (!tab_contents()->render_widget_host_view())
return NULL;
- return web_contents()->render_widget_host_view()->GetPluginNativeView();
+ return tab_contents()->render_widget_host_view()->GetPluginNativeView();
}
gfx::NativeWindow TabContentsViewWin::GetTopLevelNativeWindow() const {
@@ -153,7 +153,7 @@ void TabContentsViewWin::StartDragging(const WebDropData& drop_data) {
BookmarkDragData bm_drag_data;
bm_drag_data.elements.push_back(bm_elt);
- bm_drag_data.Write(web_contents()->profile(), data);
+ bm_drag_data.Write(tab_contents()->profile(), data);
} else {
data->SetURL(drop_data.url, drop_data.url_title);
}
@@ -162,7 +162,7 @@ void TabContentsViewWin::StartDragging(const WebDropData& drop_data) {
data->SetString(drop_data.plain_text);
scoped_refptr<WebDragSource> drag_source(
- new WebDragSource(GetNativeView(), web_contents()->render_view_host()));
+ new WebDragSource(GetNativeView(), tab_contents()->render_view_host()));
DWORD effects;
@@ -173,8 +173,8 @@ void TabContentsViewWin::StartDragging(const WebDropData& drop_data) {
DoDragDrop(data, drag_source, DROPEFFECT_COPY | DROPEFFECT_LINK, &effects);
MessageLoop::current()->SetNestableTasksAllowed(old_state);
- if (web_contents()->render_view_host())
- web_contents()->render_view_host()->DragSourceSystemDragEnded();
+ if (tab_contents()->render_view_host())
+ tab_contents()->render_view_host()->DragSourceSystemDragEnded();
}
void TabContentsViewWin::OnContentsDestroy() {
@@ -213,7 +213,7 @@ void TabContentsViewWin::SetPageTitle(const std::wstring& title) {
// TODO(brettw) this call seems messy the way it reaches into the widget
// view, and I'm not sure it's necessary. Maybe we should just remove it.
::SetWindowText(
- web_contents()->render_widget_host_view()->GetPluginNativeView(),
+ tab_contents()->render_widget_host_view()->GetPluginNativeView(),
title.c_str());
}
}
@@ -245,8 +245,8 @@ void TabContentsViewWin::Focus() {
}
void TabContentsViewWin::SetInitialFocus() {
- if (web_contents()->FocusLocationBarByDefault())
- web_contents()->delegate()->SetFocusToLocationBar();
+ if (tab_contents()->FocusLocationBarByDefault())
+ tab_contents()->delegate()->SetFocusToLocationBar();
else
::SetFocus(GetNativeView());
}
@@ -315,7 +315,7 @@ void TabContentsViewWin::UpdateDragCursor(bool is_drop_target) {
}
void TabContentsViewWin::TakeFocus(bool reverse) {
- if (!web_contents()->delegate()->TakeFocus(reverse)) {
+ if (!tab_contents()->delegate()->TakeFocus(reverse)) {
views::FocusManager* focus_manager =
views::FocusManager::GetFocusManager(GetNativeView());
@@ -378,7 +378,7 @@ void TabContentsViewWin::HandleKeyboardEvent(
}
void TabContentsViewWin::ShowContextMenu(const ContextMenuParams& params) {
- RenderViewContextMenuWin menu(web_contents(),
+ RenderViewContextMenuWin menu(tab_contents(),
params,
GetNativeView());
@@ -401,8 +401,8 @@ void TabContentsViewWin::OnHScroll(int scroll_type, short position,
void TabContentsViewWin::OnMouseLeave() {
// Let our delegate know that the mouse moved (useful for resetting status
// bubble state).
- if (web_contents()->delegate())
- web_contents()->delegate()->ContentsMouseEvent(web_contents(), false);
+ if (tab_contents()->delegate())
+ tab_contents()->delegate()->ContentsMouseEvent(tab_contents(), false);
SetMsgHandled(FALSE);
}
@@ -413,19 +413,19 @@ LRESULT TabContentsViewWin::OnMouseRange(UINT msg,
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN: {
// Make sure this TabContents is activated when it is clicked on.
- if (web_contents()->delegate())
- web_contents()->delegate()->ActivateContents(web_contents());
+ if (tab_contents()->delegate())
+ tab_contents()->delegate()->ActivateContents(tab_contents());
DownloadRequestManager* drm =
g_browser_process->download_request_manager();
if (drm)
- drm->OnUserGesture(web_contents());
+ drm->OnUserGesture(tab_contents());
break;
}
case WM_MOUSEMOVE:
// Let our delegate know that the mouse moved (useful for resetting status
// bubble state).
- if (web_contents()->delegate()) {
- web_contents()->delegate()->ContentsMouseEvent(web_contents(), true);
+ if (tab_contents()->delegate()) {
+ tab_contents()->delegate()->ContentsMouseEvent(tab_contents(), true);
}
break;
default:
@@ -436,8 +436,8 @@ LRESULT TabContentsViewWin::OnMouseRange(UINT msg,
}
void TabContentsViewWin::OnPaint(HDC junk_dc) {
- if (web_contents()->render_view_host() &&
- !web_contents()->render_view_host()->IsRenderViewLive()) {
+ if (tab_contents()->render_view_host() &&
+ !tab_contents()->render_view_host()->IsRenderViewLive()) {
if (!sad_tab_.get())
sad_tab_.reset(new SadTabView);
CRect cr;
@@ -485,9 +485,9 @@ void TabContentsViewWin::OnSetFocus(HWND window) {
// background from properly taking focus.
// We NULL-check the render_view_host_ here because Windows can send us
// messages during the destruction process after it has been destroyed.
- if (web_contents()->render_widget_host_view()) {
+ if (tab_contents()->render_widget_host_view()) {
HWND inner_hwnd =
- web_contents()->render_widget_host_view()->GetPluginNativeView();
+ tab_contents()->render_widget_host_view()->GetPluginNativeView();
if (::IsWindow(inner_hwnd))
::SetFocus(inner_hwnd);
}
@@ -502,7 +502,7 @@ void TabContentsViewWin::OnWindowPosChanged(WINDOWPOS* window_pos) {
if (window_pos->flags & SWP_HIDEWINDOW) {
WasHidden();
} else {
- // The WebContents was shown by a means other than the user selecting a
+ // The TabContents was shown by a means other than the user selecting a
// Tab, e.g. the window was minimized then restored.
if (window_pos->flags & SWP_SHOWWINDOW)
WasShown();
@@ -560,21 +560,21 @@ void TabContentsViewWin::ScrollCommon(UINT message, int scroll_type,
}
void TabContentsViewWin::WasHidden() {
- web_contents()->HideContents();
+ tab_contents()->HideContents();
}
void TabContentsViewWin::WasShown() {
- web_contents()->ShowContents();
+ tab_contents()->ShowContents();
}
void TabContentsViewWin::WasSized(const gfx::Size& size) {
- if (web_contents()->interstitial_page())
- web_contents()->interstitial_page()->SetSize(size);
- if (web_contents()->render_widget_host_view())
- web_contents()->render_widget_host_view()->SetSize(size);
+ if (tab_contents()->interstitial_page())
+ tab_contents()->interstitial_page()->SetSize(size);
+ if (tab_contents()->render_widget_host_view())
+ tab_contents()->render_widget_host_view()->SetSize(size);
// TODO(brettw) this function can probably be moved to this class.
- web_contents()->RepositionSupressedPopupsToFit(size);
+ tab_contents()->RepositionSupressedPopupsToFit(size);
}
bool TabContentsViewWin::ScrollZoom(int scroll_type) {
@@ -609,8 +609,8 @@ bool TabContentsViewWin::ScrollZoom(int scroll_type) {
}
void TabContentsViewWin::WheelZoom(int distance) {
- if (web_contents()->delegate()) {
+ if (tab_contents()->delegate()) {
bool zoom_in = distance > 0;
- web_contents()->delegate()->ContentsZoomChange(zoom_in);
+ tab_contents()->delegate()->ContentsZoomChange(zoom_in);
}
}
diff --git a/chrome/browser/tab_contents/tab_contents_view_win.h b/chrome/browser/tab_contents/tab_contents_view_win.h
index 8ef2765..001b770 100644
--- a/chrome/browser/tab_contents/tab_contents_view_win.h
+++ b/chrome/browser/tab_contents/tab_contents_view_win.h
@@ -20,10 +20,10 @@ class WebDropTarget;
class TabContentsViewWin : public TabContentsView,
public views::WidgetWin {
public:
- // The corresponding WebContents is passed in the constructor, and manages our
+ // The corresponding TabContents is passed in the constructor, and manages our
// lifetime. This doesn't need to be the case, but is this way currently
// because that's what was easiest when they were split.
- explicit TabContentsViewWin(WebContents* web_contents);
+ explicit TabContentsViewWin(TabContents* tab_contents);
virtual ~TabContentsViewWin();
// TabContentsView implementation --------------------------------------------
@@ -73,7 +73,7 @@ class TabContentsViewWin : public TabContentsView,
void ScrollCommon(UINT message, int scroll_type, short position,
HWND scrollbar);
- // Handles notifying the WebContents and other operations when the window was
+ // Handles notifying the TabContents and other operations when the window was
// shown or hidden.
void WasHidden();
void WasShown();
@@ -88,7 +88,7 @@ class TabContentsViewWin : public TabContentsView,
// ---------------------------------------------------------------------------
- // A drop target object that handles drags over this WebContents.
+ // A drop target object that handles drags over this TabContents.
scoped_refptr<WebDropTarget> drop_target_;
// Used to render the sad tab. This will be non-NULL only when the sad tab is
diff --git a/chrome/browser/tab_contents/tab_util.cc b/chrome/browser/tab_contents/tab_util.cc
index 5c53ddb..93b75fc 100644
--- a/chrome/browser/tab_contents/tab_util.cc
+++ b/chrome/browser/tab_contents/tab_util.cc
@@ -7,7 +7,7 @@
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
-#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "net/url_request/url_request.h"
bool tab_util::GetTabContentsID(URLRequest* request,
@@ -27,12 +27,12 @@ bool tab_util::GetTabContentsID(URLRequest* request,
return true;
}
-WebContents* tab_util::GetWebContentsByID(int render_process_id,
+TabContents* tab_util::GetTabContentsByID(int render_process_id,
int render_view_id) {
RenderViewHost* render_view_host =
RenderViewHost::FromID(render_process_id, render_view_id);
if (!render_view_host)
return NULL;
- return render_view_host->delegate()->GetAsWebContents();
+ return render_view_host->delegate()->GetAsTabContents();
}
diff --git a/chrome/browser/tab_contents/tab_util.h b/chrome/browser/tab_contents/tab_util.h
index 0745cf7..cbe9acd 100644
--- a/chrome/browser/tab_contents/tab_util.h
+++ b/chrome/browser/tab_contents/tab_util.h
@@ -6,7 +6,7 @@
#define CHROME_BROWSER_TAB_CONTENTS_TAB_UTIL_H_
class URLRequest;
-class WebContents;
+class TabContents;
namespace tab_util {
@@ -15,10 +15,10 @@ namespace tab_util {
bool GetTabContentsID(URLRequest* request, int* render_process_host_id,
int* routing_id);
-// Helper to find the WebContents that originated the given request. Can be
+// Helper to find the TabContents that originated the given request. Can be
// NULL if the tab has been closed or some other error occurs.
// Should only be called from the UI thread, since it accesses TabContent.
-WebContents* GetWebContentsByID(int render_process_host_id, int routing_id);
+TabContents* GetTabContentsByID(int render_process_host_id, int routing_id);
} // namespace tab_util
diff --git a/chrome/browser/tab_contents/test_web_contents.cc b/chrome/browser/tab_contents/test_web_contents.cc
index 6aa4c6a..bb5f4d06 100644
--- a/chrome/browser/tab_contents/test_web_contents.cc
+++ b/chrome/browser/tab_contents/test_web_contents.cc
@@ -6,12 +6,12 @@
#include "chrome/browser/renderer_host/test_render_view_host.h"
-TestWebContents::TestWebContents(Profile* profile, SiteInstance* instance)
- : WebContents(profile, instance, MSG_ROUTING_NONE, NULL),
+TestTabContents::TestTabContents(Profile* profile, SiteInstance* instance)
+ : TabContents(profile, instance, MSG_ROUTING_NONE, NULL),
transition_cross_site(false) {
}
-TestRenderViewHost* TestWebContents::pending_rvh() {
+TestRenderViewHost* TestTabContents::pending_rvh() {
return static_cast<TestRenderViewHost*>(
render_manager_.pending_render_view_host_);
}
diff --git a/chrome/browser/tab_contents/test_web_contents.h b/chrome/browser/tab_contents/test_web_contents.h
index dea7d6d..ea572a1 100644
--- a/chrome/browser/tab_contents/test_web_contents.h
+++ b/chrome/browser/tab_contents/test_web_contents.h
@@ -2,20 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_
-#define CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_
+#ifndef CHROME_BROWSER_TAB_CONTENTS_TEST_tab_contents_H_
+#define CHROME_BROWSER_TAB_CONTENTS_TEST_tab_contents_H_
-#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
class RenderViewHostFactory;
class TestRenderViewHost;
-// Subclass WebContents to ensure it creates TestRenderViewHosts and does
+// Subclass TabContents to ensure it creates TestRenderViewHosts and does
// not do anything involving views.
-class TestWebContents : public WebContents {
+class TestTabContents : public TabContents {
public:
// The render view host factory will be passed on to the
- TestWebContents(Profile* profile, SiteInstance* instance);
+ TestTabContents(Profile* profile, SiteInstance* instance);
TestRenderViewHost* pending_rvh();
@@ -24,7 +24,7 @@ class TestWebContents : public WebContents {
return render_manager_.cross_navigation_pending_;
}
- // Overrides WebContents::ShouldTransitionCrossSite so that we can test both
+ // Overrides TabContents::ShouldTransitionCrossSite so that we can test both
// alternatives without using command-line switches.
bool ShouldTransitionCrossSite() { return transition_cross_site; }
@@ -51,4 +51,4 @@ class TestWebContents : public WebContents {
bool transition_cross_site;
};
-#endif // CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_
+#endif // CHROME_BROWSER_TAB_CONTENTS_TEST_tab_contents_H_
diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc
deleted file mode 100644
index 255d605..0000000
--- a/chrome/browser/tab_contents/web_contents.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/tab_contents/web_contents.h"
-
-#include "base/command_line.h"
-#include "base/compiler_specific.h"
-#include "base/file_version_info.h"
-#include "base/string_util.h"
-#include "chrome/browser/autofill_manager.h"
-#include "chrome/browser/browser.h"
-#include "chrome/browser/character_encoding.h"
-#include "chrome/browser/debugger/devtools_manager.h"
-#include "chrome/browser/dom_operation_notification_details.h"
-#include "chrome/browser/dom_ui/dom_ui.h"
-#include "chrome/browser/dom_ui/dom_ui_factory.h"
-#include "chrome/browser/load_from_memory_cache_details.h"
-#include "chrome/browser/password_manager/password_manager.h"
-#include "chrome/browser/plugin_installer.h"
-#include "chrome/browser/profile.h"
-#include "chrome/browser/renderer_host/render_process_host.h"
-#include "chrome/browser/renderer_host/render_view_host.h"
-#include "chrome/browser/renderer_host/render_widget_host_view.h"
-#include "chrome/browser/renderer_host/web_cache_manager.h"
-#include "chrome/browser/tab_contents/navigation_entry.h"
-#include "chrome/browser/tab_contents/provisional_load_details.h"
-#include "chrome/browser/tab_contents/tab_contents_view.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/l10n_util.h"
-#include "chrome/common/notification_service.h"
-#include "chrome/common/pref_names.h"
-#include "chrome/common/pref_service.h"
-#include "chrome/common/url_constants.h"
-#include "webkit/glue/feed.h"
-#include "webkit/glue/webkit_glue.h"
-
-#if defined(OS_WIN)
-// TODO(port): fill these in as we flesh out the implementation of this class
-#include "chrome/browser/plugin_service.h"
-#include "chrome/browser/printing/print_job.h"
-#include "chrome/browser/views/hung_renderer_view.h" // TODO(brettw) delete me.
-#include "chrome/common/resource_bundle.h"
-#endif
-
-#include "grit/generated_resources.h"
diff --git a/chrome/browser/tab_contents/web_contents.h b/chrome/browser/tab_contents/web_contents.h
deleted file mode 100644
index c0e3600..0000000
--- a/chrome/browser/tab_contents/web_contents.h
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_H_
-#define CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_H_
-
-#include "chrome/browser/tab_contents/tab_contents.h"
-
-// TODO(brettw) this class is a placeholder until I can remove all references
-// to WebContents.
-class WebContents : public TabContents {
- public:
- WebContents(Profile* profile,
- SiteInstance* site_instance,
- int routing_id,
- base::WaitableEvent* modal_dialog_event)
- : TabContents(profile,
- site_instance,
- routing_id,
- modal_dialog_event) {
- }
-
- virtual ~WebContents() {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(WebContents);
-};
-
-#endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_H_
diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc
index 1a95044..a2fd641 100644
--- a/chrome/browser/tab_contents/web_contents_unittest.cc
+++ b/chrome/browser/tab_contents/web_contents_unittest.cc
@@ -36,9 +36,9 @@ static void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params,
}
// Subclass the TestingProfile so that it can return certain services we need.
-class WebContentsTestingProfile : public TestingProfile {
+class TabContentsTestingProfile : public TestingProfile {
public:
- WebContentsTestingProfile() : TestingProfile() { }
+ TabContentsTestingProfile() : TestingProfile() { }
virtual PrefService* GetPrefs() {
if (!prefs_.get()) {
@@ -78,7 +78,7 @@ class TestInterstitialPage : public InterstitialPage {
// interstitial, as in such a case it will be destroyed in the test TearDown
// method and will dereference the |deleted| local variable which by then is
// out of scope.
- TestInterstitialPage(WebContents* tab,
+ TestInterstitialPage(TabContents* tab,
bool new_navigation,
const GURL& url,
InterstitialState* state,
@@ -186,22 +186,22 @@ class TestInterstitialPageStateGuard : public TestInterstitialPage::Delegate {
TestInterstitialPage* interstitial_page_;
};
-class WebContentsTest : public RenderViewHostTestHarness {
+class TabContentsTest : public RenderViewHostTestHarness {
public:
- WebContentsTest() : RenderViewHostTestHarness() {
+ TabContentsTest() : RenderViewHostTestHarness() {
}
private:
// Supply our own profile so we use the correct profile data. The test harness
// is not supposed to overwrite a profile if it's already created.
virtual void SetUp() {
- profile_.reset(new WebContentsTestingProfile());
+ profile_.reset(new TabContentsTestingProfile());
RenderViewHostTestHarness::SetUp();
}
};
// Test to make sure that title updates get stripped of whitespace.
-TEST_F(WebContentsTest, UpdateTitle) {
+TEST_F(TabContentsTest, UpdateTitle) {
ViewHostMsg_FrameNavigate_Params params;
InitNavigateParams(&params, 0, GURL("about:blank"));
@@ -213,7 +213,7 @@ TEST_F(WebContentsTest, UpdateTitle) {
}
// Test view source mode for the new tabs page.
-TEST_F(WebContentsTest, NTPViewSource) {
+TEST_F(TabContentsTest, NTPViewSource) {
const char kUrl[] = "view-source:chrome-ui://newtab/";
const GURL kGURL(kUrl);
@@ -234,7 +234,7 @@ TEST_F(WebContentsTest, NTPViewSource) {
}
// Test simple same-SiteInstance navigation.
-TEST_F(WebContentsTest, SimpleNavigation) {
+TEST_F(TabContentsTest, SimpleNavigation) {
TestRenderViewHost* orig_rvh = rvh();
SiteInstance* instance1 = contents()->GetSiteInstance();
EXPECT_TRUE(contents()->pending_rvh() == NULL);
@@ -262,7 +262,7 @@ TEST_F(WebContentsTest, SimpleNavigation) {
// Test that navigating across a site boundary creates a new RenderViewHost
// with a new SiteInstance. Going back should do the same.
-TEST_F(WebContentsTest, CrossSiteBoundaries) {
+TEST_F(TabContentsTest, CrossSiteBoundaries) {
contents()->transition_cross_site = true;
TestRenderViewHost* orig_rvh = rvh();
int orig_rvh_delete_count = 0;
@@ -315,7 +315,7 @@ TEST_F(WebContentsTest, CrossSiteBoundaries) {
// Test that navigating across a site boundary after a crash creates a new
// RVH without requiring a cross-site transition (i.e., PENDING state).
-TEST_F(WebContentsTest, CrossSiteBoundariesAfterCrash) {
+TEST_F(TabContentsTest, CrossSiteBoundariesAfterCrash) {
contents()->transition_cross_site = true;
TestRenderViewHost* orig_rvh = rvh();
int orig_rvh_delete_count = 0;
@@ -358,7 +358,7 @@ TEST_F(WebContentsTest, CrossSiteBoundariesAfterCrash) {
// Test that opening a new tab in the same SiteInstance and then navigating
// both tabs to a new site will place both tabs in a single SiteInstance.
-TEST_F(WebContentsTest, NavigateTwoTabsCrossSite) {
+TEST_F(TabContentsTest, NavigateTwoTabsCrossSite) {
contents()->transition_cross_site = true;
TestRenderViewHost* orig_rvh = rvh();
SiteInstance* instance1 = contents()->GetSiteInstance();
@@ -371,7 +371,7 @@ TEST_F(WebContentsTest, NavigateTwoTabsCrossSite) {
contents()->TestDidNavigate(orig_rvh, params1);
// Open a new tab with the same SiteInstance, navigated to the same site.
- TestWebContents contents2(profile(), instance1);
+ TestTabContents contents2(profile(), instance1);
params1.page_id = 2; // Need this since the site instance is the same (which
// is the scope of page IDs) and we want to consider
// this a new page.
@@ -410,9 +410,9 @@ TEST_F(WebContentsTest, NavigateTwoTabsCrossSite) {
EXPECT_EQ(instance2a, instance2b);
}
-// Tests that WebContents uses the current URL, not the SiteInstance's site, to
+// Tests that TabContents uses the current URL, not the SiteInstance's site, to
// determine whether a navigation is cross-site.
-TEST_F(WebContentsTest, CrossSiteComparesAgainstCurrentPage) {
+TEST_F(TabContentsTest, CrossSiteComparesAgainstCurrentPage) {
contents()->transition_cross_site = true;
TestRenderViewHost* orig_rvh = rvh();
SiteInstance* instance1 = contents()->GetSiteInstance();
@@ -425,7 +425,7 @@ TEST_F(WebContentsTest, CrossSiteComparesAgainstCurrentPage) {
contents()->TestDidNavigate(orig_rvh, params1);
// Open a related tab to a second site.
- TestWebContents contents2(profile(), instance1);
+ TestTabContents contents2(profile(), instance1);
contents2.transition_cross_site = true;
const GURL url2("http://www.yahoo.com");
contents2.controller().LoadURL(url2, GURL(), PageTransition::TYPED);
@@ -464,7 +464,7 @@ TEST_F(WebContentsTest, CrossSiteComparesAgainstCurrentPage) {
// Test that the onbeforeunload and onunload handlers run when navigating
// across site boundaries.
-TEST_F(WebContentsTest, CrossSiteUnloadHandlers) {
+TEST_F(TabContentsTest, CrossSiteUnloadHandlers) {
contents()->transition_cross_site = true;
TestRenderViewHost* orig_rvh = rvh();
SiteInstance* instance1 = contents()->GetSiteInstance();
@@ -494,7 +494,7 @@ TEST_F(WebContentsTest, CrossSiteUnloadHandlers) {
// We won't hear DidNavigate until the onunload handler has finished running.
// (No way to simulate that here, but it involves a call from RDH to
- // WebContents::OnCrossSiteResponse.)
+ // TabContents::OnCrossSiteResponse.)
// DidNavigate from the pending page
ViewHostMsg_FrameNavigate_Params params2;
@@ -509,7 +509,7 @@ TEST_F(WebContentsTest, CrossSiteUnloadHandlers) {
// Test that NavigationEntries have the correct content state after going
// forward and back. Prevents regression for bug 1116137.
-TEST_F(WebContentsTest, NavigationEntryContentState) {
+TEST_F(TabContentsTest, NavigationEntryContentState) {
TestRenderViewHost* orig_rvh = rvh();
// Navigate to URL. There should be no committed entry yet.
@@ -547,7 +547,7 @@ TEST_F(WebContentsTest, NavigationEntryContentState) {
// Test that NavigationEntries have the correct content state after opening
// a new window to about:blank. Prevents regression for bug 1116137.
-TEST_F(WebContentsTest, NavigationEntryContentStateNewWindow) {
+TEST_F(TabContentsTest, NavigationEntryContentStateNewWindow) {
TestRenderViewHost* orig_rvh = rvh();
// When opening a new window, it is navigated to about:blank internally.
@@ -565,7 +565,7 @@ TEST_F(WebContentsTest, NavigationEntryContentStateNewWindow) {
// Tests to see that webkit preferences are properly loaded and copied over
// to a WebPreferences object.
-TEST_F(WebContentsTest, WebKitPrefs) {
+TEST_F(TabContentsTest, WebKitPrefs) {
WebPreferences webkit_prefs = contents()->TestGetWebkitPrefs();
// These values have been overridden by the profile preferences.
@@ -586,7 +586,7 @@ TEST_F(WebContentsTest, WebKitPrefs) {
// Test navigating to a page (with the navigation initiated from the browser,
// as when a URL is typed in the location bar) that shows an interstitial and
// creates a new navigation entry, then hiding it without proceeding.
-TEST_F(WebContentsTest,
+TEST_F(TabContentsTest,
ShowInterstitialFromBrowserWithNewNavigationDontProceed) {
// Navigate to a page.
GURL url1("http://www.google.com");
@@ -634,7 +634,7 @@ TEST_F(WebContentsTest,
// Test navigating to a page (with the navigation initiated from the renderer,
// as when clicking on a link in the page) that shows an interstitial and
// creates a new navigation entry, then hiding it without proceeding.
-TEST_F(WebContentsTest,
+TEST_F(TabContentsTest,
ShowInterstitiaFromRendererlWithNewNavigationDontProceed) {
// Navigate to a page.
GURL url1("http://www.google.com");
@@ -679,7 +679,7 @@ TEST_F(WebContentsTest,
// Test navigating to a page that shows an interstitial without creating a new
// navigation entry (this happens when the interstitial is triggered by a
// sub-resource in the page), then hiding it without proceeding.
-TEST_F(WebContentsTest, ShowInterstitialNoNewNavigationDontProceed) {
+TEST_F(TabContentsTest, ShowInterstitialNoNewNavigationDontProceed) {
// Navigate to a page.
GURL url1("http://www.google.com");
rvh()->SendNavigate(1, url1);
@@ -723,7 +723,7 @@ TEST_F(WebContentsTest, ShowInterstitialNoNewNavigationDontProceed) {
// Test navigating to a page (with the navigation initiated from the browser,
// as when a URL is typed in the location bar) that shows an interstitial and
// creates a new navigation entry, then proceeding.
-TEST_F(WebContentsTest,
+TEST_F(TabContentsTest,
ShowInterstitialFromBrowserNewNavigationProceed) {
// Navigate to a page.
GURL url1("http://www.google.com");
@@ -782,7 +782,7 @@ TEST_F(WebContentsTest,
// Test navigating to a page (with the navigation initiated from the renderer,
// as when clicking on a link in the page) that shows an interstitial and
// creates a new navigation entry, then proceeding.
-TEST_F(WebContentsTest,
+TEST_F(TabContentsTest,
ShowInterstitialFromRendererNewNavigationProceed) {
// Navigate to a page.
GURL url1("http://www.google.com");
@@ -837,7 +837,7 @@ TEST_F(WebContentsTest,
// Test navigating to a page that shows an interstitial without creating a new
// navigation entry (this happens when the interstitial is triggered by a
// sub-resource in the page), then proceeding.
-TEST_F(WebContentsTest, ShowInterstitialNoNewNavigationProceed) {
+TEST_F(TabContentsTest, ShowInterstitialNoNewNavigationProceed) {
// Navigate to a page so we have a navigation entry in the controller.
GURL url1("http://www.google.com");
rvh()->SendNavigate(1, url1);
@@ -882,7 +882,7 @@ TEST_F(WebContentsTest, ShowInterstitialNoNewNavigationProceed) {
}
// Test navigating to a page that shows an interstitial, then navigating away.
-TEST_F(WebContentsTest, ShowInterstitialThenNavigate) {
+TEST_F(TabContentsTest, ShowInterstitialThenNavigate) {
// Show interstitial.
TestInterstitialPage::InterstitialState state =
TestInterstitialPage::UNDECIDED;
@@ -903,7 +903,7 @@ TEST_F(WebContentsTest, ShowInterstitialThenNavigate) {
}
// Test navigating to a page that shows an interstitial, then close the tab.
-TEST_F(WebContentsTest, ShowInterstitialThenCloseTab) {
+TEST_F(TabContentsTest, ShowInterstitialThenCloseTab) {
// Show interstitial.
TestInterstitialPage::InterstitialState state =
TestInterstitialPage::UNDECIDED;
@@ -923,7 +923,7 @@ TEST_F(WebContentsTest, ShowInterstitialThenCloseTab) {
// Test that after Proceed is called and an interstitial is still shown, no more
// commands get executed.
-TEST_F(WebContentsTest, ShowInterstitialProceedMultipleCommands) {
+TEST_F(TabContentsTest, ShowInterstitialProceedMultipleCommands) {
// Navigate to a page so we have a navigation entry in the controller.
GURL url1("http://www.google.com");
rvh()->SendNavigate(1, url1);
@@ -957,7 +957,7 @@ TEST_F(WebContentsTest, ShowInterstitialProceedMultipleCommands) {
}
// Test showing an interstitial while another interstitial is already showing.
-TEST_F(WebContentsTest, ShowInterstitialOnInterstitial) {
+TEST_F(TabContentsTest, ShowInterstitialOnInterstitial) {
// Navigate to a page so we have a navigation entry in the controller.
GURL start_url("http://www.google.com");
rvh()->SendNavigate(1, start_url);
@@ -1007,7 +1007,7 @@ TEST_F(WebContentsTest, ShowInterstitialOnInterstitial) {
// Test showing an interstitial, proceeding and then navigating to another
// interstitial.
-TEST_F(WebContentsTest, ShowInterstitialProceedShowInterstitial) {
+TEST_F(TabContentsTest, ShowInterstitialProceedShowInterstitial) {
// Navigate to a page so we have a navigation entry in the controller.
GURL start_url("http://www.google.com");
rvh()->SendNavigate(1, start_url);
@@ -1062,7 +1062,7 @@ TEST_F(WebContentsTest, ShowInterstitialProceedShowInterstitial) {
// Test that navigating away from an interstitial while it's loading cause it
// not to show.
-TEST_F(WebContentsTest, NavigateBeforeInterstitialShows) {
+TEST_F(TabContentsTest, NavigateBeforeInterstitialShows) {
// Show an interstitial.
TestInterstitialPage::InterstitialState state =
TestInterstitialPage::UNDECIDED;
@@ -1090,7 +1090,7 @@ TEST_F(WebContentsTest, NavigateBeforeInterstitialShows) {
}
// Test showing an interstitial and have its renderer crash.
-TEST_F(WebContentsTest, InterstitialCrasher) {
+TEST_F(TabContentsTest, InterstitialCrasher) {
// Show an interstitial.
TestInterstitialPage::InterstitialState state =
TestInterstitialPage::UNDECIDED;
diff --git a/chrome/browser/tab_contents/web_drag_source.h b/chrome/browser/tab_contents/web_drag_source.h
index dc45792..9ba5bf9 100644
--- a/chrome/browser/tab_contents/web_drag_source.h
+++ b/chrome/browser/tab_contents/web_drag_source.h
@@ -22,7 +22,7 @@ class RenderViewHost;
//
// WebDragSource
//
-// An IDropSource implementation for a WebContents. Handles notifications sent
+// An IDropSource implementation for a TabContents. Handles notifications sent
// by an active drag-drop operation as the user mouses over other drop targets
// on their system. This object tells Windows whether or not the drag should
// continue, and supplies the appropriate cursors.
diff --git a/chrome/browser/tab_contents/web_drop_target.cc b/chrome/browser/tab_contents/web_drop_target.cc
index f934f62..7f9cbf7 100644
--- a/chrome/browser/tab_contents/web_drop_target.cc
+++ b/chrome/browser/tab_contents/web_drop_target.cc
@@ -10,7 +10,7 @@
#include "base/clipboard_util.h"
#include "base/gfx/point.h"
#include "chrome/browser/renderer_host/render_view_host.h"
-#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/os_exchange_data.h"
#include "googleurl/src/gurl.h"
#include "net/base/net_util.h"
@@ -38,8 +38,8 @@ DWORD GetPreferredDropEffect(DWORD effect) {
// in the drop data and handle links as navigations.
class InterstitialDropTarget {
public:
- explicit InterstitialDropTarget(WebContents* web_contents)
- : web_contents_(web_contents) {}
+ explicit InterstitialDropTarget(TabContents* tab_contents)
+ : tab_contents_(tab_contents) {}
DWORD OnDragEnter(IDataObject* data_object, DWORD effect) {
return ClipboardUtil::HasUrl(data_object) ? GetPreferredDropEffect(effect)
@@ -59,7 +59,7 @@ class InterstitialDropTarget {
std::wstring url;
std::wstring title;
ClipboardUtil::GetUrl(data_object, &url, &title);
- web_contents_->OpenURL(GURL(url), GURL(), CURRENT_TAB,
+ tab_contents_->OpenURL(GURL(url), GURL(), CURRENT_TAB,
PageTransition::AUTO_BOOKMARK);
return GetPreferredDropEffect(effect);
}
@@ -67,7 +67,7 @@ class InterstitialDropTarget {
}
private:
- WebContents* web_contents_;
+ TabContents* tab_contents_;
DISALLOW_EVIL_CONSTRUCTORS(InterstitialDropTarget);
};
@@ -75,12 +75,12 @@ class InterstitialDropTarget {
///////////////////////////////////////////////////////////////////////////////
// WebDropTarget, public:
-WebDropTarget::WebDropTarget(HWND source_hwnd, WebContents* web_contents)
+WebDropTarget::WebDropTarget(HWND source_hwnd, TabContents* tab_contents)
: BaseDropTarget(source_hwnd),
- web_contents_(web_contents),
+ tab_contents_(tab_contents),
current_rvh_(NULL),
is_drop_target_(false),
- interstitial_drop_target_(new InterstitialDropTarget(web_contents)) {
+ interstitial_drop_target_(new InterstitialDropTarget(tab_contents)) {
}
WebDropTarget::~WebDropTarget() {
@@ -90,12 +90,12 @@ DWORD WebDropTarget::OnDragEnter(IDataObject* data_object,
DWORD key_state,
POINT cursor_position,
DWORD effect) {
- current_rvh_ = web_contents_->render_view_host();
+ current_rvh_ = tab_contents_->render_view_host();
// Don't pass messages to the renderer if an interstitial page is showing
// because we don't want the interstitial page to navigate. Instead,
// pass the messages on to a separate interstitial DropTarget handler.
- if (web_contents_->showing_interstitial_page())
+ if (tab_contents_->showing_interstitial_page())
return interstitial_drop_target_->OnDragEnter(data_object, effect);
// TODO(tc): PopulateWebDropData can be slow depending on what is in the
@@ -110,7 +110,7 @@ DWORD WebDropTarget::OnDragEnter(IDataObject* data_object,
POINT client_pt = cursor_position;
ScreenToClient(GetHWND(), &client_pt);
- web_contents_->render_view_host()->DragTargetDragEnter(drop_data,
+ tab_contents_->render_view_host()->DragTargetDragEnter(drop_data,
gfx::Point(client_pt.x, client_pt.y),
gfx::Point(cursor_position.x, cursor_position.y));
@@ -124,15 +124,15 @@ DWORD WebDropTarget::OnDragOver(IDataObject* data_object,
POINT cursor_position,
DWORD effect) {
DCHECK(current_rvh_);
- if (current_rvh_ != web_contents_->render_view_host())
+ if (current_rvh_ != tab_contents_->render_view_host())
OnDragEnter(data_object, key_state, cursor_position, effect);
- if (web_contents_->showing_interstitial_page())
+ if (tab_contents_->showing_interstitial_page())
return interstitial_drop_target_->OnDragOver(data_object, effect);
POINT client_pt = cursor_position;
ScreenToClient(GetHWND(), &client_pt);
- web_contents_->render_view_host()->DragTargetDragOver(
+ tab_contents_->render_view_host()->DragTargetDragOver(
gfx::Point(client_pt.x, client_pt.y),
gfx::Point(cursor_position.x, cursor_position.y));
@@ -144,13 +144,13 @@ DWORD WebDropTarget::OnDragOver(IDataObject* data_object,
void WebDropTarget::OnDragLeave(IDataObject* data_object) {
DCHECK(current_rvh_);
- if (current_rvh_ != web_contents_->render_view_host())
+ if (current_rvh_ != tab_contents_->render_view_host())
return;
- if (web_contents_->showing_interstitial_page()) {
+ if (tab_contents_->showing_interstitial_page()) {
interstitial_drop_target_->OnDragLeave(data_object);
} else {
- web_contents_->render_view_host()->DragTargetDragLeave();
+ tab_contents_->render_view_host()->DragTargetDragLeave();
}
}
@@ -159,18 +159,18 @@ DWORD WebDropTarget::OnDrop(IDataObject* data_object,
POINT cursor_position,
DWORD effect) {
DCHECK(current_rvh_);
- if (current_rvh_ != web_contents_->render_view_host())
+ if (current_rvh_ != tab_contents_->render_view_host())
OnDragEnter(data_object, key_state, cursor_position, effect);
- if (web_contents_->showing_interstitial_page())
+ if (tab_contents_->showing_interstitial_page())
interstitial_drop_target_->OnDragOver(data_object, effect);
- if (web_contents_->showing_interstitial_page())
+ if (tab_contents_->showing_interstitial_page())
return interstitial_drop_target_->OnDrop(data_object, effect);
POINT client_pt = cursor_position;
ScreenToClient(GetHWND(), &client_pt);
- web_contents_->render_view_host()->DragTargetDrop(
+ tab_contents_->render_view_host()->DragTargetDrop(
gfx::Point(client_pt.x, client_pt.y),
gfx::Point(cursor_position.x, cursor_position.y));
diff --git a/chrome/browser/tab_contents/web_drop_target.h b/chrome/browser/tab_contents/web_drop_target.h
index 9a25b77..36894c8 100644
--- a/chrome/browser/tab_contents/web_drop_target.h
+++ b/chrome/browser/tab_contents/web_drop_target.h
@@ -10,21 +10,21 @@
class InterstitialDropTarget;
class RenderViewHost;
-class WebContents;
+class TabContents;
///////////////////////////////////////////////////////////////////////////////
//
// WebDropTarget
//
-// A helper object that provides drop capabilities to a WebContents. The
-// DropTarget handles drags that enter the region of the WebContents by
+// A helper object that provides drop capabilities to a TabContents. The
+// DropTarget handles drags that enter the region of the TabContents by
// passing on the events to the renderer.
//
class WebDropTarget : public BaseDropTarget {
public:
// Create a new WebDropTarget associating it with the given HWND and
- // WebContents.
- WebDropTarget(HWND source_hwnd, WebContents* contents);
+ // TabContents.
+ WebDropTarget(HWND source_hwnd, TabContents* contents);
virtual ~WebDropTarget();
void set_is_drop_target(bool is_drop_target) {
@@ -50,8 +50,8 @@ class WebDropTarget : public BaseDropTarget {
DWORD effect);
private:
- // Our associated WebContents.
- WebContents* web_contents_;
+ // Our associated TabContents.
+ TabContents* tab_contents_;
// We keep track of the render view host we're dragging over. If it changes
// during a drag, we need to re-send the DragEnter message. WARNING: