diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 07:58:34 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 07:58:34 +0000 |
commit | 57c6a6579cf274fe37d6196931a3034d90da7113 (patch) | |
tree | ec42313580156ccc039b5fee714ee12259cb08ee /chrome/browser/views | |
parent | b23c9e1f05d474adc327c85d87eacc77554976e0 (diff) | |
download | chromium_src-57c6a6579cf274fe37d6196931a3034d90da7113.zip chromium_src-57c6a6579cf274fe37d6196931a3034d90da7113.tar.gz chromium_src-57c6a6579cf274fe37d6196931a3034d90da7113.tar.bz2 |
Replace all occurrances of WebContents with TabContents.
Review URL: http://codereview.chromium.org/99177
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15194 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/constrained_window_impl.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/dom_view.cc | 12 | ||||
-rw-r--r-- | chrome/browser/views/dom_view.h | 4 | ||||
-rw-r--r-- | chrome/browser/views/external_protocol_dialog.cc | 6 | ||||
-rw-r--r-- | chrome/browser/views/external_protocol_dialog.h | 2 | ||||
-rw-r--r-- | chrome/browser/views/find_bar_view.cc | 16 | ||||
-rw-r--r-- | chrome/browser/views/find_bar_win.cc | 16 | ||||
-rw-r--r-- | chrome/browser/views/find_bar_win_browsertest.cc | 42 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 10 | ||||
-rw-r--r-- | chrome/browser/views/html_dialog_view.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/hung_renderer_view.cc | 54 | ||||
-rw-r--r-- | chrome/browser/views/hung_renderer_view.h | 6 | ||||
-rw-r--r-- | chrome/browser/views/jsmessage_box_dialog.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/jsmessage_box_dialog.h | 6 | ||||
-rw-r--r-- | chrome/browser/views/sad_tab_view.h | 2 | ||||
-rw-r--r-- | chrome/browser/views/tab_contents_container_view.cc | 17 | ||||
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_controller.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab_strip.cc | 2 |
18 files changed, 101 insertions, 108 deletions
diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc index bd58c47..e049630 100644 --- a/chrome/browser/views/constrained_window_impl.cc +++ b/chrome/browser/views/constrained_window_impl.cc @@ -9,7 +9,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/tab_contents.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/browser/toolbar_model.h" #include "chrome/browser/views/frame/browser_view.h" @@ -618,7 +618,7 @@ void ConstrainedWindowImpl::ActivateConstrainedWindow() { // We could not have a parent focus manager if the ConstrainedWindow is // displayed in a tab that is not currently selected. // TODO(jcampan): we should store the ConstrainedWindow active events in - // that case and replay them when the WebContents becomes selected. + // that case and replay them when the TabContents becomes selected. focus_manager->StoreFocusedView(); // Give our window the focus so we get keyboard messages. diff --git a/chrome/browser/views/dom_view.cc b/chrome/browser/views/dom_view.cc index ffa9c1d..fbbd2f5 100644 --- a/chrome/browser/views/dom_view.cc +++ b/chrome/browser/views/dom_view.cc @@ -4,14 +4,14 @@ #include "chrome/browser/views/dom_view.h" -#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/tab_contents.h" -DOMView::DOMView() : initialized_(false), web_contents_(NULL) { +DOMView::DOMView() : initialized_(false), tab_contents_(NULL) { SetFocusable(true); } DOMView::~DOMView() { - if (web_contents_.get()) + if (tab_contents_.get()) Detach(); } @@ -20,13 +20,13 @@ bool DOMView::Init(Profile* profile, SiteInstance* instance) { return true; initialized_ = true; - web_contents_.reset(new WebContents(profile, instance, + tab_contents_.reset(new TabContents(profile, instance, MSG_ROUTING_NONE, NULL)); - views::HWNDView::Attach(web_contents_->GetNativeView()); + views::HWNDView::Attach(tab_contents_->GetNativeView()); return true; } void DOMView::LoadURL(const GURL& url) { DCHECK(initialized_); - web_contents_->controller().LoadURL(url, GURL(), PageTransition::START_PAGE); + tab_contents_->controller().LoadURL(url, GURL(), PageTransition::START_PAGE); } diff --git a/chrome/browser/views/dom_view.h b/chrome/browser/views/dom_view.h index 132a444..cf60430 100644 --- a/chrome/browser/views/dom_view.h +++ b/chrome/browser/views/dom_view.h @@ -14,7 +14,7 @@ class Profile; class SiteInstance; -class WebContents; +class TabContents; class DOMView : public views::HWNDView { public: @@ -35,7 +35,7 @@ class DOMView : public views::HWNDView { protected: virtual bool CanProcessTabKeyEvents() { return true; } - scoped_ptr<WebContents> web_contents_; + scoped_ptr<TabContents> tab_contents_; private: bool initialized_; diff --git a/chrome/browser/views/external_protocol_dialog.cc b/chrome/browser/views/external_protocol_dialog.cc index 24f004c..2dca539 100644 --- a/chrome/browser/views/external_protocol_dialog.cc +++ b/chrome/browser/views/external_protocol_dialog.cc @@ -11,7 +11,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/external_protocol_handler.h" #include "chrome/browser/tab_contents/tab_util.h" -#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/l10n_util.h" #include "chrome/common/message_box_flags.h" #include "chrome/views/controls/message_box_view.h" @@ -32,10 +32,10 @@ const int kMessageWidth = 400; void ExternalProtocolDialog::RunExternalProtocolDialog( const GURL& url, const std::wstring& command, int render_process_host_id, int routing_id) { - WebContents* web_contents = tab_util::GetWebContentsByID( + TabContents* tab_contents = tab_util::GetTabContentsByID( render_process_host_id, routing_id); ExternalProtocolDialog* handler = - new ExternalProtocolDialog(web_contents, url, command); + new ExternalProtocolDialog(tab_contents, url, command); } ExternalProtocolDialog::~ExternalProtocolDialog() { diff --git a/chrome/browser/views/external_protocol_dialog.h b/chrome/browser/views/external_protocol_dialog.h index 860178f..548c54e 100644 --- a/chrome/browser/views/external_protocol_dialog.h +++ b/chrome/browser/views/external_protocol_dialog.h @@ -18,7 +18,7 @@ class ExternalProtocolDialog : public views::DialogDelegate { // |url| - The url of the request. // |command| - the command that ShellExecute will run. // |render_process_host_id| and |routing_id| are used by - // tab_util::GetWebContentsByID to aquire the tab contents associated with + // tab_util::GetTabContentsByID to aquire the tab contents associated with // this dialog. // NOTE: There is a race between the Time of Check and the Time Of Use for // the command line. Since the caller (web page) does not have access diff --git a/chrome/browser/views/find_bar_view.cc b/chrome/browser/views/find_bar_view.cc index f348c29..cecf4e8 100644 --- a/chrome/browser/views/find_bar_view.cc +++ b/chrome/browser/views/find_bar_view.cc @@ -8,7 +8,7 @@ #include "base/string_util.h" #include "chrome/browser/find_bar_controller.h" -#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/views/find_bar_win.h" #include "chrome/browser/view_ids.h" #include "chrome/common/l10n_util.h" @@ -429,7 +429,7 @@ void FindBarView::ButtonPressed(views::Button* sender) { case FIND_PREVIOUS_TAG: case FIND_NEXT_TAG: if (find_text_->GetText().length() > 0) { - container_->GetFindBarController()->web_contents()->StartFinding( + container_->GetFindBarController()->tab_contents()->StartFinding( find_text_->GetText(), sender->tag() == FIND_NEXT_TAG); } @@ -455,21 +455,21 @@ void FindBarView::ContentsChanged(views::TextField* sender, const std::wstring& new_contents) { FindBarController* controller = container_->GetFindBarController(); DCHECK(controller); - // We must guard against a NULL web_contents, which can happen if the text + // We must guard against a NULL tab_contents, which can happen if the text // in the Find box is changed right after the tab is destroyed. Otherwise, it // can lead to crashes, as exposed by automation testing in issue 8048. - if (!controller->web_contents()) + if (!controller->tab_contents()) return; // When the user changes something in the text box we check the contents and // if the textbox contains something we set it as the new search string and // initiate search (even though old searches might be in progress). if (new_contents.length() > 0) { - controller->web_contents()->StartFinding(new_contents, true); + controller->tab_contents()->StartFinding(new_contents, true); } else { // The textbox is empty so we reset. true = clear selection on page. - controller->web_contents()->StopFinding(true); - UpdateForResult(controller->web_contents()->find_result(), std::wstring()); + controller->tab_contents()->StopFinding(true); + UpdateForResult(controller->tab_contents()->find_result(), std::wstring()); } } @@ -491,7 +491,7 @@ bool FindBarView::HandleKeystroke(views::TextField* sender, UINT message, std::wstring find_string = find_text_->GetText(); if (find_string.length() > 0) { // Search forwards for enter, backwards for shift-enter. - container_->GetFindBarController()->web_contents()->StartFinding( + container_->GetFindBarController()->tab_contents()->StartFinding( find_string, GetKeyState(VK_SHIFT) >= 0); } diff --git a/chrome/browser/views/find_bar_win.cc b/chrome/browser/views/find_bar_win.cc index c60e998..5c4d7e75 100644 --- a/chrome/browser/views/find_bar_win.cc +++ b/chrome/browser/views/find_bar_win.cc @@ -12,7 +12,7 @@ #include "chrome/browser/views/bookmark_bar_view.h" #include "chrome/browser/views/find_bar_view.h" #include "chrome/browser/views/frame/browser_view.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/views/focus/external_focus_tracker.h" #include "chrome/views/focus/view_storage.h" @@ -39,7 +39,7 @@ FindBarWin::FindBarWin(BrowserView* browser_view) SetFocusChangeListener(parent_hwnd); // Don't let WidgetWin manage our lifetime. We want our lifetime to - // coincide with WebContents. + // coincide with TabContents. WidgetWin::set_delete_on_destroy(false); view_ = new FindBarView(this); @@ -217,11 +217,11 @@ bool FindBarWin::IsFindBarVisible() { void FindBarWin::MoveWindowIfNecessary(const gfx::Rect& selection_rect, bool no_redraw) { - // We only move the window if one is active for the current WebContents. If we + // We only move the window if one is active for the current TabContents. If we // don't check this, then SetDialogPosition below will end up making the Find // Bar visible. - if (!find_bar_controller_->web_contents() || - !find_bar_controller_->web_contents()->find_ui_active()) { + if (!find_bar_controller_->tab_contents() || + !find_bar_controller_->tab_contents()->find_ui_active()) { return; } @@ -253,7 +253,7 @@ bool FindBarWin::MaybeForwardKeystrokeToWebpage( return false; } - WebContents* contents = find_bar_controller_->web_contents(); + TabContents* contents = find_bar_controller_->tab_contents(); if (!contents) return false; @@ -425,7 +425,7 @@ gfx::Rect FindBarWin::GetDialogPosition(gfx::Rect avoid_overlapping_rect) { RECT frame_rect = {0}, webcontents_rect = {0}; ::GetWindowRect(GetParent(), &frame_rect); ::GetWindowRect( - find_bar_controller_->web_contents()->view()->GetNativeView(), + find_bar_controller_->tab_contents()->view()->GetNativeView(), &webcontents_rect); avoid_overlapping_rect.Offset(0, webcontents_rect.top - frame_rect.top); } @@ -503,7 +503,7 @@ void FindBarWin::SetFocusChangeListener(HWND parent_hwnd) { void FindBarWin::RestoreSavedFocus() { if (focus_tracker_.get() == NULL) { // TODO(brettw) Focus() should be on TabContentsView. - find_bar_controller_->web_contents()->Focus(); + find_bar_controller_->tab_contents()->Focus(); } else { focus_tracker_->FocusLastFocusedExternalView(); } diff --git a/chrome/browser/views/find_bar_win_browsertest.cc b/chrome/browser/views/find_bar_win_browsertest.cc index 744560a..3f93af5 100644 --- a/chrome/browser/views/find_bar_win_browsertest.cc +++ b/chrome/browser/views/find_bar_win_browsertest.cc @@ -8,7 +8,6 @@ #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tab_contents/tab_contents_view.h" -#include "chrome/browser/tab_contents/web_contents.h" #include "chrome/browser/views/find_bar_win.h" #include "chrome/common/notification_service.h" #include "chrome/test/in_process_browser_test.h" @@ -89,18 +88,14 @@ class FindInPageControllerTest : public InProcessBrowserTest { FindInPageDirection forward, FindInPageCase match_case, bool find_next) { - WebContents* web_contents = - browser()->GetSelectedTabContents()->AsWebContents(); - if (web_contents) { - web_contents->set_current_find_request_id( - FindInPageNotificationObserver::kFindInPageRequestId); - web_contents->render_view_host()->StartFinding( - FindInPageNotificationObserver::kFindInPageRequestId, - search_string, forward == FWD, match_case == CASE_SENSITIVE, - find_next); - return FindInPageNotificationObserver(web_contents).number_of_matches(); - } - return 0; + TabContents* tab_contents = browser()->GetSelectedTabContents(); + tab_contents->set_current_find_request_id( + FindInPageNotificationObserver::kFindInPageRequestId); + tab_contents->render_view_host()->StartFinding( + FindInPageNotificationObserver::kFindInPageRequestId, + search_string, forward == FWD, match_case == CASE_SENSITIVE, + find_next); + return FindInPageNotificationObserver(tab_contents).number_of_matches(); } }; @@ -148,10 +143,10 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageFrames) { EXPECT_EQ(0, FindInPage(L"hreggvi\u00F0ur", FWD, CASE_SENSITIVE, false)); } -std::string FocusedOnPage(WebContents* web_contents) { +std::string FocusedOnPage(TabContents* tab_contents) { std::string result; ui_test_utils::ExecuteJavaScriptAndExtractString( - web_contents, + tab_contents, L"", L"window.domAutomationController.send(getFocusedElement());", &result); @@ -168,21 +163,20 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageEndState) { GURL url = server->TestServerPageW(kEndState); ui_test_utils::NavigateToURL(browser(), url); - WebContents* web_contents = - browser()->GetSelectedTabContents()->AsWebContents(); - ASSERT_TRUE(NULL != web_contents); + TabContents* tab_contents = browser()->GetSelectedTabContents(); + ASSERT_TRUE(NULL != tab_contents); // Verify that nothing has focus. - ASSERT_STREQ("{nothing focused}", FocusedOnPage(web_contents).c_str()); + ASSERT_STREQ("{nothing focused}", FocusedOnPage(tab_contents).c_str()); // Search for a text that exists within a link on the page. EXPECT_EQ(1, FindInPage(L"nk", FWD, IGNORE_CASE, false)); // End the find session, which should set focus to the link. - web_contents->StopFinding(false); + tab_contents->StopFinding(false); // Verify that the link is focused. - EXPECT_STREQ("link1", FocusedOnPage(web_contents).c_str()); + EXPECT_STREQ("link1", FocusedOnPage(tab_contents).c_str()); // Search for a text that exists within a link on the page. EXPECT_EQ(1, FindInPage(L"Google", FWD, IGNORE_CASE, false)); @@ -190,14 +184,14 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageEndState) { // Move the selection to link 1, after searching. std::string result; ui_test_utils::ExecuteJavaScriptAndExtractString( - web_contents, + tab_contents, L"", L"window.domAutomationController.send(selectLink1());", &result); // End the find session. - web_contents->StopFinding(false); + tab_contents->StopFinding(false); // Verify that link2 is not focused. - EXPECT_STREQ("", FocusedOnPage(web_contents).c_str()); + EXPECT_STREQ("", FocusedOnPage(tab_contents).c_str()); } diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 6039045..b4f68f6 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -40,7 +40,7 @@ #include "chrome/browser/views/toolbar_view.h" #include "chrome/browser/sessions/tab_restore_service.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/browser/window_sizer.h" #include "chrome/common/chrome_switches.h" @@ -335,8 +335,8 @@ void BrowserView::WindowMoved() { void BrowserView::WindowMoveOrResizeStarted() { TabContents* tab_contents = GetSelectedTabContents(); - if (tab_contents && tab_contents->AsWebContents()) - tab_contents->AsWebContents()->WindowMoveOrResizeStarted(); + if (tab_contents) + tab_contents->WindowMoveOrResizeStarted(); } gfx::Rect BrowserView::GetToolbarBounds() const { @@ -524,8 +524,8 @@ void BrowserView::Show() { // If we do find there are cases where we need to restore the focus on show, // that should be added and this should be removed. TabContents* selected_tab_contents = GetSelectedTabContents(); - if (selected_tab_contents && selected_tab_contents->AsWebContents()) - selected_tab_contents->AsWebContents()->view()->RestoreFocus(); + if (selected_tab_contents) + selected_tab_contents->view()->RestoreFocus(); frame_->Show(); } diff --git a/chrome/browser/views/html_dialog_view.cc b/chrome/browser/views/html_dialog_view.cc index 1ce1a1f..28f7bb1 100644 --- a/chrome/browser/views/html_dialog_view.cc +++ b/chrome/browser/views/html_dialog_view.cc @@ -5,7 +5,7 @@ #include "chrome/browser/views/html_dialog_view.h" #include "chrome/browser/browser.h" -#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/views/widget/root_view.h" #include "chrome/views/window/window.h" @@ -101,7 +101,7 @@ void HtmlDialogView::InitDialog() { // Set the delegate. This must be done before loading the page. See // the comment above HtmlDialogUI in its header file for why. - HtmlDialogUI::GetPropertyAccessor().SetProperty(web_contents_->property_bag(), + HtmlDialogUI::GetPropertyAccessor().SetProperty(tab_contents_->property_bag(), this); DOMView::LoadURL(delegate_->GetDialogContentURL()); diff --git a/chrome/browser/views/hung_renderer_view.cc b/chrome/browser/views/hung_renderer_view.cc index 9b7b8ec8..c203893 100644 --- a/chrome/browser/views/hung_renderer_view.cc +++ b/chrome/browser/views/hung_renderer_view.cc @@ -8,7 +8,7 @@ #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/views/standard_layout.h" -#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/gfx/chrome_canvas.h" #include "chrome/common/gfx/path.h" @@ -35,7 +35,7 @@ class HungPagesTableModel : public views::GroupTableModel { HungPagesTableModel(); virtual ~HungPagesTableModel(); - void InitForWebContents(WebContents* hung_contents); + void InitForTabContents(TabContents* hung_contents); // Overridden from views::GroupTableModel: virtual int RowCount(); @@ -45,8 +45,8 @@ class HungPagesTableModel : public views::GroupTableModel { virtual void GetGroupRangeForItem(int item, views::GroupRange* range); private: - typedef std::vector<WebContents*> WebContentsVector; - WebContentsVector webcontentses_; + typedef std::vector<TabContents*> TabContentsVector; + TabContentsVector tab_contentses_; views::TableModelObserver* observer_; @@ -62,11 +62,11 @@ HungPagesTableModel::HungPagesTableModel() : observer_(NULL) { HungPagesTableModel::~HungPagesTableModel() { } -void HungPagesTableModel::InitForWebContents(WebContents* hung_contents) { - webcontentses_.clear(); - for (WebContentsIterator it; !it.done(); ++it) { +void HungPagesTableModel::InitForTabContents(TabContents* hung_contents) { + tab_contentses_.clear(); + for (TabContentsIterator it; !it.done(); ++it) { if (it->process() == hung_contents->process()) - webcontentses_.push_back(*it); + tab_contentses_.push_back(*it); } // The world is different. if (observer_) @@ -77,12 +77,12 @@ void HungPagesTableModel::InitForWebContents(WebContents* hung_contents) { // HungPagesTableModel, views::GroupTableModel implementation: int HungPagesTableModel::RowCount() { - return static_cast<int>(webcontentses_.size()); + return static_cast<int>(tab_contentses_.size()); } std::wstring HungPagesTableModel::GetText(int row, int column_id) { DCHECK(row >= 0 && row < RowCount()); - std::wstring title = UTF16ToWideHack(webcontentses_.at(row)->GetTitle()); + std::wstring title = UTF16ToWideHack(tab_contentses_.at(row)->GetTitle()); if (title.empty()) title = l10n_util::GetString(IDS_TAB_UNTITLED_TITLE); // TODO(xji): Consider adding a special case if the title text is a URL, @@ -94,7 +94,7 @@ std::wstring HungPagesTableModel::GetText(int row, int column_id) { SkBitmap HungPagesTableModel::GetIcon(int row) { DCHECK(row >= 0 && row < RowCount()); - return webcontentses_.at(row)->GetFavIcon(); + return tab_contentses_.at(row)->GetFavIcon(); } void HungPagesTableModel::SetObserver(views::TableModelObserver* observer) { @@ -118,8 +118,8 @@ class HungRendererWarningView : public views::View, HungRendererWarningView(); ~HungRendererWarningView(); - void ShowForWebContents(WebContents* contents); - void EndForWebContents(WebContents* contents); + void ShowForTabContents(TabContents* contents); + void EndForTabContents(TabContents* contents); // views::WindowDelegate overrides: virtual std::wstring GetWindowTitle() const; @@ -146,8 +146,8 @@ class HungRendererWarningView : public views::View, void CreateKillButtonView(); // Returns the bounds the dialog should be displayed at to be meaningfully - // associated with the specified WebContents. - gfx::Rect GetDisplayBounds(WebContents* contents); + // associated with the specified TabContents. + gfx::Rect GetDisplayBounds(TabContents* contents); static void InitClass(); @@ -173,9 +173,9 @@ class HungRendererWarningView : public views::View, // pages affected by the hang. scoped_ptr<HungPagesTableModel> hung_pages_table_model_; - // The WebContents that we detected had hung in the first place resulting in + // The TabContents that we detected had hung in the first place resulting in // the display of this view. - WebContents* contents_; + TabContents* contents_; // Whether or not we've created controls for ourself. bool initialized_; @@ -215,7 +215,7 @@ HungRendererWarningView::~HungRendererWarningView() { hung_pages_table_->SetModel(NULL); } -void HungRendererWarningView::ShowForWebContents(WebContents* contents) { +void HungRendererWarningView::ShowForTabContents(TabContents* contents) { DCHECK(contents && window()); contents_ = contents; @@ -234,21 +234,21 @@ void HungRendererWarningView::ShowForWebContents(WebContents* contents) { window()->SetBounds(bounds, frame_hwnd); // We only do this if the window isn't active (i.e. hasn't been shown yet, - // or is currently shown but deactivated for another WebContents). This is + // or is currently shown but deactivated for another TabContents). This is // because this window is a singleton, and it's possible another active // renderer may hang while this one is showing, and we don't want to reset // the list of hung pages for a potentially unrelated renderer while this // one is showing. - hung_pages_table_model_->InitForWebContents(contents); + hung_pages_table_model_->InitForTabContents(contents); window()->Show(); } } -void HungRendererWarningView::EndForWebContents(WebContents* contents) { +void HungRendererWarningView::EndForTabContents(TabContents* contents) { DCHECK(contents); if (contents_ && contents_->process() == contents->process()) { window()->Close(); - // Since we're closing, we no longer need this WebContents. + // Since we're closing, we no longer need this TabContents. contents_ = NULL; } } @@ -397,7 +397,7 @@ void HungRendererWarningView::CreateKillButtonView() { } gfx::Rect HungRendererWarningView::GetDisplayBounds( - WebContents* contents) { + TabContents* contents) { HWND contents_hwnd = contents->GetNativeView(); CRect contents_bounds; GetWindowRect(contents_hwnd, &contents_bounds); @@ -434,16 +434,16 @@ static HungRendererWarningView* CreateHungRendererWarningView() { } // static -void HungRendererWarning::ShowForWebContents(WebContents* contents) { +void HungRendererWarning::ShowForTabContents(TabContents* contents) { if (!logging::DialogsAreSuppressed()) { if (!instance_) instance_ = CreateHungRendererWarningView(); - instance_->ShowForWebContents(contents); + instance_->ShowForTabContents(contents); } } // static -void HungRendererWarning::HideForWebContents(WebContents* contents) { +void HungRendererWarning::HideForTabContents(TabContents* contents) { if (!logging::DialogsAreSuppressed() && instance_) - instance_->EndForWebContents(contents); + instance_->EndForTabContents(contents); } diff --git a/chrome/browser/views/hung_renderer_view.h b/chrome/browser/views/hung_renderer_view.h index 0b26e90..def210e 100644 --- a/chrome/browser/views/hung_renderer_view.h +++ b/chrome/browser/views/hung_renderer_view.h @@ -11,12 +11,12 @@ class HungRendererWarningView; namespace views { class Window; } -class WebContents; +class TabContents; class HungRendererWarning { public: - static void ShowForWebContents(WebContents* contents); - static void HideForWebContents(WebContents* contents); + static void ShowForTabContents(TabContents* contents); + static void HideForTabContents(TabContents* contents); private: friend HungRendererWarningView; diff --git a/chrome/browser/views/jsmessage_box_dialog.cc b/chrome/browser/views/jsmessage_box_dialog.cc index 1889317..7deca87 100644 --- a/chrome/browser/views/jsmessage_box_dialog.cc +++ b/chrome/browser/views/jsmessage_box_dialog.cc @@ -5,7 +5,7 @@ #include "chrome/browser/views/jsmessage_box_dialog.h" #include "chrome/browser/app_modal_dialog.h" -#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/l10n_util.h" #include "chrome/common/message_box_flags.h" #include "chrome/views/controls/message_box_view.h" @@ -36,7 +36,7 @@ JavascriptMessageBoxDialog::~JavascriptMessageBoxDialog() { } void JavascriptMessageBoxDialog::ShowModalDialog() { - HWND root_hwnd = GetAncestor(web_contents()->GetNativeView(), + HWND root_hwnd = GetAncestor(tab_contents()->GetNativeView(), GA_ROOT); dialog_ = views::Window::CreateChromeWindow(root_hwnd, gfx::Rect(), this); dialog_->Show(); diff --git a/chrome/browser/views/jsmessage_box_dialog.h b/chrome/browser/views/jsmessage_box_dialog.h index e86e8ac..cd64c9a 100644 --- a/chrome/browser/views/jsmessage_box_dialog.h +++ b/chrome/browser/views/jsmessage_box_dialog.h @@ -11,7 +11,7 @@ #include "chrome/views/window/dialog_delegate.h" class MessageBoxView; -class WebContents; +class TabContents; namespace views { class Window; } @@ -46,8 +46,8 @@ class JavascriptMessageBoxDialog : public views::DialogDelegate { virtual views::View* GetInitiallyFocusedView(); private: - WebContents* web_contents() { - return parent_->web_contents(); + TabContents* tab_contents() { + return parent_->tab_contents(); } // A pointer to the AppModalDialog that owns us. diff --git a/chrome/browser/views/sad_tab_view.h b/chrome/browser/views/sad_tab_view.h index 766ad77..3013ecf 100644 --- a/chrome/browser/views/sad_tab_view.h +++ b/chrome/browser/views/sad_tab_view.h @@ -20,7 +20,7 @@ class SkBitmap; // Note that since this view is not (currently) part of a Container or // RootView hierarchy, it cannot respond to events or contain controls that // do, right now it is used simply to render. Adding an extra Container to -// WebContents seemed like a lot of complexity. Ideally, perhaps WebContents' +// TabContents seemed like a lot of complexity. Ideally, perhaps TabContents' // view portion would itself become a Container in the future, then event // processing will work. // diff --git a/chrome/browser/views/tab_contents_container_view.cc b/chrome/browser/views/tab_contents_container_view.cc index b31f6b6..05aa615 100644 --- a/chrome/browser/views/tab_contents_container_view.cc +++ b/chrome/browser/views/tab_contents_container_view.cc @@ -11,7 +11,7 @@ #include "chrome/browser/renderer_host/render_widget_host_view.h" #include "chrome/browser/tab_contents/render_view_host_manager.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/view_ids.h" #include "chrome/common/notification_service.h" #include "chrome/views/widget/root_view.h" @@ -70,7 +70,7 @@ void TabContentsContainerView::SetTabContents(TabContents* tab_contents) { // We need to register the tab contents window with the BrowserContainer so // that the BrowserContainer is the focused view when the focus is on the - // TabContents window (for the WebContents case). + // TabContents window (for the TabContents case). SetAssociatedFocusView(this); Attach(tab_contents->GetNativeView()); @@ -128,9 +128,9 @@ void TabContentsContainerView::Focus() { void TabContentsContainerView::RequestFocus() { // This is a hack to circumvent the fact that a view does not explicitly get // a call to set the focus if it already has the focus. This causes a problem - // with tabs such as the WebContents that instruct the RenderView that it got - // focus when they actually get the focus. When switching from one WebContents - // tab that has focus to another WebContents tab that had focus, since the + // with tabs such as the TabContents that instruct the RenderView that it got + // focus when they actually get the focus. When switching from one TabContents + // tab that has focus to another TabContents tab that had focus, since the // TabContentsContainerView already has focus, Focus() would not be called and // the RenderView would not get notified it got focused. // By clearing the focused view before-hand, we ensure Focus() will be called. @@ -148,12 +148,11 @@ bool TabContentsContainerView::GetAccessibleRole( bool TabContentsContainerView::ShouldLookupAccelerators( const views::KeyEvent& e) { - // Don't look-up accelerators if we are showing a non-crashed WebContents. + // Don't look-up accelerators if we are showing a non-crashed TabContents. // We'll first give the page a chance to process the key events. If it does // not process them, they'll be returned to us and we'll treat them as // accelerators then. - if (tab_contents_ && !tab_contents_->is_crashed() && - tab_contents_->AsWebContents()) + if (tab_contents_ && !tab_contents_->is_crashed()) return false; return true; } @@ -174,7 +173,7 @@ void TabContentsContainerView::Observe(NotificationType type, } void TabContentsContainerView::AddObservers() { - // WebContents can change their RenderViewHost and hence the HWND that is + // TabContents can change their RenderViewHost and hence the HWND that is // shown and getting focused. We need to keep track of that so we install // the focus subclass on the shown HWND so we intercept focus change events. registrar_.Add(this, diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc index 7a7bf9d..83bf266 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/views/tabs/dragged_tab_controller.cc @@ -16,7 +16,7 @@ #include "chrome/browser/views/tabs/hwnd_photobooth.h" #include "chrome/browser/views/tabs/tab.h" #include "chrome/browser/views/tabs/tab_strip.h" -#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/animation.h" #include "chrome/common/gfx/chrome_canvas.h" #include "chrome/common/notification_service.h" diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index 34c0ce9..5e8cbdc 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -12,7 +12,7 @@ #include "chrome/browser/view_ids.h" #include "chrome/browser/views/tabs/dragged_tab_controller.h" #include "chrome/browser/views/tabs/tab.h" -#include "chrome/browser/tab_contents/web_contents.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/drag_drop_types.h" #include "chrome/common/gfx/chrome_canvas.h" #include "chrome/common/gfx/path.h" |