diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 22:32:52 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 22:32:52 +0000 |
commit | 151a63d06532f2cdd24c6bb37a072abd6d0184a1 (patch) | |
tree | 401eaa79525b60985ec4c5e16169cc3e2a1186e8 /chrome/browser | |
parent | 82eb8ec62c0ad5494a51e3b45c7a15dcd7e4a1e4 (diff) | |
download | chromium_src-151a63d06532f2cdd24c6bb37a072abd6d0184a1.zip chromium_src-151a63d06532f2cdd24c6bb37a072abd6d0184a1.tar.gz chromium_src-151a63d06532f2cdd24c6bb37a072abd6d0184a1.tar.bz2 |
Rename TabContents::render_view_host() to GetRenderViewHost and put it into the WebContents interface.
BUG=98716
Review URL: http://codereview.chromium.org/9007026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115200 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
134 files changed, 446 insertions, 453 deletions
diff --git a/chrome/browser/accessibility/accessibility_win_browsertest.cc b/chrome/browser/accessibility/accessibility_win_browsertest.cc index 487baaa..89a9bdd 100644 --- a/chrome/browser/accessibility/accessibility_win_browsertest.cc +++ b/chrome/browser/accessibility/accessibility_win_browsertest.cc @@ -214,7 +214,7 @@ AccessibilityWinBrowserTest::GetRendererAccessible() { } void AccessibilityWinBrowserTest::ExecuteScript(wstring script) { - browser()->GetSelectedTabContents()->render_view_host()-> + browser()->GetSelectedTabContents()->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(L"", script); } diff --git a/chrome/browser/aeropeek_manager.cc b/chrome/browser/aeropeek_manager.cc index 7ebba34..4d06cc5 100644 --- a/chrome/browser/aeropeek_manager.cc +++ b/chrome/browser/aeropeek_manager.cc @@ -976,7 +976,8 @@ bool AeroPeekManager::GetTabThumbnail(int tab_id, SkBitmap* thumbnail) { ThumbnailGenerator* generator = g_browser_process->GetThumbnailGenerator(); DCHECK(generator); - *thumbnail = generator->GetThumbnailForRenderer(contents->render_view_host()); + *thumbnail = generator->GetThumbnailForRenderer( + contents->GetRenderViewHost()); return true; } @@ -990,7 +991,7 @@ bool AeroPeekManager::GetTabPreview(int tab_id, SkBitmap* preview) { if (!contents) return false; - RenderViewHost* render_view_host = contents->render_view_host(); + RenderViewHost* render_view_host = contents->GetRenderViewHost(); if (!render_view_host) return false; diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc index 9601996..14e3d91f 100644 --- a/chrome/browser/autocomplete/autocomplete_edit.cc +++ b/chrome/browser/autocomplete/autocomplete_edit.cc @@ -1073,7 +1073,7 @@ void AutocompleteEditModel::DoPrerender(const AutocompleteMatch& match) { prerender::PrerenderManager* prerender_manager = prerender::PrerenderManagerFactory::GetForProfile(tab->profile()); if (prerender_manager) { - RenderViewHost* current_host = tab->tab_contents()->render_view_host(); + RenderViewHost* current_host = tab->tab_contents()->GetRenderViewHost(); prerender_manager->AddPrerenderFromOmnibox( match.destination_url, current_host->session_storage_namespace()); } diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc index 3074dfb..53be1fe 100644 --- a/chrome/browser/autofill/autofill_browsertest.cc +++ b/chrome/browser/autofill/autofill_browsertest.cc @@ -129,14 +129,14 @@ class AutofillTest : public InProcessBrowserTest { const std::string& expected_value) { std::string value; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(" L"document.getElementById('" + field_name + L"').value);", &value)); EXPECT_EQ(expected_value, value); } RenderViewHost* render_view_host() { - return browser()->GetSelectedTabContents()->render_view_host(); + return browser()->GetSelectedTabContents()->GetRenderViewHost(); } void SimulateURLFetch(bool success) { diff --git a/chrome/browser/autofill/autofill_external_delegate.cc b/chrome/browser/autofill/autofill_external_delegate.cc index a9d6a13..6301920 100644 --- a/chrome/browser/autofill/autofill_external_delegate.cc +++ b/chrome/browser/autofill/autofill_external_delegate.cc @@ -26,7 +26,7 @@ AutofillExternalDelegate::AutofillExternalDelegate( void AutofillExternalDelegate::SelectAutofillSuggestionAtIndex(int listIndex) { RenderViewHost* host = - tab_contents_wrapper_->tab_contents()->render_view_host(); + tab_contents_wrapper_->tab_contents()->GetRenderViewHost(); host->Send(new AutofillMsg_SelectAutofillSuggestionAtIndex( host->routing_id(), listIndex)); diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc index cf61b57..8087f81 100644 --- a/chrome/browser/autofill/autofill_manager.cc +++ b/chrome/browser/autofill/autofill_manager.cc @@ -648,7 +648,7 @@ void AutofillManager::OnShowAutofillDialog() { void AutofillManager::OnDidPreviewAutofillFormData() { content::NotificationService::current()->Notify( chrome::NOTIFICATION_AUTOFILL_DID_FILL_FORM_DATA, - content::Source<RenderViewHost>(tab_contents()->render_view_host()), + content::Source<RenderViewHost>(tab_contents()->GetRenderViewHost()), content::NotificationService::NoDetails()); } @@ -656,7 +656,7 @@ void AutofillManager::OnDidPreviewAutofillFormData() { void AutofillManager::OnDidFillAutofillFormData(const TimeTicks& timestamp) { content::NotificationService::current()->Notify( chrome::NOTIFICATION_AUTOFILL_DID_FILL_FORM_DATA, - content::Source<RenderViewHost>(tab_contents()->render_view_host()), + content::Source<RenderViewHost>(tab_contents()->GetRenderViewHost()), content::NotificationService::NoDetails()); metric_logger_->LogUserHappinessMetric(AutofillMetrics::USER_DID_AUTOFILL); @@ -672,7 +672,7 @@ void AutofillManager::OnDidFillAutofillFormData(const TimeTicks& timestamp) { void AutofillManager::OnDidShowAutofillSuggestions(bool is_new_popup) { content::NotificationService::current()->Notify( chrome::NOTIFICATION_AUTOFILL_DID_SHOW_SUGGESTIONS, - content::Source<RenderViewHost>(tab_contents()->render_view_host()), + content::Source<RenderViewHost>(tab_contents()->GetRenderViewHost()), content::NotificationService::NoDetails()); if (is_new_popup) { @@ -719,7 +719,7 @@ void AutofillManager::SendAutofillTypePredictions( switches::kShowAutofillTypePredictions)) return; - RenderViewHost* host = tab_contents()->render_view_host(); + RenderViewHost* host = tab_contents()->GetRenderViewHost(); if (!host) return; @@ -832,7 +832,7 @@ bool AutofillManager::GetHost(const std::vector<AutofillProfile*>& profiles, if (profiles.empty() && credit_cards.empty()) return false; - *host = tab_contents()->render_view_host(); + *host = tab_contents()->GetRenderViewHost(); if (!*host) return false; diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 693a01c..7e7ff6d 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -583,7 +583,7 @@ void AutomationProvider::SendFindRequest( options.forward = forward; options.matchCase = match_case; options.findNext = find_next; - tab_contents->render_view_host()->Find( + tab_contents->GetRenderViewHost()->Find( FindInPageNotificationObserver::kFindInPageRequestId, search_string, options); } @@ -806,7 +806,7 @@ RenderViewHost* AutomationProvider::GetViewForTab(int tab_handle) { return NULL; } - RenderViewHost* view_host = tab_contents->render_view_host(); + RenderViewHost* view_host = tab_contents->GetRenderViewHost(); return view_host; } diff --git a/chrome/browser/automation/automation_provider_json.cc b/chrome/browser/automation/automation_provider_json.cc index 9a5c57f..dfac829 100644 --- a/chrome/browser/automation/automation_provider_json.cc +++ b/chrome/browser/automation/automation_provider_json.cc @@ -168,7 +168,7 @@ bool GetRenderViewFromJSONArgs( TabContents* tab = NULL; if (!GetTabFromJSONArgs(args, &tab, error)) return false; - *rvh = tab->render_view_host(); + *rvh = tab->GetRenderViewHost(); } return true; } diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc index ede3255..d0f2ba6 100644 --- a/chrome/browser/automation/automation_provider_observers.cc +++ b/chrome/browser/automation/automation_provider_observers.cc @@ -2501,7 +2501,7 @@ void GetAllNotificationsObserver::SendMessage() { BalloonView* view = (*balloon_iter)->view(); note->SetInteger( "pid", - base::GetProcId(view->GetHost()->tab_contents()->render_view_host()-> + base::GetProcId(view->GetHost()->tab_contents()->GetRenderViewHost()-> process()-> GetHandle())); list->Append(note); } diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc index 436e713..ace7239 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -400,8 +400,8 @@ void AutomationProvider::OnRunUnloadHandlers( void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { if (tab_tracker_->ContainsHandle(handle)) { NavigationController* tab = tab_tracker_->GetResource(handle); - if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { - RenderViewHost* host = tab->tab_contents()->render_view_host(); + if (tab->tab_contents() && tab->tab_contents()->GetRenderViewHost()) { + RenderViewHost* host = tab->tab_contents()->GetRenderViewHost(); content::PageZoom zoom = static_cast<content::PageZoom>(zoom_level); host->Zoom(zoom); } diff --git a/chrome/browser/automation/automation_tab_helper_browsertest.cc b/chrome/browser/automation/automation_tab_helper_browsertest.cc index cea140d..d5d8174 100644 --- a/chrome/browser/automation/automation_tab_helper_browsertest.cc +++ b/chrome/browser/automation/automation_tab_helper_browsertest.cc @@ -91,7 +91,7 @@ class AutomationTabHelperBrowserTest : public InProcessBrowserTest { std::string script = base::StringPrintf("runTestCase(%d);", test_case_number); RenderViewHost* host = - browser()->GetSelectedTabContents()->render_view_host(); + browser()->GetSelectedTabContents()->GetRenderViewHost(); if (wait_for_response) { ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( host, L"", ASCIIToWide(script))); diff --git a/chrome/browser/automation/automation_util.cc b/chrome/browser/automation/automation_util.cc index a092763..1f1b64d 100644 --- a/chrome/browser/automation/automation_util.cc +++ b/chrome/browser/automation/automation_util.cc @@ -161,7 +161,7 @@ net::URLRequestContextGetter* GetRequestContext(TabContents* contents) { // Since we may be on the UI thread don't call GetURLRequestContext(). // Get the request context specific to the current TabContents and app. return contents->browser_context()->GetRequestContextForRenderProcess( - contents->render_view_host()->process()->GetID()); + contents->GetRenderProcessHost()->GetID()); } void GetCookies(const GURL& url, @@ -488,7 +488,7 @@ bool GetRenderViewForId( TabContents* tab; if (!GetTabForId(id, &tab)) return false; - *rvh = tab->render_view_host(); + *rvh = tab->GetRenderViewHost(); break; } case AutomationId::kTypeExtensionPopup: diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index ef00be6..e131c1a 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -1381,7 +1381,7 @@ void TestingAutomationProvider::ExecuteJavascript( new DomOperationMessageSender(this, reply_message, false); ExecuteJavascriptInRenderViewFrame(WideToUTF16Hack(frame_xpath), WideToUTF16Hack(script), reply_message, - tab_contents->render_view_host()); + tab_contents->GetRenderViewHost()); } void TestingAutomationProvider::GetConstrainedWindowCount(int handle, @@ -1408,7 +1408,7 @@ void TestingAutomationProvider::HandleInspectElementRequest( DCHECK(!reply_message_); reply_message_ = reply_message; - DevToolsWindow::InspectElement(tab_contents->render_view_host(), x, y); + DevToolsWindow::InspectElement(tab_contents->GetRenderViewHost(), x, y); } else { AutomationMsg_InspectElement::WriteReplyParams(reply_message, -1); Send(reply_message); @@ -4830,10 +4830,10 @@ void TestingAutomationProvider::SubmitAutofillForm( base::SStringPrintf(&set_automation_id, "window.domAutomationController.setAutomationId(%d);", reply_message->routing_id()); - tab_contents->tab_contents()->render_view_host()->ExecuteJavascriptInWebFrame( - frame_xpath, UTF8ToUTF16(set_automation_id)); - tab_contents->tab_contents()->render_view_host()->ExecuteJavascriptInWebFrame( - frame_xpath, javascript); + tab_contents->tab_contents()->GetRenderViewHost()-> + ExecuteJavascriptInWebFrame(frame_xpath, UTF8ToUTF16(set_automation_id)); + tab_contents->tab_contents()->GetRenderViewHost()-> + ExecuteJavascriptInWebFrame(frame_xpath, javascript); } void TestingAutomationProvider::AutofillTriggerSuggestions( @@ -4856,7 +4856,7 @@ void TestingAutomationProvider::AutofillTriggerSuggestions( new AutofillDisplayedObserver( chrome::NOTIFICATION_AUTOFILL_DID_SHOW_SUGGESTIONS, - tab_contents->render_view_host(), this, reply_message); + tab_contents->GetRenderViewHost(), this, reply_message); SendWebKeyPressEventAsync(ui::VKEY_DOWN, tab_contents); } @@ -4889,7 +4889,7 @@ void TestingAutomationProvider::AutofillHighlightSuggestion( new AutofillDisplayedObserver( chrome::NOTIFICATION_AUTOFILL_DID_FILL_FORM_DATA, - tab_contents->render_view_host(), this, reply_message); + tab_contents->GetRenderViewHost(), this, reply_message); SendWebKeyPressEventAsync(key_code, tab_contents); } @@ -4913,7 +4913,7 @@ void TestingAutomationProvider::AutofillAcceptSelection( new AutofillDisplayedObserver( chrome::NOTIFICATION_AUTOFILL_DID_FILL_FORM_DATA, - tab_contents->render_view_host(), this, reply_message); + tab_contents->GetRenderViewHost(), this, reply_message); SendWebKeyPressEventAsync(ui::VKEY_RETURN, tab_contents); } @@ -5647,12 +5647,12 @@ void TestingAutomationProvider::SendWebKeyPressEventAsync( NativeWebKeyboardEvent event_down; BuildSimpleWebKeyEvent(WebKit::WebInputEvent::RawKeyDown, key_code, &event_down); - tab_contents->render_view_host()->ForwardKeyboardEvent(event_down); + tab_contents->GetRenderViewHost()->ForwardKeyboardEvent(event_down); // Create and send a corresponding "key up" event. NativeWebKeyboardEvent event_up; BuildSimpleWebKeyEvent(WebKit::WebInputEvent::KeyUp, key_code, &event_up); - tab_contents->render_view_host()->ForwardKeyboardEvent(event_up); + tab_contents->GetRenderViewHost()->ForwardKeyboardEvent(event_up); } void TestingAutomationProvider::SendWebkitKeyEvent( @@ -6249,7 +6249,7 @@ void TestingAutomationProvider::CaptureEntirePageJSON( return; } - RenderViewHost* render_view = tab_contents->render_view_host(); + RenderViewHost* render_view = tab_contents->GetRenderViewHost(); if (render_view) { FilePath path(path_str); // This will delete itself when finished. @@ -6622,7 +6622,7 @@ void TestingAutomationProvider::LoadBlockedPlugins(int tab_handle, TabContents* contents = nav->tab_contents(); if (!contents) return; - RenderViewHost* host = contents->render_view_host(); + RenderViewHost* host = contents->GetRenderViewHost(); host->Send(new ChromeViewMsg_LoadBlockedPlugins(host->routing_id())); *success = true; } diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc index 91b25f4..39987c9 100644 --- a/chrome/browser/browser_focus_uitest.cc +++ b/chrome/browser/browser_focus_uitest.cc @@ -418,7 +418,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, focused_browser->window()->Activate(); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( - unfocused_browser->GetSelectedTabContents()->render_view_host(), L"", + unfocused_browser->GetSelectedTabContents()->GetRenderViewHost(), L"", L"stealFocus();")); // Make sure the first browser is still active. @@ -437,7 +437,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, LocationBarLockFocus) { browser()->FocusLocationBar(); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"stealFocus();")); // Make sure the location bar is still focused. @@ -483,7 +483,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) { // Let's make sure the focus is on the expected element in the page. std::string actual; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(getFocusedElement());", &actual)); @@ -500,7 +500,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) { browser(), ui::VKEY_TAB, false, false, false, false, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, content::NotificationSource(content::Source<RenderViewHost>( - browser()->GetSelectedTabContents()->render_view_host())), + browser()->GetSelectedTabContents()->GetRenderViewHost())), details)); } else { // On the last tab key press, the focus returns to the browser. @@ -543,7 +543,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) { browser(), ui::VKEY_TAB, false, true, false, false, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, content::NotificationSource(content::Source<RenderViewHost>( - browser()->GetSelectedTabContents()->render_view_host())), + browser()->GetSelectedTabContents()->GetRenderViewHost())), details)); } else { // On the last tab key press, the focus returns to the browser. @@ -556,7 +556,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) { // Let's make sure the focus is on the expected element in the page. std::string actual; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(getFocusedElement());", &actual)); @@ -705,7 +705,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, InterstitialFocus) { // Page should have focus. ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); - EXPECT_TRUE(browser()->GetSelectedTabContents()->render_view_host()->view()-> + EXPECT_TRUE(browser()->GetSelectedTabContents()->GetRenderViewHost()->view()-> HasFocus()); // Let's show an interstitial. diff --git a/chrome/browser/browser_keyevents_browsertest.cc b/chrome/browser/browser_keyevents_browsertest.cc index f141b9f..dd18dc3 100644 --- a/chrome/browser/browser_keyevents_browsertest.cc +++ b/chrome/browser/browser_keyevents_browsertest.cc @@ -143,7 +143,7 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { ASSERT_LT(tab_index, browser()->tab_count()); bool actual; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetTabContentsAt(tab_index)->render_view_host(), + browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(), L"", base::StringPrintf(kSuppressEventJS, type, GetBoolString(!suppress)), &actual)); @@ -169,7 +169,7 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { void GetResultLength(int tab_index, int* length) { ASSERT_LT(tab_index, browser()->tab_count()); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractInt( - browser()->GetTabContentsAt(tab_index)->render_view_host(), + browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(), L"", kGetResultLengthJS, length)); } @@ -181,7 +181,7 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { for (int i = 0; i < actual_length; ++i) { std::string actual; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetTabContentsAt(tab_index)->render_view_host(), + browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(), L"", base::StringPrintf(kGetResultJS, i), &actual)); // If more events were received than expected, then the additional events @@ -197,7 +197,7 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { ASSERT_LT(tab_index, browser()->tab_count()); std::string actual; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetTabContentsAt(tab_index)->render_view_host(), + browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(), L"", kGetFocusedElementJS, &actual)); ASSERT_EQ(WideToUTF8(focused), actual); } @@ -206,7 +206,7 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { ASSERT_LT(tab_index, browser()->tab_count()); bool actual; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetTabContentsAt(tab_index)->render_view_host(), + browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(), L"", base::StringPrintf(kSetFocusedElementJS, focused), &actual)); @@ -218,7 +218,7 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { ASSERT_LT(tab_index, browser()->tab_count()); std::string actual; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetTabContentsAt(tab_index)->render_view_host(), + browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(), L"", base::StringPrintf(kGetTextBoxValueJS, id), &actual)); @@ -230,7 +230,7 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { ASSERT_LT(tab_index, browser()->tab_count()); std::string actual; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetTabContentsAt(tab_index)->render_view_host(), + browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(), L"", base::StringPrintf(kSetTextBoxValueJS, id, value), &actual)); @@ -241,7 +241,7 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { ASSERT_LT(tab_index, browser()->tab_count()); bool actual; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetTabContentsAt(tab_index)->render_view_host(), + browser()->GetTabContentsAt(tab_index)->GetRenderViewHost(), L"", base::StringPrintf(kStartTestJS, result_length), &actual)); ASSERT_TRUE(actual); } @@ -261,7 +261,7 @@ class BrowserKeyEventsTest : public InProcessBrowserTest { // because the test finished message might be arrived before returning // from the SendKeyPressSync() method. TestFinishObserver finish_observer( - browser()->GetTabContentsAt(tab_index)->render_view_host()); + browser()->GetTabContentsAt(tab_index)->GetRenderViewHost()); ASSERT_TRUE(ui_test_utils::SendKeyPressSync( browser(), test.key, test.ctrl, test.shift, test.alt, test.command)); diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm index a34695c..708943b 100644 --- a/chrome/browser/chrome_browser_application_mac.mm +++ b/chrome/browser/chrome_browser_application_mac.mm @@ -479,7 +479,7 @@ void SwizzleInit() { ++it) { if (TabContentsWrapper* contents = *it) { if (RenderViewHost* rvh = - contents->tab_contents()->render_view_host()) { + contents->tab_contents()->GetRenderViewHost()) { rvh->EnableRendererAccessibility(); } } diff --git a/chrome/browser/chromeos/accessibility/accessibility_util.cc b/chrome/browser/chromeos/accessibility/accessibility_util.cc index 2ed45ab..6847556 100644 --- a/chrome/browser/chromeos/accessibility/accessibility_util.cc +++ b/chrome/browser/chromeos/accessibility/accessibility_util.cc @@ -117,7 +117,7 @@ void EnableAccessibility(bool enabled, WebUI* login_web_ui) { if (login_web_ui) { RenderViewHost* render_view_host = - login_web_ui->tab_contents()->render_view_host(); + login_web_ui->tab_contents()->GetRenderViewHost(); // Set a flag to tell ChromeVox that it's just been enabled, // so that it won't interrupt our speech feedback enabled message. ExtensionMsg_ExecuteCode_Params params; diff --git a/chrome/browser/chromeos/notifications/balloon_view.cc b/chrome/browser/chromeos/notifications/balloon_view.cc index a134994..cea579f 100644 --- a/chrome/browser/chromeos/notifications/balloon_view.cc +++ b/chrome/browser/chromeos/notifications/balloon_view.cc @@ -273,7 +273,7 @@ void BalloonViewImpl::Layout() { html_contents_->view()->SetBounds(0, 0, size.width(), size.height()); if (html_contents_->tab_contents()) { RenderWidgetHostView* view = - html_contents_->tab_contents()->render_view_host()->view(); + html_contents_->tab_contents()->GetRenderViewHost()->view(); if (view) view->SetSize(size); } @@ -364,7 +364,7 @@ void BalloonViewImpl::DenyPermission() { gfx::NativeView BalloonViewImpl::GetParentNativeView() { RenderWidgetHostView* view = - html_contents_->tab_contents()->render_view_host()->view(); + html_contents_->tab_contents()->GetRenderViewHost()->view(); DCHECK(view); return view->GetNativeView(); } diff --git a/chrome/browser/chromeos/offline/offline_load_page_unittest.cc b/chrome/browser/chromeos/offline/offline_load_page_unittest.cc index c381266..540dde8 100644 --- a/chrome/browser/chromeos/offline/offline_load_page_unittest.cc +++ b/chrome/browser/chromeos/offline/offline_load_page_unittest.cc @@ -75,7 +75,7 @@ class OfflineLoadPageTest : public ChromeRenderViewHostTestHarness { void Navigate(const char* url, int page_id) { contents()->TestDidNavigate( - contents()->render_view_host(), page_id, GURL(url), + contents()->GetRenderViewHost(), page_id, GURL(url), content::PAGE_TRANSITION_TYPED); } diff --git a/chrome/browser/debugger/devtools_sanity_unittest.cc b/chrome/browser/debugger/devtools_sanity_unittest.cc index fc72264..b17628d 100644 --- a/chrome/browser/debugger/devtools_sanity_unittest.cc +++ b/chrome/browser/debugger/devtools_sanity_unittest.cc @@ -136,7 +136,7 @@ class DevToolsSanityTest : public InProcessBrowserTest { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, content::NotificationService::AllSources()); - inspected_rvh_ = GetInspectedTab()->render_view_host(); + inspected_rvh_ = GetInspectedTab()->GetRenderViewHost(); window_ = DevToolsWindow::OpenDevToolsWindow(inspected_rvh_); observer.Wait(); } @@ -438,7 +438,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, // Clear inspector settings to ensure that Elements will be // current panel when DevTools window is open. content::GetContentClient()->browser()->ClearInspectorSettings( - GetInspectedTab()->render_view_host()); + GetInspectedTab()->GetRenderViewHost()); RunTest("testScriptsTabIsPopulatedOnInspectedPageRefresh", kDebuggerTestPage); } diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc index fcc2e2f..c4e9283 100644 --- a/chrome/browser/debugger/devtools_window.cc +++ b/chrome/browser/debugger/devtools_window.cc @@ -73,10 +73,10 @@ TabContentsWrapper* DevToolsWindow::GetDevToolsContents( return NULL; if (!DevToolsAgentHostRegistry::HasDevToolsAgentHost( - inspected_tab->render_view_host())) + inspected_tab->GetRenderViewHost())) return NULL; DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost( - inspected_tab->render_view_host()); + inspected_tab->GetRenderViewHost()); DevToolsManager* manager = DevToolsManager::GetInstance(); DevToolsClientHost* client_host = manager->GetDevToolsClientHostFor(agent); DevToolsWindow* window = AsDevToolsWindow(client_host); @@ -92,7 +92,7 @@ bool DevToolsWindow::IsDevToolsWindow(RenderViewHost* window_rvh) { DevToolsWindowList& instances = g_instances.Get(); for (DevToolsWindowList::iterator it = instances.begin(); it != instances.end(); ++it) { - if ((*it)->tab_contents_->tab_contents()->render_view_host() == window_rvh) + if ((*it)->tab_contents_->tab_contents()->GetRenderViewHost() == window_rvh) return true; } return false; @@ -159,7 +159,7 @@ DevToolsWindow* DevToolsWindow::Create( // Create TabContents with devtools. TabContentsWrapper* tab_contents = Browser::TabContentsFactory(profile, NULL, MSG_ROUTING_NONE, NULL, NULL); - tab_contents->tab_contents()->render_view_host()->AllowBindings( + tab_contents->tab_contents()->GetRenderViewHost()->AllowBindings( content::BINDINGS_POLICY_WEB_UI); tab_contents->tab_contents()->controller().LoadURL( GetDevToolsUrl(profile, docked, shared_worker_frontend), @@ -330,7 +330,7 @@ void DevToolsWindow::RequestSetDocked(bool docked) { } RenderViewHost* DevToolsWindow::GetRenderViewHost() { - return tab_contents_->tab_contents()->render_view_host(); + return tab_contents_->tab_contents()->GetRenderViewHost(); } void DevToolsWindow::CreateDevToolsBrowser() { @@ -399,7 +399,7 @@ bool DevToolsWindow::IsInspectedBrowserPopupOrPanel() { } void DevToolsWindow::UpdateFrontendAttachedState() { - tab_contents_->tab_contents()->render_view_host()-> + tab_contents_->tab_contents()->GetRenderViewHost()-> ExecuteJavascriptInWebFrame( string16(), docked_ ? ASCIIToUTF16("WebInspector.setAttachedWindow(true);") @@ -451,7 +451,7 @@ void DevToolsWindow::CallClientFunction(const string16& function_name, base::JSONWriter::Write(&arg, false, &json); string16 javascript = function_name + char16('(') + UTF8ToUTF16(json) + ASCIIToUTF16(");"); - tab_contents_->tab_contents()->render_view_host()-> + tab_contents_->tab_contents()->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), javascript); } @@ -489,13 +489,13 @@ void DevToolsWindow::DoAction() { // TODO: these messages should be pushed through the WebKit API instead. switch (action_on_load_) { case DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE: - tab_contents_->tab_contents()->render_view_host()-> + tab_contents_->tab_contents()->GetRenderViewHost()-> ExecuteJavascriptInWebFrame( string16(), ASCIIToUTF16("WebInspector.showConsole();")); break; case DEVTOOLS_TOGGLE_ACTION_INSPECT: - tab_contents_->tab_contents()->render_view_host()-> + tab_contents_->tab_contents()->GetRenderViewHost()-> ExecuteJavascriptInWebFrame( string16(), ASCIIToUTF16("WebInspector.toggleSearchingForNode();")); @@ -548,7 +548,7 @@ void DevToolsWindow::UpdateTheme() { "WebInspector.setToolbarColors(\"%s\", \"%s\")", SkColorToRGBAString(color_toolbar).c_str(), SkColorToRGBAString(color_tab_text).c_str()); - tab_contents_->tab_contents()->render_view_host()-> + tab_contents_->tab_contents()->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), UTF8ToUTF16(command)); } diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc index edd6ac6..8bbdfb1 100644 --- a/chrome/browser/download/download_browsertest.cc +++ b/chrome/browser/download/download_browsertest.cc @@ -1327,7 +1327,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, ChromeURLAfterDownload) { ASSERT_TRUE(contents); bool webui_responded = false; EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - contents->render_view_host(), + contents->GetRenderViewHost(), L"", L"window.domAutomationController.send(window.webui_responded_);", &webui_responded)); @@ -1348,7 +1348,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, BrowserCloseAfterDownload) { ASSERT_TRUE(contents); bool result = false; EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - contents->render_view_host(), + contents->GetRenderViewHost(), L"", L"window.onunload = function() { var do_nothing = 0; }; " L"window.domAutomationController.send(true);", diff --git a/chrome/browser/extensions/app_process_apitest.cc b/chrome/browser/extensions/app_process_apitest.cc index fa4251a..ef12422 100644 --- a/chrome/browser/extensions/app_process_apitest.cc +++ b/chrome/browser/extensions/app_process_apitest.cc @@ -59,9 +59,9 @@ static void WindowOpenHelper(Browser* browser, observer.Wait(); EXPECT_EQ(url, newtab->controller().GetLastCommittedEntry()->url()); if (newtab_process_should_equal_opener) - EXPECT_EQ(opener_host->process(), newtab->render_view_host()->process()); + EXPECT_EQ(opener_host->process(), newtab->GetRenderProcessHost()); else - EXPECT_NE(opener_host->process(), newtab->render_view_host()->process()); + EXPECT_NE(opener_host->process(), newtab->GetRenderProcessHost()); } // Simulates a page navigating itself to an URL, and waits for the navigation. @@ -71,7 +71,7 @@ static void NavigateTabHelper(TabContents* contents, const GURL& url) { content::NOTIFICATION_LOAD_STOP, content::NotificationService::AllSources()); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - contents->render_view_host(), L"", + contents->GetRenderViewHost(), L"", L"window.addEventListener('unload', function() {" L" window.domAutomationController.send(true);" L"}, false);" @@ -108,7 +108,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcess) { browser(), base_url.Resolve("path1/empty.html"), NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); EXPECT_TRUE(process_map->Contains( - browser()->GetTabContentsAt(1)->render_view_host()->process()->GetID())); + browser()->GetTabContentsAt(1)->GetRenderProcessHost()->GetID())); EXPECT_FALSE(browser()->GetTabContentsAt(1)->web_ui()); LOG(INFO) << "Nav 1."; @@ -116,7 +116,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcess) { browser(), base_url.Resolve("path2/empty.html"), NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); EXPECT_TRUE(process_map->Contains( - browser()->GetTabContentsAt(2)->render_view_host()->process()->GetID())); + browser()->GetTabContentsAt(2)->GetRenderProcessHost()->GetID())); EXPECT_FALSE(browser()->GetTabContentsAt(2)->web_ui()); LOG(INFO) << "Nav 2."; @@ -129,7 +129,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcess) { ui_test_utils::NavigateToURL(browser(), base_url.Resolve("path3/empty.html")); LOG(INFO) << "Nav 3."; EXPECT_FALSE(process_map->Contains( - browser()->GetTabContentsAt(3)->render_view_host()->process()->GetID())); + browser()->GetTabContentsAt(3)->GetRenderProcessHost()->GetID())); EXPECT_FALSE(browser()->GetTabContentsAt(3)->web_ui()); // We should have opened 3 new extension tabs. Including the original blank @@ -137,12 +137,12 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcess) { // permission, all of its instances are in the same process. Thus two tabs // should be part of the extension app and grouped in the same process. ASSERT_EQ(4, browser()->tab_count()); - RenderViewHost* host = browser()->GetTabContentsAt(1)->render_view_host(); + RenderViewHost* host = browser()->GetTabContentsAt(1)->GetRenderViewHost(); EXPECT_EQ(host->process(), - browser()->GetTabContentsAt(2)->render_view_host()->process()); + browser()->GetTabContentsAt(2)->GetRenderProcessHost()); EXPECT_NE(host->process(), - browser()->GetTabContentsAt(3)->render_view_host()->process()); + browser()->GetTabContentsAt(3)->GetRenderProcessHost()); // Now let's do the same using window.open. The same should happen. ASSERT_EQ(1u, BrowserList::GetBrowserCount(browser()->profile())); @@ -172,19 +172,19 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcess) { // but we temporarily avoid swapping away from an app in case the window // tries to send a postMessage to the app. See crbug.com/59285. EXPECT_EQ(host->process(), - browser()->GetTabContentsAt(2)->render_view_host()->process()); + browser()->GetTabContentsAt(2)->GetRenderProcessHost()); EXPECT_EQ(host->process(), - browser()->GetTabContentsAt(3)->render_view_host()->process()); + browser()->GetTabContentsAt(3)->GetRenderProcessHost()); // If one of the popup tabs navigates back to the app, window.opener should // be valid. NavigateTabHelper(browser()->GetTabContentsAt(6), app_url); LOG(INFO) << "NavigateTabHelper 3."; EXPECT_EQ(host->process(), - browser()->GetTabContentsAt(6)->render_view_host()->process()); + browser()->GetTabContentsAt(6)->GetRenderProcessHost()); bool windowOpenerValid = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetTabContentsAt(6)->render_view_host(), L"", + browser()->GetTabContentsAt(6)->GetRenderViewHost(), L"", L"window.domAutomationController.send(window.opener != null)", &windowOpenerValid)); ASSERT_TRUE(windowOpenerValid); @@ -220,7 +220,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcessInstances) { ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); LOG(INFO) << "Nav 1."; EXPECT_TRUE(process_map->Contains( - browser()->GetTabContentsAt(1)->render_view_host()->process()->GetID())); + browser()->GetTabContentsAt(1)->GetRenderProcessHost()->GetID())); EXPECT_FALSE(browser()->GetTabContentsAt(1)->web_ui()); ui_test_utils::WindowedNotificationObserver tab_added_observer( @@ -232,7 +232,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcessInstances) { ui_test_utils::NavigateToURL(browser(), base_url.Resolve("path2/empty.html")); LOG(INFO) << "Nav 2."; EXPECT_TRUE(process_map->Contains( - browser()->GetTabContentsAt(2)->render_view_host()->process()->GetID())); + browser()->GetTabContentsAt(2)->GetRenderProcessHost()->GetID())); EXPECT_FALSE(browser()->GetTabContentsAt(2)->web_ui()); // We should have opened 2 new extension tabs. Including the original blank @@ -240,8 +240,8 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcessInstances) { // process, since they do not have the background permission. (Thus, we want // to separate them to improve responsiveness.) ASSERT_EQ(3, browser()->tab_count()); - RenderViewHost* host1 = browser()->GetTabContentsAt(1)->render_view_host(); - RenderViewHost* host2 = browser()->GetTabContentsAt(2)->render_view_host(); + RenderViewHost* host1 = browser()->GetTabContentsAt(1)->GetRenderViewHost(); + RenderViewHost* host2 = browser()->GetTabContentsAt(2)->GetRenderViewHost(); EXPECT_NE(host1->process(), host2->process()); // Opening tabs with window.open should keep the page in the opener's process. @@ -286,7 +286,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, BookmarkAppGetsNormalProcess) { browser(), base_url.Resolve("path1/empty.html"), NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); EXPECT_FALSE(process_map->Contains( - browser()->GetTabContentsAt(1)->render_view_host()->process()->GetID())); + browser()->GetTabContentsAt(1)->GetRenderProcessHost()->GetID())); EXPECT_FALSE(browser()->GetTabContentsAt(1)->web_ui()); ui_test_utils::WindowedNotificationObserver tab_added_observer( @@ -296,16 +296,16 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, BookmarkAppGetsNormalProcess) { tab_added_observer.Wait(); ui_test_utils::NavigateToURL(browser(), base_url.Resolve("path2/empty.html")); EXPECT_FALSE(process_map->Contains( - browser()->GetTabContentsAt(2)->render_view_host()->process()->GetID())); + browser()->GetTabContentsAt(2)->GetRenderProcessHost()->GetID())); EXPECT_FALSE(browser()->GetTabContentsAt(2)->web_ui()); // We should have opened 2 new bookmark app tabs. Including the original blank // tab, we now have 3 tabs. Because normal pages use the // process-per-site-instance model, each should be in its own process. ASSERT_EQ(3, browser()->tab_count()); - RenderViewHost* host = browser()->GetTabContentsAt(1)->render_view_host(); + RenderViewHost* host = browser()->GetTabContentsAt(1)->GetRenderViewHost(); EXPECT_NE(host->process(), - browser()->GetTabContentsAt(2)->render_view_host()->process()); + browser()->GetTabContentsAt(2)->GetRenderProcessHost()); // Now let's do the same using window.open. The same should happen. ASSERT_EQ(1u, BrowserList::GetBrowserCount(browser()->profile())); @@ -318,13 +318,13 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, BookmarkAppGetsNormalProcess) { // extent. Neither navigation should switch processes. const GURL& app_url(base_url.Resolve("path1/empty.html")); const GURL& non_app_url(base_url.Resolve("path3/empty.html")); - RenderViewHost* host2 = browser()->GetTabContentsAt(2)->render_view_host(); + RenderViewHost* host2 = browser()->GetTabContentsAt(2)->GetRenderViewHost(); NavigateTabHelper(browser()->GetTabContentsAt(2), non_app_url); EXPECT_EQ(host2->process(), - browser()->GetTabContentsAt(2)->render_view_host()->process()); + browser()->GetTabContentsAt(2)->GetRenderProcessHost()); NavigateTabHelper(browser()->GetTabContentsAt(2), app_url); EXPECT_EQ(host2->process(), - browser()->GetTabContentsAt(2)->render_view_host()->process()); + browser()->GetTabContentsAt(2)->GetRenderProcessHost()); } // Tests that app process switching works properly in the following scenario: @@ -376,8 +376,8 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, MAYBE_AppProcessRedirectBack) { EXPECT_EQ("/files/extensions/api_test/app_process/path1/empty.html", browser()->GetTabContentsAt(2)->controller(). GetLastCommittedEntry()->url().path()); - EXPECT_EQ(browser()->GetTabContentsAt(1)->render_view_host()->process(), - browser()->GetTabContentsAt(2)->render_view_host()->process()); + EXPECT_EQ(browser()->GetTabContentsAt(1)->GetRenderProcessHost(), + browser()->GetTabContentsAt(2)->GetRenderProcessHost()); } // Ensure that reloading a URL after installing or uninstalling it as an app @@ -401,7 +401,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { ui_test_utils::NavigateToURL(browser(), base_url.Resolve("path1/empty.html")); TabContents* contents = browser()->GetTabContentsAt(0); EXPECT_FALSE(process_map->Contains( - contents->render_view_host()->process()->GetID())); + contents->GetRenderProcessHost()->GetID())); // Load app and navigate to the page. const Extension* app = @@ -409,13 +409,13 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { ASSERT_TRUE(app); ui_test_utils::NavigateToURL(browser(), base_url.Resolve("path1/empty.html")); EXPECT_TRUE(process_map->Contains( - contents->render_view_host()->process()->GetID())); + contents->GetRenderProcessHost()->GetID())); // Disable app and navigate to the page. DisableExtension(app->id()); ui_test_utils::NavigateToURL(browser(), base_url.Resolve("path1/empty.html")); EXPECT_FALSE(process_map->Contains( - contents->render_view_host()->process()->GetID())); + contents->GetRenderProcessHost()->GetID())); // Enable app and reload the page. EnableExtension(app->id()); @@ -427,7 +427,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { browser()->Reload(CURRENT_TAB); reload_observer.Wait(); EXPECT_TRUE(process_map->Contains( - contents->render_view_host()->process()->GetID())); + contents->GetRenderProcessHost()->GetID())); // Disable app and reload the page. DisableExtension(app->id()); @@ -439,7 +439,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { browser()->Reload(CURRENT_TAB); reload_observer2.Wait(); EXPECT_FALSE(process_map->Contains( - contents->render_view_host()->process()->GetID())); + contents->GetRenderProcessHost()->GetID())); // Enable app and reload via JavaScript. EnableExtension(app->id()); @@ -448,11 +448,11 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> controller())); - ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(contents->render_view_host(), + ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(contents->GetRenderViewHost(), L"", L"location.reload();")); js_reload_observer.Wait(); EXPECT_TRUE(process_map->Contains( - contents->render_view_host()->process()->GetID())); + contents->GetRenderProcessHost()->GetID())); // Disable app and reload via JavaScript. DisableExtension(app->id()); @@ -461,11 +461,11 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_ReloadIntoAppProcess) { content::Source<NavigationController>( &browser()->GetSelectedTabContentsWrapper()->tab_contents()-> controller())); - ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(contents->render_view_host(), + ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(contents->GetRenderViewHost(), L"", L"location.reload();")); js_reload_observer2.Wait(); EXPECT_FALSE(process_map->Contains( - contents->render_view_host()->process()->GetID())); + contents->GetRenderProcessHost()->GetID())); } // Tests that if we have a non-app process (path3/container.html) that has an @@ -496,7 +496,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, OpenAppFromIframe) { ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION | ui_test_utils::BROWSER_TEST_WAIT_FOR_BROWSER); EXPECT_FALSE(process_map->Contains( - browser()->GetTabContentsAt(0)->render_view_host()->process()->GetID())); + browser()->GetTabContentsAt(0)->GetRenderProcessHost()->GetID())); // Wait for popup window to appear. GURL app_url = base_url.Resolve("path1/empty.html"); @@ -518,7 +518,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, OpenAppFromIframe) { // Popup window should be in the app's process. EXPECT_TRUE(process_map->Contains( - last_active_browser->GetTabContentsAt(0)->render_view_host()->process()-> + last_active_browser->GetTabContentsAt(0)->GetRenderProcessHost()-> GetID())); } @@ -558,7 +558,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, OpenAppFromExtension) { // App has loaded, and chrome.app.isInstalled should be true. bool is_installed = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(chrome.app.isInstalled)", &is_installed)); ASSERT_TRUE(is_installed); @@ -597,7 +597,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, OpenWebPopupFromWebIframe) { ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION | ui_test_utils::BROWSER_TEST_WAIT_FOR_BROWSER); content::RenderProcessHost* process = - browser()->GetTabContentsAt(0)->render_view_host()->process(); + browser()->GetTabContentsAt(0)->GetRenderProcessHost(); EXPECT_TRUE(process_map->Contains(process->GetID())); // Wait for popup window to appear. The new Browser may not have been @@ -619,7 +619,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, OpenWebPopupFromWebIframe) { // Popup window should be in the app's process. content::RenderProcessHost* popup_process = - last_active_browser->GetTabContentsAt(0)->render_view_host()->process(); + last_active_browser->GetTabContentsAt(0)->GetRenderProcessHost(); EXPECT_EQ(process, popup_process); } @@ -638,10 +638,10 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, ReloadAppAfterCrash) { ui_test_utils::NavigateToURL(browser(), base_url.Resolve("path1/empty.html")); TabContents* contents = browser()->GetTabContentsAt(0); EXPECT_TRUE(process_map->Contains( - contents->render_view_host()->process()->GetID())); + contents->GetRenderProcessHost()->GetID())); bool is_installed = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - contents->render_view_host(), L"", + contents->GetRenderViewHost(), L"", L"window.domAutomationController.send(chrome.app.isInstalled)", &is_installed)); ASSERT_TRUE(is_installed); @@ -656,7 +656,7 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, ReloadAppAfterCrash) { browser()->Reload(CURRENT_TAB); observer.Wait(); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - contents->render_view_host(), L"", + contents->GetRenderViewHost(), L"", L"window.domAutomationController.send(chrome.app.isInstalled)", &is_installed)); ASSERT_TRUE(is_installed); diff --git a/chrome/browser/extensions/browser_action_apitest.cc b/chrome/browser/extensions/browser_action_apitest.cc index 08e65fd..9112e5b 100644 --- a/chrome/browser/extensions/browser_action_apitest.cc +++ b/chrome/browser/extensions/browser_action_apitest.cc @@ -81,7 +81,7 @@ IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, Basic) { TabContents* tab = browser()->GetSelectedTabContents(); bool result = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), L"", + tab->GetRenderViewHost(), L"", L"setInterval(function(){" L" if(document.body.bgColor == 'red'){" L" window.domAutomationController.send(true)}}, 100)", diff --git a/chrome/browser/extensions/chrome_app_api_browsertest.cc b/chrome/browser/extensions/chrome_app_api_browsertest.cc index 738afe1..e34075b 100644 --- a/chrome/browser/extensions/chrome_app_api_browsertest.cc +++ b/chrome/browser/extensions/chrome_app_api_browsertest.cc @@ -27,7 +27,7 @@ class ChromeAppAPITest : public ExtensionBrowserTest { bool result; CHECK( ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetSelectedTabContents()->render_view_host(), + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", get_app_is_installed, &result)); return result; } @@ -81,7 +81,7 @@ IN_PROC_BROWSER_TEST_F(ChromeAppAPITest, IsInstalled) { std::string result; ASSERT_TRUE( ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", get_app_details, &result)); EXPECT_EQ("null", result); @@ -94,7 +94,7 @@ IN_PROC_BROWSER_TEST_F(ChromeAppAPITest, IsInstalled) { ui_test_utils::NavigateToURL(browser(), app_url); ASSERT_TRUE( ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", get_app_details, &result)); scoped_ptr<DictionaryValue> app_details( static_cast<DictionaryValue*>( @@ -108,7 +108,7 @@ IN_PROC_BROWSER_TEST_F(ChromeAppAPITest, IsInstalled) { // that isInstalled should have the initial value. ASSERT_TRUE( ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(" L" function() {" @@ -159,7 +159,7 @@ IN_PROC_BROWSER_TEST_F(ChromeAppAPITest, GetDetailsForFrame) { bool result = false; ASSERT_TRUE( ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetSelectedTabContents()->render_view_host(), + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", test_unsuccessful_access, &result)); EXPECT_TRUE(result); @@ -172,7 +172,7 @@ IN_PROC_BROWSER_TEST_F(ChromeAppAPITest, GetDetailsForFrame) { std::string json; ASSERT_TRUE( ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", get_details_for_frame, &json)); scoped_ptr<DictionaryValue> app_details( diff --git a/chrome/browser/extensions/content_script_apitest.cc b/chrome/browser/extensions/content_script_apitest.cc index 0aaaf75..fe37ec8 100644 --- a/chrome/browser/extensions/content_script_apitest.cc +++ b/chrome/browser/extensions/content_script_apitest.cc @@ -100,7 +100,7 @@ IN_PROC_BROWSER_TEST_F( // And check that its styles were affected by the styles that just got loaded. bool styles_injected; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(" L"document.defaultView.getComputedStyle(document.body, null)." L"getPropertyValue('background-color') == 'rgb(255, 0, 0)')", diff --git a/chrome/browser/extensions/execute_code_in_tab_function.cc b/chrome/browser/extensions/execute_code_in_tab_function.cc index 684b9ae..a63fd88 100644 --- a/chrome/browser/extensions/execute_code_in_tab_function.cc +++ b/chrome/browser/extensions/execute_code_in_tab_function.cc @@ -224,9 +224,9 @@ bool ExecuteCodeInTabFunction::Execute(const std::string& code_string) { params.code = code_string; params.all_frames = all_frames_; params.in_main_world = false; - contents->tab_contents()->render_view_host()->Send( + contents->tab_contents()->GetRenderViewHost()->Send( new ExtensionMsg_ExecuteCode( - contents->tab_contents()->render_view_host()->routing_id(), params)); + contents->tab_contents()->GetRenderViewHost()->routing_id(), params)); Observe(contents->tab_contents()); AddRef(); // balanced in OnExecuteCodeFinished() diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc index 8f3a461..5d9f954 100644 --- a/chrome/browser/extensions/extension_browsertests_misc.cc +++ b/chrome/browser/extensions/extension_browsertests_misc.cc @@ -95,7 +95,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TabContents) { bool result = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"testTabsAPI()", &result)); EXPECT_TRUE(result); @@ -107,7 +107,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TabContents) { GURL("chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/page.html")); result = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"testTabsAPI()", &result)); EXPECT_TRUE(result); } @@ -382,7 +382,7 @@ bool ValidatePageElement(TabContents* tab, std::string error; if (!ui_test_utils::ExecuteJavaScriptAndExtractString( - tab->render_view_host(), + tab->GetRenderViewHost(), frame, javascript, &returned_value)) return false; @@ -691,7 +691,7 @@ static void WindowOpenHelper(Browser* browser, const GURL& start_url, content::NOTIFICATION_LOAD_STOP, content::NotificationService::AllSources()); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( - browser->GetSelectedTabContents()->render_view_host(), L"", + browser->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.open('" + UTF8ToWide(newtab_url) + L"');")); // Now the active tab in last active window should be the new tab. @@ -722,7 +722,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, WindowOpenExtension) { bool result = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - newtab->render_view_host(), L"", L"testExtensionApi()", &result)); + newtab->GetRenderViewHost(), L"", L"testExtensionApi()", &result)); EXPECT_TRUE(result); } @@ -760,7 +760,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, WindowOpenNoPrivileges) { // Extension API should succeed. bool result = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - newtab->render_view_host(), L"", L"testExtensionApi()", &result)); + newtab->GetRenderViewHost(), L"", L"testExtensionApi()", &result)); EXPECT_TRUE(result); } @@ -787,7 +787,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) { // With no extensions, the plugin should not be loaded. bool result = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), L"", L"testPluginWorks()", &result)); + tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); EXPECT_FALSE(result); ExtensionService* service = browser()->profile()->GetExtensionService(); @@ -799,7 +799,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) { // Now the plugin should be in the cache, but we have to reload the page for // it to work. ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), L"", L"testPluginWorks()", &result)); + tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); EXPECT_FALSE(result); { ui_test_utils::WindowedNotificationObserver observer( @@ -811,7 +811,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) { observer.Wait(); } ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), L"", L"testPluginWorks()", &result)); + tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); EXPECT_TRUE(result); EXPECT_EQ(size_before + 1, service->extensions()->size()); @@ -821,7 +821,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) { // Now the plugin should be unloaded, and the page should be broken. ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), L"", L"testPluginWorks()", &result)); + tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); EXPECT_FALSE(result); // If we reload the extension and page, it should work again. @@ -838,7 +838,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginLoadUnload) { observer.Wait(); } ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), L"", L"testPluginWorks()", &result)); + tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); EXPECT_TRUE(result); } @@ -868,7 +868,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginPrivate) { TabContents* tab = browser()->GetSelectedTabContents(); bool result = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), L"", L"testPluginWorks()", &result)); + tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); // We don't allow extension plugins to run on ChromeOS. #if defined(OS_CHROMEOS) EXPECT_FALSE(result); @@ -880,7 +880,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MAYBE_PluginPrivate) { ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(extension_dir.AppendASCII("test.html"))); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), L"", L"testPluginWorks()", &result)); + tab->GetRenderViewHost(), L"", L"testPluginWorks()", &result)); EXPECT_FALSE(result); } @@ -911,7 +911,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, DISABLED_OptionsPage) { chrome::kExtensionsSubPage)); TabStripModel* tab_strip = browser()->tabstrip_model(); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", jscript_click_option_button)); // If the options page hasn't already come up, wait for it. diff --git a/chrome/browser/extensions/extension_debugger_api.cc b/chrome/browser/extensions/extension_debugger_api.cc index c9bcb6c..9ceb318 100644 --- a/chrome/browser/extensions/extension_debugger_api.cc +++ b/chrome/browser/extensions/extension_debugger_api.cc @@ -139,7 +139,7 @@ ExtensionDevToolsClientHost::ExtensionDevToolsClientHost( // Attach to debugger and tell it we are ready. DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost( - tab_contents_->render_view_host()); + tab_contents_->GetRenderViewHost()); DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor(agent, this); } @@ -278,7 +278,7 @@ bool DebuggerFunction::InitClientHost() { if (!InitTabContents()) return false; - RenderViewHost* rvh = contents_->render_view_host(); + RenderViewHost* rvh = contents_->GetRenderViewHost(); client_host_ = AttachedClientHosts::GetInstance()->Lookup(rvh); if (!client_host_ || @@ -311,7 +311,7 @@ bool AttachDebuggerFunction::RunImpl() { } DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost( - contents_->render_view_host()); + contents_->GetRenderViewHost()); DevToolsClientHost* client_host = DevToolsManager::GetInstance()-> GetDevToolsClientHostFor(agent); diff --git a/chrome/browser/extensions/extension_devtools_bridge.cc b/chrome/browser/extensions/extension_devtools_bridge.cc index 1e59bc1..6b13e31 100644 --- a/chrome/browser/extensions/extension_devtools_bridge.cc +++ b/chrome/browser/extensions/extension_devtools_bridge.cc @@ -61,7 +61,7 @@ bool ExtensionDevToolsBridge::RegisterAsDevToolsClientHost() { &contents, &tab_index)) { DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost( - contents->tab_contents()->render_view_host()); + contents->tab_contents()->GetRenderViewHost()); if (devtools_manager->GetDevToolsClientHostFor(agent)) return false; diff --git a/chrome/browser/extensions/extension_devtools_browsertests.cc b/chrome/browser/extensions/extension_devtools_browsertests.cc index f41ebd3..f98fc89 100644 --- a/chrome/browser/extensions/extension_devtools_browsertests.cc +++ b/chrome/browser/extensions/extension_devtools_browsertests.cc @@ -79,7 +79,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionDevToolsBrowserTest, FLAKY_TimelineApi) { // Setting the events should have caused an ExtensionDevToolsBridge to be // registered for the tab's RenderViewHost. DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost( - tab_contents->render_view_host()); + tab_contents->GetRenderViewHost()); DevToolsClientHost* devtools_client_host = devtools_manager->GetDevToolsClientHostFor(agent); ASSERT_TRUE(devtools_client_host); @@ -96,7 +96,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionDevToolsBrowserTest, FLAKY_TimelineApi) { result = false; devtools_manager->UnregisterDevToolsClientHostFor( DevToolsAgentHostRegistry::GetDevToolsAgentHost( - tab_contents->render_view_host())); + tab_contents->GetRenderViewHost())); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( host->render_view_host(), L"", L"testReceiveTabCloseEvent()", &result)); EXPECT_TRUE(result); @@ -137,7 +137,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionDevToolsBrowserTest, ProcessRefCounting) { // to be registered for the tab's RenderViewHost. ASSERT_TRUE(devtools_manager->GetDevToolsClientHostFor( DevToolsAgentHostRegistry::GetDevToolsAgentHost( - tab_contents->render_view_host()))); + tab_contents->GetRenderViewHost()))); // Register listeners from the second extension as well. std::wstring script = base::StringPrintf(L"registerListenersForTab(%d)", @@ -154,7 +154,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionDevToolsBrowserTest, ProcessRefCounting) { EXPECT_TRUE(result); ASSERT_TRUE(devtools_manager->GetDevToolsClientHostFor( DevToolsAgentHostRegistry::GetDevToolsAgentHost( - tab_contents->render_view_host()))); + tab_contents->GetRenderViewHost()))); // Removing the listeners from the second extension should tear the bridge // down. @@ -164,5 +164,5 @@ IN_PROC_BROWSER_TEST_F(ExtensionDevToolsBrowserTest, ProcessRefCounting) { EXPECT_TRUE(result); ASSERT_FALSE(devtools_manager->GetDevToolsClientHostFor( DevToolsAgentHostRegistry::GetDevToolsAgentHost( - tab_contents->render_view_host()))); + tab_contents->GetRenderViewHost()))); } diff --git a/chrome/browser/extensions/extension_dom_clipboard_apitest.cc b/chrome/browser/extensions/extension_dom_clipboard_apitest.cc index 5328d9c..5584592 100644 --- a/chrome/browser/extensions/extension_dom_clipboard_apitest.cc +++ b/chrome/browser/extensions/extension_dom_clipboard_apitest.cc @@ -66,7 +66,7 @@ bool ClipboardApiTest::ExecutePasteInSelectedTab(bool* result) { bool ClipboardApiTest::ExecuteScriptInSelectedTab(const std::wstring& script, bool* result) { if (!ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetSelectedTabContents()->render_view_host(), + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", script, result)) { diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index 4763b17..f768075 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -141,7 +141,7 @@ ExtensionHost::ExtensionHost(const Extension* extension, renderer_preferences_util::UpdateFromSystemSettings( host_contents_->GetMutableRendererPrefs(), profile_); - render_view_host_ = host_contents_->render_view_host(); + render_view_host_ = host_contents_->GetRenderViewHost(); // Listen for when an extension is unloaded from the same profile, as it may // be the same extension that this points to. @@ -484,7 +484,7 @@ void ExtensionHost::RenderViewDeleted(RenderViewHost* render_view_host) { // RVH. There is sometimes a small gap between the pending RVH being deleted // and RenderViewCreated being called, so we update it here. if (render_view_host == render_view_host_) - render_view_host_ = host_contents_->render_view_host(); + render_view_host_ = host_contents_->GetRenderViewHost(); } content::JavaScriptDialogCreator* ExtensionHost::GetJavaScriptDialogCreator() { diff --git a/chrome/browser/extensions/extension_icon_source_apitest.cc b/chrome/browser/extensions/extension_icon_source_apitest.cc index fa46ba3..610bc5b 100644 --- a/chrome/browser/extensions/extension_icon_source_apitest.cc +++ b/chrome/browser/extensions/extension_icon_source_apitest.cc @@ -34,7 +34,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionIconSourceTest, IconsLoaded) { browser(), GURL("chrome-extension://gbmgkahjioeacddebbnengilkgbkhodg/index.html")); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(document.title)", &result)); EXPECT_EQ(result, "Loaded"); @@ -45,7 +45,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionIconSourceTest, IconsLoaded) { browser(), GURL("chrome-extension://apocjbpjpkghdepdngjlknfpmabcmlao/index.html")); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(document.title)", &result)); EXPECT_EQ(result, "Not Loaded"); @@ -67,7 +67,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionIconSourceTest, IconsLoadedIncognito) { Browser* otr_browser = BrowserList::FindTabbedBrowser( browser()->profile()->GetOffTheRecordProfile(), false); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - otr_browser->GetSelectedTabContents()->render_view_host(), L"", + otr_browser->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(document.title)", &result)); EXPECT_EQ(result, "Loaded"); @@ -78,7 +78,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionIconSourceTest, IconsLoadedIncognito) { browser()->profile(), GURL("chrome-extension://apocjbpjpkghdepdngjlknfpmabcmlao/index.html")); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - otr_browser->GetSelectedTabContents()->render_view_host(), L"", + otr_browser->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(document.title)", &result)); EXPECT_EQ(result, "Not Loaded"); diff --git a/chrome/browser/extensions/extension_incognito_apitest.cc b/chrome/browser/extensions/extension_incognito_apitest.cc index c820b48..507db06 100644 --- a/chrome/browser/extensions/extension_incognito_apitest.cc +++ b/chrome/browser/extensions/extension_incognito_apitest.cc @@ -36,7 +36,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoNoScript) { // Verify the script didn't run. bool result = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), L"", + tab->GetRenderViewHost(), L"", L"window.domAutomationController.send(document.title == 'Unmodified')", &result)); EXPECT_TRUE(result); @@ -73,7 +73,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoYesScript) { // Verify the script ran. bool result = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), L"", + tab->GetRenderViewHost(), L"", L"window.domAutomationController.send(document.title == 'modified')", &result)); EXPECT_TRUE(result); diff --git a/chrome/browser/extensions/extension_message_service.cc b/chrome/browser/extensions/extension_message_service.cc index 9bf1402..efacfed 100644 --- a/chrome/browser/extensions/extension_message_service.cc +++ b/chrome/browser/extensions/extension_message_service.cc @@ -194,9 +194,9 @@ void ExtensionMessageService::OpenChannelToTab( MessagePort receiver; if (ExtensionTabUtil::GetTabById(tab_id, profile, true, NULL, NULL, &contents, NULL)) { - receiver.sender = contents->tab_contents()->render_view_host(); + receiver.sender = contents->tab_contents()->GetRenderViewHost(); receiver.routing_id = - contents->tab_contents()->render_view_host()->routing_id(); + contents->tab_contents()->GetRenderViewHost()->routing_id(); } if (contents && contents->tab_contents()->controller().needs_reload()) { @@ -298,8 +298,8 @@ int ExtensionMessageService::OpenSpecialChannelToTab( AllocatePortIdPair(&port1_id, &port2_id); MessagePort receiver( - target_tab_contents->render_view_host(), - target_tab_contents->render_view_host()->routing_id()); + target_tab_contents->GetRenderViewHost(), + target_tab_contents->GetRenderViewHost()->routing_id()); if (!OpenChannelImpl(source, "null", receiver, port2_id, extension_id, extension_id, channel_name)) return -1; diff --git a/chrome/browser/extensions/extension_nacl_browsertest.cc b/chrome/browser/extensions/extension_nacl_browsertest.cc index aa37a88..7e40a0f 100644 --- a/chrome/browser/extensions/extension_nacl_browsertest.cc +++ b/chrome/browser/extensions/extension_nacl_browsertest.cc @@ -96,11 +96,11 @@ class NaClExtensionTest : public ExtensionBrowserTest { bool content_handler_plugin_created = false; TabContents* tab_contents = browser()->GetSelectedTabContents(); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab_contents->render_view_host(), L"", + tab_contents->GetRenderViewHost(), L"", L"window.domAutomationController.send(EmbeddedPluginCreated());", &embedded_plugin_created)); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab_contents->render_view_host(), L"", + tab_contents->GetRenderViewHost(), L"", L"window.domAutomationController.send(ContentHandlerPluginCreated());", &content_handler_plugin_created)); diff --git a/chrome/browser/extensions/extension_resource_request_policy_apitest.cc b/chrome/browser/extensions/extension_resource_request_policy_apitest.cc index 3c0eacb..d4ece46 100644 --- a/chrome/browser/extensions/extension_resource_request_policy_apitest.cc +++ b/chrome/browser/extensions/extension_resource_request_policy_apitest.cc @@ -47,7 +47,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest, OriginPrivileges) { browser(), web_resource.ReplaceComponents(make_host_a_com)); std::string result; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(document.title)", &result)); EXPECT_EQ(result, "Loaded"); @@ -59,7 +59,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest, OriginPrivileges) { "non_existent_extension.html")); ui_test_utils::NavigateToURL(browser(), non_existent_extension); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(document.title)", &result)); EXPECT_EQ(result, "Image failed to load"); @@ -73,7 +73,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest, OriginPrivileges) { ui_test_utils::NavigateToURL(browser(), GURL(std::string("data:text/html;charset=utf-8,") + file_source)); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(document.title)", &result)); EXPECT_EQ(result, "Loaded"); @@ -87,7 +87,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest, OriginPrivileges) { browser(), GURL("chrome-extension://pbkkcbgdkliohhfaeefcijaghglkahja/index.html")); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(document.title)", &result)); EXPECT_EQ(result, "Loaded"); diff --git a/chrome/browser/extensions/extension_startup_browsertest.cc b/chrome/browser/extensions/extension_startup_browsertest.cc index 0aa319c..092066d 100644 --- a/chrome/browser/extensions/extension_startup_browsertest.cc +++ b/chrome/browser/extensions/extension_startup_browsertest.cc @@ -115,7 +115,7 @@ class ExtensionStartupTestBase : public InProcessBrowserTest { bool result = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(" L"document.defaultView.getComputedStyle(document.body, null)." L"getPropertyValue('background-color') == 'rgb(245, 245, 220)')", @@ -124,7 +124,7 @@ class ExtensionStartupTestBase : public InProcessBrowserTest { result = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(document.title == 'Modified')", &result)); EXPECT_EQ(expect_script, result); diff --git a/chrome/browser/extensions/extension_tab_helper.cc b/chrome/browser/extensions/extension_tab_helper.cc index 71b58f1..5273696 100644 --- a/chrome/browser/extensions/extension_tab_helper.cc +++ b/chrome/browser/extensions/extension_tab_helper.cc @@ -169,7 +169,7 @@ void ExtensionTabHelper::OnGetAppNotifyChannel( ExtensionService* extension_service = profile->GetExtensionService(); extensions::ProcessMap* process_map = extension_service->process_map(); content::RenderProcessHost* process = - tab_contents_wrapper()->tab_contents()->render_view_host()->process(); + tab_contents_wrapper()->tab_contents()->GetRenderProcessHost(); const Extension* extension = extension_service->GetInstalledApp(requestor_url); bool allowed = @@ -222,7 +222,7 @@ void ExtensionTabHelper::AppNotifyChannelSetupComplete( void ExtensionTabHelper::OnRequest( const ExtensionHostMsg_Request_Params& request) { extension_function_dispatcher_.Dispatch(request, - tab_contents()->render_view_host()); + tab_contents()->GetRenderViewHost()); } void ExtensionTabHelper::UpdateExtensionAppIcon(const Extension* extension) { diff --git a/chrome/browser/extensions/extension_tab_id_map.cc b/chrome/browser/extensions/extension_tab_id_map.cc index e4cfacd..d8e9c69c 100644 --- a/chrome/browser/extensions/extension_tab_id_map.cc +++ b/chrome/browser/extensions/extension_tab_id_map.cc @@ -84,7 +84,7 @@ void ExtensionTabIdMap::TabObserver::Observe( case content::NOTIFICATION_TAB_PARENTED: { TabContentsWrapper* tab = content::Source<TabContentsWrapper>(source).ptr(); - RenderViewHost* host = tab->tab_contents()->render_view_host(); + RenderViewHost* host = tab->tab_contents()->GetRenderViewHost(); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind( @@ -103,7 +103,7 @@ void ExtensionTabIdMap::TabObserver::Observe( TabContentsWrapper::GetCurrentWrapperForContents(contents); if (!tab) break; - RenderViewHost* host = tab->tab_contents()->render_view_host(); + RenderViewHost* host = tab->tab_contents()->GetRenderViewHost(); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind( diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc index d5af4f9..3f182fa 100644 --- a/chrome/browser/extensions/extension_tabs_module.cc +++ b/chrome/browser/extensions/extension_tabs_module.cc @@ -1108,7 +1108,7 @@ bool UpdateTabFunction::RunImpl() { params.in_main_world = true; RenderViewHost* render_view_host = - contents->tab_contents()->render_view_host(); + contents->tab_contents()->GetRenderViewHost(); render_view_host->Send( new ExtensionMsg_ExecuteCode(render_view_host->routing_id(), params)); @@ -1410,7 +1410,7 @@ bool RemoveTabsFunction::RunImpl() { // path should ensure that the tab is safely closed under such // circumstances, whereas |Browser::CloseTabContents()| does not. RenderViewHost* render_view_host = - contents->tab_contents()->render_view_host(); + contents->tab_contents()->GetRenderViewHost(); render_view_host->delegate()->Close(render_view_host); } return true; @@ -1474,7 +1474,7 @@ bool CaptureVisibleTabFunction::RunImpl() { if (!GetExtension()->CanCaptureVisiblePage(tab_contents->GetURL(), &error_)) return false; - RenderViewHost* render_view_host = tab_contents->render_view_host(); + RenderViewHost* render_view_host = tab_contents->GetRenderViewHost(); // If a backing store is cached for the tab we want to capture, // and it can be copied into a bitmap, then use it to generate the image. diff --git a/chrome/browser/extensions/extension_webnavigation_apitest.cc b/chrome/browser/extensions/extension_webnavigation_apitest.cc index 89f6ad3..7cfa559 100644 --- a/chrome/browser/extensions/extension_webnavigation_apitest.cc +++ b/chrome/browser/extensions/extension_webnavigation_apitest.cc @@ -213,9 +213,9 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationRequestOpenTab) { mouse_event.x = 7; mouse_event.y = 7; mouse_event.clickCount = 1; - tab->render_view_host()->ForwardMouseEvent(mouse_event); + tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); mouse_event.type = WebKit::WebInputEvent::MouseUp; - tab->render_view_host()->ForwardMouseEvent(mouse_event); + tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); } diff --git a/chrome/browser/extensions/extension_webrequest_apitest.cc b/chrome/browser/extensions/extension_webrequest_apitest.cc index f49f4f0..5246ce6 100644 --- a/chrome/browser/extensions/extension_webrequest_apitest.cc +++ b/chrome/browser/extensions/extension_webrequest_apitest.cc @@ -108,9 +108,9 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestNewTab) { mouse_event.x = 7; mouse_event.y = 7; mouse_event.clickCount = 1; - tab->render_view_host()->ForwardMouseEvent(mouse_event); + tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); mouse_event.type = WebKit::WebInputEvent::MouseUp; - tab->render_view_host()->ForwardMouseEvent(mouse_event); + tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); } diff --git a/chrome/browser/extensions/isolated_app_browsertest.cc b/chrome/browser/extensions/isolated_app_browsertest.cc index a14d87a..79424ba 100644 --- a/chrome/browser/extensions/isolated_app_browsertest.cc +++ b/chrome/browser/extensions/isolated_app_browsertest.cc @@ -37,7 +37,7 @@ class IsolatedAppTest : public ExtensionBrowserTest { ExtensionService* service = profile->GetExtensionService(); if (service) { installed_app = service->GetInstalledAppForRenderer( - contents->render_view_host()->process()->GetID()); + contents->GetRenderProcessHost()->GetID()); } return installed_app; } diff --git a/chrome/browser/extensions/webstore_inline_install_browsertest.cc b/chrome/browser/extensions/webstore_inline_install_browsertest.cc index 037fec5..3b51825 100644 --- a/chrome/browser/extensions/webstore_inline_install_browsertest.cc +++ b/chrome/browser/extensions/webstore_inline_install_browsertest.cc @@ -71,7 +71,7 @@ class WebstoreInlineInstallTest : public InProcessBrowserTest { std::string script = StringPrintf("%s('%s')", test_function_name.c_str(), test_gallery_url_.c_str()); ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", UTF8ToWide(script), &result)); EXPECT_TRUE(result); } diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index 603df3d..4b88ee1 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -187,7 +187,7 @@ bool ExternalTabContainer::Init(Profile* profile, handle_top_level_requests; if (!existing_contents) { - tab_contents_->tab_contents()->render_view_host()->AllowBindings( + tab_contents_->tab_contents()->GetRenderViewHost()->AllowBindings( content::BINDINGS_POLICY_EXTERNAL_HOST); } @@ -240,7 +240,8 @@ bool ExternalTabContainer::Init(Profile* profile, void ExternalTabContainer::Uninitialize() { registrar_.RemoveAll(); if (tab_contents_.get()) { - UnregisterRenderViewHost(tab_contents_->tab_contents()->render_view_host()); + UnregisterRenderViewHost( + tab_contents_->tab_contents()->GetRenderViewHost()); if (GetWidget()->GetRootView()) GetWidget()->GetRootView()->RemoveAllChildViews(true); @@ -479,7 +480,7 @@ void ExternalTabContainer::AddNewContents(TabContents* source, } void ExternalTabContainer::TabContentsCreated(TabContents* new_contents) { - RenderViewHost* rvh = new_contents->render_view_host(); + RenderViewHost* rvh = new_contents->GetRenderViewHost(); DCHECK(rvh != NULL); // Register this render view as a pending render view, i.e. any network @@ -1004,12 +1005,12 @@ bool ExternalTabContainer::AcceleratorPressed( DCHECK(iter != accelerator_table_.end()); if (!tab_contents_.get() || - !tab_contents_->tab_contents()->render_view_host()) { + !tab_contents_->tab_contents()->GetRenderViewHost()) { NOTREACHED(); return false; } - RenderViewHost* host = tab_contents_->tab_contents()->render_view_host(); + RenderViewHost* host = tab_contents_->tab_contents()->GetRenderViewHost(); int command_id = iter->second; switch (command_id) { case IDC_ZOOM_PLUS: @@ -1023,17 +1024,17 @@ bool ExternalTabContainer::AcceleratorPressed( break; case IDC_DEV_TOOLS: DevToolsWindow::ToggleDevToolsWindow( - tab_contents_->tab_contents()->render_view_host(), + tab_contents_->tab_contents()->GetRenderViewHost(), DEVTOOLS_TOGGLE_ACTION_NONE); break; case IDC_DEV_TOOLS_CONSOLE: DevToolsWindow::ToggleDevToolsWindow( - tab_contents_->tab_contents()->render_view_host(), + tab_contents_->tab_contents()->GetRenderViewHost(), DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE); break; case IDC_DEV_TOOLS_INSPECT: DevToolsWindow::ToggleDevToolsWindow( - tab_contents_->tab_contents()->render_view_host(), + tab_contents_->tab_contents()->GetRenderViewHost(), DEVTOOLS_TOGGLE_ACTION_INSPECT); break; default: @@ -1104,7 +1105,7 @@ void ExternalTabContainer::LoadAccelerators() { void ExternalTabContainer::OnReinitialize() { if (load_requests_via_automation_) { - RenderViewHost* rvh = tab_contents_->tab_contents()->render_view_host(); + RenderViewHost* rvh = tab_contents_->tab_contents()->GetRenderViewHost(); if (rvh) { AutomationResourceMessageFilter::ResumePendingRenderView( rvh->process()->GetID(), rvh->routing_id(), diff --git a/chrome/browser/favicon/favicon_tab_helper.cc b/chrome/browser/favicon/favicon_tab_helper.cc index f94fd83..6a1d721 100644 --- a/chrome/browser/favicon/favicon_tab_helper.cc +++ b/chrome/browser/favicon/favicon_tab_helper.cc @@ -132,7 +132,7 @@ NavigationEntry* FaviconTabHelper::GetActiveEntry() { } void FaviconTabHelper::StartDownload(int id, const GURL& url, int image_size) { - RenderViewHost* host = tab_contents()->render_view_host(); + RenderViewHost* host = tab_contents()->GetRenderViewHost(); host->Send(new IconMsg_DownloadFavicon( host->routing_id(), id, url, image_size)); } diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc index 902aa6a..0fe86e45 100644 --- a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc +++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc @@ -99,15 +99,14 @@ class GeolocationPermissionContextTests : public TabContentsWrapperTestHarness { virtual ~GeolocationPermissionContextTests(); int process_id() { - return contents()->render_view_host()->process()->GetID(); + return contents()->GetRenderProcessHost()->GetID(); } int process_id_for_tab(int tab) { - return extra_tabs_[tab]->tab_contents()->render_view_host()->process()-> - GetID(); + return extra_tabs_[tab]->tab_contents()->GetRenderProcessHost()->GetID(); } - int render_id() { return contents()->render_view_host()->routing_id(); } + int render_id() { return contents()->GetRenderViewHost()->routing_id(); } int render_id_for_tab(int tab) { - return extra_tabs_[tab]->tab_contents()->render_view_host()->routing_id(); + return extra_tabs_[tab]->tab_contents()->GetRenderViewHost()->routing_id(); } int bridge_id() const { return 42; } // Not relevant at this level. InfoBarTabHelper* infobar_tab_helper() { @@ -193,7 +192,7 @@ void GeolocationPermissionContextTests::CheckPermissionMessageSentForTab( int bridge_id, bool allowed) { CheckPermissionMessageSentInternal(static_cast<MockRenderProcessHost*>( - extra_tabs_[tab]->tab_contents()->render_view_host()->process()), + extra_tabs_[tab]->tab_contents()->GetRenderProcessHost()), bridge_id, allowed); } diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc index 6f324d92..712ce9b 100644 --- a/chrome/browser/geolocation/geolocation_browsertest.cc +++ b/chrome/browser/geolocation/geolocation_browsertest.cc @@ -56,7 +56,7 @@ class IFrameLoader : public content::NotificationObserver { "window.domAutomationController.send(addIFrame(%d, \"%s\"));", iframe_id, url.spec().c_str()); - browser->GetSelectedTabContents()->render_view_host()-> + browser->GetSelectedTabContents()->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), UTF8ToUTF16(script)); ui_test_utils::RunMessageLoop(); @@ -67,7 +67,7 @@ class IFrameLoader : public content::NotificationObserver { "window.domAutomationController.send(getIFrameSrc(%d))", iframe_id); std::string iframe_src; EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser->GetSelectedTabContents()->render_view_host(), + browser->GetSelectedTabContents()->GetRenderViewHost(), L"", UTF8ToWide(script), &iframe_src)); iframe_url_ = GURL(iframe_src); } @@ -280,7 +280,7 @@ class GeolocationBrowserTest : public InProcessBrowserTest { void AddGeolocationWatch(bool wait_for_infobar) { GeolocationNotificationObserver notification_observer(wait_for_infobar); notification_observer.AddWatchAndWaitForNotification( - current_browser_->GetSelectedTabContents()->render_view_host(), + current_browser_->GetSelectedTabContents()->GetRenderViewHost(), iframe_xpath_); if (wait_for_infobar) { EXPECT_TRUE(notification_observer.infobar_); @@ -351,7 +351,7 @@ class GeolocationBrowserTest : public InProcessBrowserTest { "window.domAutomationController.send(%s)", function.c_str()); std::string result; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - tab_contents->render_view_host(), + tab_contents->GetRenderViewHost(), iframe_xpath_, UTF8ToWide(script), &result)); EXPECT_EQ(expected, result); } @@ -638,7 +638,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, TwoWatchesInOneFrame) { final_position.latitude, final_position.longitude); std::string js_result; EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - current_browser_->GetSelectedTabContents()->render_view_host(), + current_browser_->GetSelectedTabContents()->GetRenderViewHost(), L"", UTF8ToWide(script), &js_result)); EXPECT_EQ(js_result, "ok"); @@ -678,7 +678,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, DISABLED_TabDestroyed) { "window.domAutomationController.send(window.close());"; bool result = ui_test_utils::ExecuteJavaScript( - current_browser_->GetSelectedTabContents()->render_view_host(), + current_browser_->GetSelectedTabContents()->GetRenderViewHost(), L"", UTF8ToWide(script)); EXPECT_EQ(result, true); } diff --git a/chrome/browser/gpu_pixel_browsertest.cc b/chrome/browser/gpu_pixel_browsertest.cc index 26581fa..1ebac25 100644 --- a/chrome/browser/gpu_pixel_browsertest.cc +++ b/chrome/browser/gpu_pixel_browsertest.cc @@ -273,7 +273,7 @@ IN_PROC_BROWSER_TEST_F(GpuPixelBrowserTest, DISABLED_WebGLTeapot) { gfx::Size container_size(500, 500); ResizeTabContainer(browser(), container_size); ASSERT_TRUE(ui_test_utils::TakeRenderWidgetSnapshot( - browser()->GetSelectedTabContents()->render_view_host(), + browser()->GetSelectedTabContents()->GetRenderViewHost(), container_size, &bitmap)); ASSERT_TRUE(CompareImages(bitmap, "")); } diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc index 96ad8e3..93f389e 100644 --- a/chrome/browser/instant/instant_browsertest.cc +++ b/chrome/browser/instant/instant_browsertest.cc @@ -138,7 +138,7 @@ class InstantTest : public InProcessBrowserTest { bool SetSuggestionsJavascriptArgument(const std::string& argument) { std::wstring script = UTF8ToWide(base::StringPrintf( "window.setSuggestionsArgument = %s;", argument.c_str())); - RenderViewHost* rvh = preview()->tab_contents()->render_view_host(); + RenderViewHost* rvh = preview()->tab_contents()->GetRenderViewHost(); return ui_test_utils::ExecuteJavaScript(rvh, std::wstring(), script); } @@ -151,21 +151,21 @@ class InstantTest : public InProcessBrowserTest { const std::string& script, std::string* result) { return ui_test_utils::ExecuteJavaScriptAndExtractString( - tab->render_view_host(), std::wstring(), WrapScript(script), result); + tab->GetRenderViewHost(), std::wstring(), WrapScript(script), result); } bool GetIntFromJavascript(TabContents* tab, const std::string& script, int* result) { return ui_test_utils::ExecuteJavaScriptAndExtractInt( - tab->render_view_host(), std::wstring(), WrapScript(script), result); + tab->GetRenderViewHost(), std::wstring(), WrapScript(script), result); } bool GetBoolFromJavascript(TabContents* tab, const std::string& script, bool* result) { return ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), std::wstring(), WrapScript(script), result); + tab->GetRenderViewHost(), std::wstring(), WrapScript(script), result); } bool CheckVisibilityIs(TabContents* tab, bool visible) { @@ -601,7 +601,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(SearchToNonSearch)) { // Send onchange so that the page sends up suggestions. See the comments in // NonSearchToSearch for why this is needed. ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( - preview()->tab_contents()->render_view_host(), std::wstring(), + preview()->tab_contents()->GetRenderViewHost(), std::wstring(), L"window.chrome.searchBox.onchange();")); ASSERT_TRUE(WaitForMessageToBeProcessedByRenderer()); diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc index 8b79e93..1a8dce4 100644 --- a/chrome/browser/instant/instant_loader.cc +++ b/chrome/browser/instant/instant_loader.cc @@ -149,7 +149,7 @@ void InstantLoader::FrameLoadObserver::Observe( loader_->SendBoundsToPage(true); // TODO: support real cursor position. int text_length = static_cast<int>(text_.size()); - RenderViewHost* host = tab_contents_->render_view_host(); + RenderViewHost* host = tab_contents_->GetRenderViewHost(); host->Send(new ChromeViewMsg_DetermineIfPageSupportsInstant( host->routing_id(), text_, verbatim_, text_length, text_length)); break; @@ -671,7 +671,7 @@ bool InstantLoader::Update(TabContentsWrapper* tab_contents, // TODO: support real cursor position. int text_length = static_cast<int>(user_text_.size()); RenderViewHost* host = - preview_contents_->tab_contents()->render_view_host(); + preview_contents_->tab_contents()->GetRenderViewHost(); host->Send(new ChromeViewMsg_SearchBoxChange( host->routing_id(), user_text_, verbatim, text_length, text_length)); @@ -741,7 +741,7 @@ TabContentsWrapper* InstantLoader::ReleasePreviewContents( if (type != INSTANT_COMMIT_DESTROY && is_showing_instant()) { RenderViewHost* host = - preview_contents_->tab_contents()->render_view_host(); + preview_contents_->tab_contents()->GetRenderViewHost(); if (type == INSTANT_COMMIT_FOCUS_LOST) { host->Send(new ChromeViewMsg_SearchBoxCancel(host->routing_id())); } else { @@ -967,7 +967,7 @@ void InstantLoader::SendBoundsToPage(bool force_if_waiting) { (force_if_waiting || !is_determining_if_page_supports_instant())) { last_omnibox_bounds_ = omnibox_bounds_; RenderViewHost* host = - preview_contents_->tab_contents()->render_view_host(); + preview_contents_->tab_contents()->GetRenderViewHost(); host->Send(new ChromeViewMsg_SearchBoxResize( host->routing_id(), GetOmniboxBoundsInTermsOfPreview())); } @@ -1088,7 +1088,7 @@ void InstantLoader::LoadInstantURL(TabContentsWrapper* tab_contents, instant_url = GURL(cl->GetSwitchValueASCII(switches::kInstantURL)); preview_contents_->tab_contents()->controller().LoadURL( instant_url, content::Referrer(), transition_type, std::string()); - RenderViewHost* host = preview_contents_->tab_contents()->render_view_host(); + RenderViewHost* host = preview_contents_->tab_contents()->GetRenderViewHost(); preview_contents_->tab_contents()->HideContents(); // If user_text is empty, this must be a preload of the search homepage. In diff --git a/chrome/browser/instant/instant_unload_handler.cc b/chrome/browser/instant/instant_unload_handler.cc index a999439..c3f4f82 100644 --- a/chrome/browser/instant/instant_unload_handler.cc +++ b/chrome/browser/instant/instant_unload_handler.cc @@ -85,7 +85,7 @@ void InstantUnloadHandler::RunUnloadListenersOrDestroy(TabContentsWrapper* tab, // TODO: decide if we really want false here. false is used for tab closes, // and is needed so that the tab correctly closes but it doesn't really match // what's logically happening. - tab->tab_contents()->render_view_host()->FirePageBeforeUnload(false); + tab->tab_contents()->GetRenderViewHost()->FirePageBeforeUnload(false); } void InstantUnloadHandler::Activate(TabContentsDelegateImpl* delegate) { diff --git a/chrome/browser/magic_iframe_browsertest.cc b/chrome/browser/magic_iframe_browsertest.cc index aa1fef5..ed54a64 100644 --- a/chrome/browser/magic_iframe_browsertest.cc +++ b/chrome/browser/magic_iframe_browsertest.cc @@ -43,7 +43,7 @@ IN_PROC_BROWSER_TEST_F(MagicIframeBrowserTest, TransferIframeCloseWindow) { ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(browser(), url, 3); std::string result; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - browser()->GetSelectedTabContents()->render_view_host(), L"", + browser()->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(getLog())", &result)); ASSERT_NE(result.find("DONE"), std::string::npos) << result; } diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc index 77e504c..ccde276 100644 --- a/chrome/browser/notifications/balloon_host.cc +++ b/chrome/browser/notifications/balloon_host.cc @@ -106,7 +106,7 @@ bool BalloonHost::OnMessageReceived(const IPC::Message& message) { void BalloonHost::OnRequest(const ExtensionHostMsg_Request_Params& params) { extension_function_dispatcher_.Dispatch(params, - tab_contents_->render_view_host()); + tab_contents_->GetRenderViewHost()); } void BalloonHost::Init() { diff --git a/chrome/browser/password_manager_delegate_impl.cc b/chrome/browser/password_manager_delegate_impl.cc index accc63a..da7a6e2 100644 --- a/chrome/browser/password_manager_delegate_impl.cc +++ b/chrome/browser/password_manager_delegate_impl.cc @@ -111,9 +111,9 @@ bool SavePasswordInfoBarDelegate::Cancel() { void PasswordManagerDelegateImpl::FillPasswordForm( const webkit::forms::PasswordFormFillData& form_data) { - tab_contents_->tab_contents()->render_view_host()->Send( + tab_contents_->tab_contents()->GetRenderViewHost()->Send( new AutofillMsg_FillPasswordForm( - tab_contents_->tab_contents()->render_view_host()->routing_id(), + tab_contents_->tab_contents()->GetRenderViewHost()->routing_id(), form_data)); } diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc index 412df3c..cdea761 100644 --- a/chrome/browser/prerender/prerender_browsertest.cc +++ b/chrome/browser/prerender/prerender_browsertest.cc @@ -537,7 +537,7 @@ class PrerenderBrowserTest : public InProcessBrowserTest { content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::NotificationService::AllSources()); RenderViewHost* render_view_host = - browser->GetSelectedTabContents()->render_view_host(); + browser->GetSelectedTabContents()->GetRenderViewHost(); render_view_host->ExecuteJavascriptInWebFrame( string16(), ASCIIToUTF16("ClickOpenLink()")); @@ -569,7 +569,7 @@ class PrerenderBrowserTest : public InProcessBrowserTest { back_nav_observer.Wait(); bool original_prerender_page = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser->GetSelectedTabContents()->render_view_host(), L"", + browser->GetSelectedTabContents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(IsOriginalPrerenderPage())", &original_prerender_page)); EXPECT_TRUE(original_prerender_page); @@ -589,7 +589,7 @@ class PrerenderBrowserTest : public InProcessBrowserTest { back_nav_observer.Wait(); bool js_result; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), L"", + tab->GetRenderViewHost(), L"", L"window.domAutomationController.send(DidBackToOriginalPagePass())", &js_result)); EXPECT_TRUE(js_result); @@ -787,7 +787,7 @@ class PrerenderBrowserTest : public InProcessBrowserTest { bool display_test_result = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab_contents->render_view_host(), L"", + tab_contents->GetRenderViewHost(), L"", L"window.domAutomationController.send(DidDisplayPass())", &display_test_result)); EXPECT_TRUE(display_test_result); @@ -803,7 +803,7 @@ class PrerenderBrowserTest : public InProcessBrowserTest { ASSERT_TRUE(prerender_contents != NULL); RenderViewHost* render_view_host = - browser()->GetSelectedTabContents()->render_view_host(); + browser()->GetSelectedTabContents()->GetRenderViewHost(); render_view_host->ExecuteJavascriptInWebFrame( string16(), ASCIIToUTF16(javascript_function_name)); @@ -1881,7 +1881,7 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, DisableJavascriptCalls(); TabContents* tab_contents = browser()->GetSelectedTabContents(); DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost( - tab_contents->render_view_host()); + tab_contents->GetRenderViewHost()); DevToolsManager* manager = DevToolsManager::GetInstance(); FakeDevToolsClientHost client_host; manager->RegisterDevToolsClientHostFor(agent, &client_host); diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc index 19f6d3b..f122924 100644 --- a/chrome/browser/prerender/prerender_contents.cc +++ b/chrome/browser/prerender/prerender_contents.cc @@ -671,7 +671,7 @@ RenderViewHost* PrerenderContents::render_view_host_mutable() { const RenderViewHost* PrerenderContents::render_view_host() const { if (!prerender_contents_.get()) return NULL; - return prerender_contents_->tab_contents()->render_view_host(); + return prerender_contents_->tab_contents()->GetRenderViewHost(); } void PrerenderContents::CommitHistory(TabContentsWrapper* tab) { diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc index 3125e1e..b53878b 100644 --- a/chrome/browser/prerender/prerender_manager.cc +++ b/chrome/browser/prerender/prerender_manager.cc @@ -607,10 +607,10 @@ bool PrerenderManager::MaybeUsePrerenderedPage(TabContents* tab_contents, } // If the session storage namespaces don't match, cancel the prerender. - RenderViewHost* old_render_view_host = tab_contents->render_view_host(); + RenderViewHost* old_render_view_host = tab_contents->GetRenderViewHost(); RenderViewHost* new_render_view_host = prerender_contents->prerender_contents()->tab_contents()-> - render_view_host(); + GetRenderViewHost(); DCHECK(old_render_view_host); DCHECK(new_render_view_host); if (old_render_view_host->session_storage_namespace() != @@ -694,7 +694,7 @@ bool PrerenderManager::MaybeUsePrerenderedPage(TabContents* tab_contents, // Schedule the delete to occur after the tab has run its unload handlers. on_close_tab_contents_deleters_.push_back( new OnCloseTabContentsDeleter(this, old_tab_contents)); - old_tab_contents->tab_contents()->render_view_host()-> + old_tab_contents->tab_contents()->GetRenderViewHost()-> FirePageBeforeUnload(false); } else { // No unload handler to run, so delete asap. @@ -913,7 +913,7 @@ bool PrerenderManager::IsOldRenderViewHost( old_tab_contents_list_.begin(); it != old_tab_contents_list_.end(); ++it) { - if ((*it)->tab_contents()->render_view_host() == render_view_host) + if ((*it)->tab_contents()->GetRenderViewHost() == render_view_host) return true; } return false; diff --git a/chrome/browser/printing/background_printing_manager.cc b/chrome/browser/printing/background_printing_manager.cc index 9ccf27e..7547d035 100644 --- a/chrome/browser/printing/background_printing_manager.cc +++ b/chrome/browser/printing/background_printing_manager.cc @@ -60,7 +60,7 @@ void BackgroundPrintingManager::OwnPrintPreviewTab( // Multiple sites may share the same RenderProcessHost, so check if this // notification has already been added. content::RenderProcessHost* rph = - preview_tab->tab_contents()->render_view_host()->process(); + preview_tab->tab_contents()->GetRenderProcessHost(); if (!registrar_.IsRegistered(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, content::Source<content::RenderProcessHost>( @@ -115,7 +115,7 @@ void BackgroundPrintingManager::OnRendererProcessClosed( TabContentsWrapperSet::const_iterator it; for (it = begin(); it != end(); ++it) { TabContentsWrapper* preview_tab = *it; - if (preview_tab->tab_contents()->render_view_host()->process() == rph) { + if (preview_tab->tab_contents()->GetRenderProcessHost() == rph) { preview_tabs_pending_deletion.insert(preview_tab); } } @@ -148,7 +148,7 @@ void BackgroundPrintingManager::OnTabContentsDestroyed( HasSharedRenderProcessHost(printing_tabs_pending_deletion_, preview_tab); if (!shared_rph) { content::RenderProcessHost* rph = - preview_tab->tab_contents()->render_view_host()->process(); + preview_tab->tab_contents()->GetRenderProcessHost(); registrar_.Remove(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, content::Source<content::RenderProcessHost>(rph)); } @@ -176,14 +176,13 @@ void BackgroundPrintingManager::DeletePreviewTab(TabContentsWrapper* tab) { bool BackgroundPrintingManager::HasSharedRenderProcessHost( const TabContentsWrapperSet& set, TabContentsWrapper* tab) { - content::RenderProcessHost* rph = - tab->tab_contents()->render_view_host()->process(); + content::RenderProcessHost* rph = tab->tab_contents()->GetRenderProcessHost(); for (TabContentsWrapperSet::const_iterator it = set.begin(); it != set.end(); ++it) { TabContentsWrapper* iter_tab = *it; if ((iter_tab != tab) && - (iter_tab->tab_contents()->render_view_host()->process() == rph)) { + (iter_tab->tab_contents()->GetRenderProcessHost() == rph)) { return true; } } diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc index 7e87d7d..097829a 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc @@ -330,7 +330,7 @@ void CloudPrintSetupFlow::ExecuteJavascriptInIFrame( const string16& iframe_xpath, const string16& js) { if (web_ui_) { - RenderViewHost* rvh = web_ui_->tab_contents()->render_view_host(); + RenderViewHost* rvh = web_ui_->tab_contents()->GetRenderViewHost(); rvh->ExecuteJavascriptInWebFrame(iframe_xpath, js); } } diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc index 59707b5..c9e33dd 100644 --- a/chrome/browser/printing/print_dialog_cloud.cc +++ b/chrome/browser/printing/print_dialog_cloud.cc @@ -323,7 +323,7 @@ void CloudPrintFlowHandler::Observe( if (url.host() == dialog_url.host() && url.path() == dialog_url.path() && url.scheme() == dialog_url.scheme()) { - RenderViewHost* rvh = web_ui_->tab_contents()->render_view_host(); + RenderViewHost* rvh = web_ui_->tab_contents()->GetRenderViewHost(); if (rvh && rvh->delegate()) { WebPreferences webkit_prefs = rvh->delegate()->GetWebkitPrefs(); webkit_prefs.allow_scripts_to_close_windows = true; @@ -349,7 +349,7 @@ void CloudPrintFlowHandler::HandleShowDebugger(const ListValue* args) { void CloudPrintFlowHandler::ShowDebugger() { if (web_ui_) { - RenderViewHost* rvh = web_ui_->tab_contents()->render_view_host(); + RenderViewHost* rvh = web_ui_->tab_contents()->GetRenderViewHost(); if (rvh) DevToolsWindow::OpenDevToolsWindow(rvh); } diff --git a/chrome/browser/printing/print_dialog_cloud_uitest.cc b/chrome/browser/printing/print_dialog_cloud_uitest.cc index 945ca41..9332346 100644 --- a/chrome/browser/printing/print_dialog_cloud_uitest.cc +++ b/chrome/browser/printing/print_dialog_cloud_uitest.cc @@ -267,10 +267,10 @@ IN_PROC_BROWSER_TEST_F(PrintDialogCloudTest, DISABLED_DialogGrabbed) { // This goes back one step further for the Chrome OS case, to making // sure 'window.print()' gets to the right place. ASSERT_TRUE(browser()->GetSelectedTabContents()); - ASSERT_TRUE(browser()->GetSelectedTabContents()->render_view_host()); + ASSERT_TRUE(browser()->GetSelectedTabContents()->GetRenderViewHost()); string16 window_print = ASCIIToUTF16("window.print()"); - browser()->GetSelectedTabContents()->render_view_host()-> + browser()->GetSelectedTabContents()->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), window_print); ui_test_utils::RunMessageLoop(); diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc index cadc4fe..be62cea 100644 --- a/chrome/browser/printing/print_preview_tab_controller.cc +++ b/chrome/browser/printing/print_preview_tab_controller.cc @@ -41,8 +41,8 @@ namespace { void EnableInternalPDFPluginForTab(TabContentsWrapper* preview_tab) { // Always enable the internal PDF plugin for the print preview page. ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( - preview_tab->tab_contents()->render_view_host()->process()->GetID(), - preview_tab->tab_contents()->render_view_host()->routing_id(), + preview_tab->tab_contents()->GetRenderProcessHost()->GetID(), + preview_tab->tab_contents()->GetRenderViewHost()->routing_id(), GURL(), ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName)); } @@ -243,11 +243,10 @@ void PrintPreviewTabController::OnRendererProcessClosed( iter != preview_tab_map_.end(); ++iter) { TabContentsWrapper* preview_tab = iter->first; TabContentsWrapper* initiator_tab = iter->second; - if (preview_tab->tab_contents()->render_view_host()->process() == rph) { + if (preview_tab->tab_contents()->GetRenderProcessHost() == rph) { closed_preview_tabs.push_back(preview_tab); } else if (initiator_tab && - initiator_tab->tab_contents()->render_view_host()->process() - == rph) { + initiator_tab->tab_contents()->GetRenderProcessHost() == rph) { closed_initiator_tabs.push_back(initiator_tab); } } @@ -415,8 +414,7 @@ void PrintPreviewTabController::AddObservers(TabContentsWrapper* tab) { // Multiple sites may share the same RenderProcessHost, so check if this // notification has already been added. - content::RenderProcessHost* rph = - tab->tab_contents()->render_view_host()->process(); + content::RenderProcessHost* rph = tab->tab_contents()->GetRenderProcessHost(); if (!registrar_.IsRegistered(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, content::Source<content::RenderProcessHost>( @@ -436,8 +434,7 @@ void PrintPreviewTabController::RemoveObservers(TabContentsWrapper* tab) { // Multiple sites may share the same RenderProcessHost, so check if this // notification has already been added. - content::RenderProcessHost* rph = - tab->tab_contents()->render_view_host()->process(); + content::RenderProcessHost* rph = tab->tab_contents()->GetRenderProcessHost(); if (registrar_.IsRegistered(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, content::Source<content::RenderProcessHost>( diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc index 84b9237..eedaf9e 100644 --- a/chrome/browser/printing/print_view_manager.cc +++ b/chrome/browser/printing/print_view_manager.cc @@ -142,7 +142,7 @@ void PrintViewManager::PrintPreviewDone() { void PrintViewManager::PreviewPrintingRequestCancelled() { if (!tab_contents()) return; - RenderViewHost* rvh = tab_contents()->render_view_host(); + RenderViewHost* rvh = tab_contents()->GetRenderViewHost(); rvh->Send(new PrintMsg_PreviewPrintingRequestCancelled(rvh->routing_id())); } @@ -265,8 +265,7 @@ void PrintViewManager::OnScriptedPrintPreview(bool source_is_modifiable, BrowserThread::CurrentlyOn(BrowserThread::UI); ScriptedPrintPreviewClosureMap& map = g_scripted_print_preview_closure_map.Get(); - content::RenderProcessHost* rph = - tab_contents()->render_view_host()->process(); + content::RenderProcessHost* rph = tab_contents()->GetRenderProcessHost(); // This should always be 0 once we get modal window.print(). if (map.count(rph) != 0) { @@ -395,8 +394,8 @@ bool PrintViewManager::RenderAllMissingPagesNow() { // We can't print if there is no renderer. if (!tab_contents() || - !tab_contents()->render_view_host() || - !tab_contents()->render_view_host()->IsRenderViewLive()) { + !tab_contents()->GetRenderViewHost() || + !tab_contents()->GetRenderViewHost()->IsRenderViewLive()) { return false; } @@ -445,8 +444,8 @@ bool PrintViewManager::CreateNewPrintJob(PrintJobWorkerOwner* job) { DisconnectFromCurrentPrintJob(); // We can't print if there is no renderer. - if (!tab_contents()->render_view_host() || - !tab_contents()->render_view_host()->IsRenderViewLive()) { + if (!tab_contents()->GetRenderViewHost() || + !tab_contents()->GetRenderViewHost()->IsRenderViewLive()) { return false; } @@ -489,7 +488,7 @@ void PrintViewManager::DisconnectFromCurrentPrintJob() { void PrintViewManager::PrintingDone(bool success) { if (!print_job_.get() || !tab_contents()) return; - RenderViewHost* rvh = tab_contents()->render_view_host(); + RenderViewHost* rvh = tab_contents()->GetRenderViewHost(); rvh->Send(new PrintMsg_PrintingDone(rvh->routing_id(), success)); } diff --git a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc index 0d4ac84..a47f1b1 100644 --- a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc +++ b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc @@ -99,7 +99,7 @@ class BrowserFeatureExtractorTest : public ChromeRenderViewHostTestHarness { static int page_id = 0; RenderViewHost* rvh = contents()->pending_rvh(); if (!rvh) { - rvh = contents()->render_view_host(); + rvh = contents()->GetRenderViewHost(); } contents()->ProceedWithCrossSiteNavigation(); contents()->TestDidNavigateWithReferrer( diff --git a/chrome/browser/safe_browsing/client_side_detection_host.cc b/chrome/browser/safe_browsing/client_side_detection_host.cc index 89baa25..29d9e43 100644 --- a/chrome/browser/safe_browsing/client_side_detection_host.cc +++ b/chrome/browser/safe_browsing/client_side_detection_host.cc @@ -204,7 +204,7 @@ class ClientSideDetectionHost::ShouldClassifyUrlRequest // before it is. VLOG(1) << "Instruct renderer to start phishing detection for URL: " << params_.url; - RenderViewHost* rvh = tab_contents_->render_view_host(); + RenderViewHost* rvh = tab_contents_->GetRenderViewHost(); rvh->Send(new SafeBrowsingMsg_StartPhishingDetection( rvh->routing_id(), params_.url)); } @@ -343,7 +343,7 @@ void ClientSideDetectionHost::OnSafeBrowsingHit( if (tab_contents() && tab_contents()->GetRenderProcessHost()->GetID() == resource.render_process_host_id && - tab_contents()->render_view_host()->routing_id() == + tab_contents()->GetRenderViewHost()->routing_id() == resource.render_view_id && (resource.threat_type == SafeBrowsingService::URL_PHISHING || resource.threat_type == SafeBrowsingService::URL_MALWARE) && @@ -422,7 +422,7 @@ void ClientSideDetectionHost::MaybeShowPhishingWarning(GURL phishing_url, resource.render_process_host_id = tab_contents()->GetRenderProcessHost()->GetID(); resource.render_view_id = - tab_contents()->render_view_host()->routing_id(); + tab_contents()->GetRenderViewHost()->routing_id(); if (!sb_service_->IsWhitelisted(resource)) { // We need to stop any pending navigations, otherwise the interstital // might not get created properly. diff --git a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc index e6275d2..21d1390 100644 --- a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc +++ b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc @@ -271,7 +271,7 @@ class ClientSideDetectionHostTest : public TabContentsWrapperTestHarness { resource.client = new BogusClient(); resource.render_process_host_id = contents()->GetRenderProcessHost()-> GetID(); - resource.render_view_id = contents()->render_view_host()->routing_id(); + resource.render_view_id = contents()->GetRenderViewHost()->routing_id(); csd_host_->OnSafeBrowsingHit(resource); delete resource.client; ASSERT_TRUE(csd_host_->DidShowSBInterstitial()); @@ -416,7 +416,7 @@ TEST_F(ClientSideDetectionHostTest, OnPhishingDetectionDoneShowInterstitial) { resource.threat_type); EXPECT_EQ(contents()->GetRenderProcessHost()->GetID(), resource.render_process_host_id); - EXPECT_EQ(contents()->render_view_host()->routing_id(), + EXPECT_EQ(contents()->GetRenderViewHost()->routing_id(), resource.render_view_id); // Make sure the client object will be deleted. @@ -508,7 +508,7 @@ TEST_F(ClientSideDetectionHostTest, OnPhishingDetectionDoneMultiplePings) { resource.threat_type); EXPECT_EQ(contents()->GetRenderProcessHost()->GetID(), resource.render_process_host_id); - EXPECT_EQ(contents()->render_view_host()->routing_id(), + EXPECT_EQ(contents()->GetRenderViewHost()->routing_id(), resource.render_view_id); // Make sure the client object will be deleted. diff --git a/chrome/browser/safe_browsing/malware_details.cc b/chrome/browser/safe_browsing/malware_details.cc index 4f6a346..6a9be29 100644 --- a/chrome/browser/safe_browsing/malware_details.cc +++ b/chrome/browser/safe_browsing/malware_details.cc @@ -209,7 +209,7 @@ void MalwareDetails::StartCollection() { // Get URLs of frames, scripts etc from the DOM. // OnReceivedMalwareDOMDetails will be called when the renderer replies. - RenderViewHost* view = tab_contents()->render_view_host(); + RenderViewHost* view = tab_contents()->GetRenderViewHost(); view->Send(new SafeBrowsingMsg_GetMalwareDOMDetails(view->routing_id())); } diff --git a/chrome/browser/safe_browsing/malware_details_unittest.cc b/chrome/browser/safe_browsing/malware_details_unittest.cc index b62eeaf..e913da5 100644 --- a/chrome/browser/safe_browsing/malware_details_unittest.cc +++ b/chrome/browser/safe_browsing/malware_details_unittest.cc @@ -219,7 +219,7 @@ class MalwareDetailsTest : public ChromeRenderViewHostTestHarness { resource->threat_type = SafeBrowsingService::URL_MALWARE; resource->render_process_host_id = contents()->GetRenderProcessHost()-> GetID(); - resource->render_view_id = contents()->render_view_host()->routing_id(); + resource->render_view_id = contents()->GetRenderViewHost()->routing_id(); } void VerifyResults(const ClientMalwareReportRequest& report_pb, diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc index 37b1c2c..b042a3e 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc @@ -110,7 +110,7 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness, void Navigate(const char* url, int page_id) { contents()->TestDidNavigate( - contents()->render_view_host(), page_id, GURL(url), + contents()->GetRenderViewHost(), page_id, GURL(url), content::PAGE_TRANSITION_TYPED); } @@ -181,7 +181,7 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness, resource->threat_type = SafeBrowsingService::URL_MALWARE; resource->render_process_host_id = contents()->GetRenderProcessHost()-> GetID(); - resource->render_view_id = contents()->render_view_host()->routing_id(); + resource->render_view_id = contents()->GetRenderViewHost()->routing_id(); } UserResponse user_response_; diff --git a/chrome/browser/safe_browsing/safe_browsing_tab_observer.cc b/chrome/browser/safe_browsing/safe_browsing_tab_observer.cc index 2e2e79d..dacd1c9 100644 --- a/chrome/browser/safe_browsing/safe_browsing_tab_observer.cc +++ b/chrome/browser/safe_browsing/safe_browsing_tab_observer.cc @@ -90,7 +90,7 @@ void SafeBrowsingTabObserver::UpdateSafebrowsingDetectionHost() { safebrowsing_detection_host_.reset(); } - RenderViewHost* rvh = wrapper_->tab_contents()->render_view_host(); + RenderViewHost* rvh = wrapper_->tab_contents()->GetRenderViewHost(); rvh->Send(new ChromeViewMsg_SetClientSidePhishingDetection(rvh->routing_id(), safe_browsing)); #endif diff --git a/chrome/browser/sessions/restore_tab_helper.cc b/chrome/browser/sessions/restore_tab_helper.cc index 6516731..767d8e5 100644 --- a/chrome/browser/sessions/restore_tab_helper.cc +++ b/chrome/browser/sessions/restore_tab_helper.cc @@ -28,9 +28,9 @@ void RestoreTabHelper::SetWindowID(const SessionID& id) { // Extension code in the renderer holds the ID of the window that hosts it. // Notify it that the window ID changed. - tab_->tab_contents()->render_view_host()->Send( + tab_->tab_contents()->GetRenderViewHost()->Send( new ExtensionMsg_UpdateBrowserWindowId( - tab_->tab_contents()->render_view_host()->routing_id(), id.id())); + tab_->tab_contents()->GetRenderViewHost()->routing_id(), id.id())); } void RestoreTabHelper::RenderViewCreated(RenderViewHost* render_view_host) { diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc index f5c6b05..88f5eb7 100644 --- a/chrome/browser/ssl/ssl_blocking_page.cc +++ b/chrome/browser/ssl/ssl_blocking_page.cc @@ -111,7 +111,7 @@ std::string SSLBlockingPage::GetHTMLContents() { void SSLBlockingPage::UpdateEntry(NavigationEntry* entry) { const net::SSLInfo& ssl_info = handler_->ssl_info(); int cert_id = CertStore::GetInstance()->StoreCert( - ssl_info.cert, tab()->render_view_host()->process()->GetID()); + ssl_info.cert, tab()->GetRenderProcessHost()->GetID()); entry->ssl().set_security_style( content::SECURITY_STYLE_AUTHENTICATION_BROKEN); diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc index 623f695..c486318 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc @@ -101,7 +101,7 @@ class SSLUITest : public InProcessBrowserTest { while (base::Time::Now() < timeToQuit) { bool workerFinished = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), std::wstring(), + tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(IsWorkerFinished());", &workerFinished)); @@ -116,7 +116,7 @@ class SSLUITest : public InProcessBrowserTest { bool actuallyLoadedContent = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), std::wstring(), + tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(IsContentLoaded());", &actuallyLoadedContent)); EXPECT_EQ(expectLoaded, actuallyLoadedContent); @@ -379,7 +379,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndGoBackViaButton) { // Wait until we hear the load failure, and make sure we haven't swapped out // the previous page. Prevents regression of http://crbug.com/82667. load_failed_observer.Wait(); - EXPECT_FALSE(tab->render_view_host()->is_swapped_out()); + EXPECT_FALSE(tab->GetRenderViewHost()->is_swapped_out()); // We should be back at the original good page. EXPECT_FALSE(browser()->GetSelectedTabContents()->interstitial_page()); @@ -604,7 +604,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestUnsafeContents) { int img_width; EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractInt( - tab->render_view_host(), std::wstring(), + tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(ImageWidth());", &img_width)); // In order to check that the image was not loaded, we check its width. // The actual image (Google logo) is 114 pixels wide, we assume the broken @@ -613,7 +613,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestUnsafeContents) { bool js_result = false; EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), std::wstring(), + tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(IsFooSet());", &js_result)); EXPECT_FALSE(js_result); } @@ -638,7 +638,8 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContentLoadedFromJS) { // Load the insecure image. bool js_result = false; EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), std::wstring(), L"loadBadImage();", &js_result)); + tab->GetRenderViewHost(), std::wstring(), L"loadBadImage();", + &js_result)); EXPECT_TRUE(js_result); // We should now have insecure content. @@ -1037,7 +1038,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { content::NOTIFICATION_LOAD_STOP, content::Source<NavigationController>(&tab->controller())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), std::wstring(), + tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('goodHTTPSLink'));", &success)); ASSERT_TRUE(success); @@ -1053,7 +1054,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { content::NOTIFICATION_LOAD_STOP, content::Source<NavigationController>(&tab->controller())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), std::wstring(), + tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('badHTTPSLink'));", &success)); ASSERT_TRUE(success); @@ -1069,7 +1070,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { std::wstring is_evil_js(L"window.domAutomationController.send(" L"document.getElementById('evilDiv') != null);"); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), content_frame_xpath, is_evil_js, + tab->GetRenderViewHost(), content_frame_xpath, is_evil_js, &is_content_evil)); EXPECT_FALSE(is_content_evil); @@ -1089,7 +1090,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { content::NOTIFICATION_LOAD_STOP, content::Source<NavigationController>(&tab->controller())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), std::wstring(), + tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('HTTPLink'));", &success)); ASSERT_TRUE(success); @@ -1137,7 +1138,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestBadFrameNavigation) { content::NOTIFICATION_LOAD_STOP, content::Source<NavigationController>(&tab->controller())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), std::wstring(), + tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('goodHTTPSLink'));", &success)); ASSERT_TRUE(success); @@ -1174,7 +1175,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestUnauthenticatedFrameNavigation) { content::NOTIFICATION_LOAD_STOP, content::Source<NavigationController>(&tab->controller())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), std::wstring(), + tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('goodHTTPSLink'));", &success)); ASSERT_TRUE(success); @@ -1191,7 +1192,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestUnauthenticatedFrameNavigation) { content::NOTIFICATION_LOAD_STOP, content::Source<NavigationController>(&tab->controller())); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), std::wstring(), + tab->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(clickLink('badHTTPSLink'));", &success)); ASSERT_TRUE(success); @@ -1207,7 +1208,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestUnauthenticatedFrameNavigation) { std::wstring is_evil_js(L"window.domAutomationController.send(" L"document.getElementById('evilDiv') != null);"); EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - tab->render_view_host(), content_frame_xpath, is_evil_js, + tab->GetRenderViewHost(), content_frame_xpath, is_evil_js, &is_content_evil)); EXPECT_FALSE(is_content_evil); } diff --git a/chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.cc b/chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.cc index fd21888..3542aff 100644 --- a/chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.cc +++ b/chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.cc @@ -105,7 +105,7 @@ void ChromeTabContentsViewWrapperGtk::ShowContextMenu( if (params.custom_context.render_widget_id != webkit_glue::CustomContextMenuContext::kCurrentRenderWidget) { IPC::Channel::Listener* listener = - view_->tab_contents()->render_view_host()->process()->GetListenerByID( + view_->tab_contents()->GetRenderProcessHost()->GetListenerByID( params.custom_context.render_widget_id); if (!listener) { NOTREACHED(); diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index 835fd24..933c175 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -659,7 +659,7 @@ void RenderViewContextMenu::UpdateMenuItem(int command_id, } RenderViewHost* RenderViewContextMenu::GetRenderViewHost() const { - return source_tab_contents_->render_view_host(); + return source_tab_contents_->GetRenderViewHost(); } Profile* RenderViewContextMenu::GetProfile() const { @@ -1365,7 +1365,7 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) { return observer->ExecuteCommand(id); } - RenderViewHost* rvh = source_tab_contents_->render_view_host(); + RenderViewHost* rvh = source_tab_contents_->GetRenderViewHost(); // Process custom actions range. if (id >= IDC_CONTENT_CONTEXT_CUSTOM_FIRST && @@ -1789,7 +1789,7 @@ void RenderViewContextMenu::MenuClosed(ui::SimpleMenuModel* source) { RenderWidgetHostView* view = source_tab_contents_->GetRenderWidgetHostView(); if (view) view->ShowingContextMenu(false); - RenderViewHost* rvh = source_tab_contents_->render_view_host(); + RenderViewHost* rvh = source_tab_contents_->GetRenderViewHost(); if (rvh) { rvh->NotifyContextMenuClosed(params_.custom_context); } @@ -1848,13 +1848,13 @@ void RenderViewContextMenu::OpenURL( } void RenderViewContextMenu::CopyImageAt(int x, int y) { - source_tab_contents_->render_view_host()->CopyImageAt(x, y); + source_tab_contents_->GetRenderViewHost()->CopyImageAt(x, y); } void RenderViewContextMenu::Inspect(int x, int y) { content::RecordAction(UserMetricsAction("DevTools_InspectElement")); DevToolsWindow::InspectElement( - source_tab_contents_->render_view_host(), x, y); + source_tab_contents_->GetRenderViewHost(), x, y); } void RenderViewContextMenu::WriteURLToClipboard(const GURL& url) { @@ -1867,6 +1867,6 @@ void RenderViewContextMenu::WriteURLToClipboard(const GURL& url) { void RenderViewContextMenu::MediaPlayerActionAt( const gfx::Point& location, const WebMediaPlayerAction& action) { - source_tab_contents_->render_view_host()-> + source_tab_contents_->GetRenderViewHost()-> ExecuteMediaPlayerActionAtLocation(location, action); } 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 e73314c..6cb37e3 100644 --- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc +++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc @@ -152,7 +152,7 @@ TabContents* RenderViewHostDelegateViewHelper::CreateNewWindow( frame_name); if (contents) { pending_contents_[route_id] = - contents->tab_contents()->render_view_host(); + contents->tab_contents()->GetRenderViewHost(); return NULL; } } @@ -180,10 +180,10 @@ TabContents* RenderViewHostDelegateViewHelper::CreateNewWindow( // TODO(brettw) it seems bogus that we have to call this function on the // newly created object and give it one of its own member variables. - new_view->CreateViewForWidget(new_contents->render_view_host()); + new_view->CreateViewForWidget(new_contents->GetRenderViewHost()); // Save the created window associated with the route so we can show it later. - pending_contents_[route_id] = new_contents->render_view_host(); + pending_contents_[route_id] = new_contents->GetRenderViewHost(); return new_contents; } diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc index d6b9162..dfa7142 100644 --- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc +++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc @@ -335,12 +335,12 @@ void TabContentsViewGtk::CreateNewWindow( void TabContentsViewGtk::CreateNewWidget( int route_id, WebKit::WebPopupType popup_type) { delegate_view_helper_.CreateNewWidget(route_id, popup_type, - tab_contents_->render_view_host()->process()); + tab_contents_->GetRenderProcessHost()); } void TabContentsViewGtk::CreateNewFullscreenWidget(int route_id) { delegate_view_helper_.CreateNewFullscreenWidget( - route_id, tab_contents_->render_view_host()->process()); + route_id, tab_contents_->GetRenderProcessHost()); } void TabContentsViewGtk::ShowCreatedWindow(int route_id, diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm index 8b533b2..62745bc 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.mm +++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm @@ -279,7 +279,7 @@ void TabContentsViewMac::CreateNewWindow( void TabContentsViewMac::CreateNewWidget( int route_id, WebKit::WebPopupType popup_type) { RenderWidgetHostView* widget_view = delegate_view_helper_.CreateNewWidget( - route_id, popup_type, tab_contents_->render_view_host()->process()); + route_id, popup_type, tab_contents_->GetRenderProcessHost()); // A RenderWidgetHostViewMac has lifetime scoped to the view. We'll retain it // to allow it to survive the trip without being hosted. @@ -291,7 +291,7 @@ void TabContentsViewMac::CreateNewWidget( void TabContentsViewMac::CreateNewFullscreenWidget(int route_id) { RenderWidgetHostView* widget_view = delegate_view_helper_.CreateNewFullscreenWidget( - route_id, tab_contents_->render_view_host()->process()); + route_id, tab_contents_->GetRenderProcessHost()); // A RenderWidgetHostViewMac has lifetime scoped to the view. We'll retain it // to allow it to survive the trip without being hosted. @@ -363,7 +363,7 @@ void TabContentsViewMac::ShowPopupMenu( int selected_item, const std::vector<WebMenuItem>& items, bool right_aligned) { - PopupMenuHelper popup_menu_helper(tab_contents_->render_view_host()); + PopupMenuHelper popup_menu_helper(tab_contents_->GetRenderViewHost()); popup_menu_helper.ShowPopupMenu(bounds, item_height, item_font_size, selected_item, items, right_aligned); } @@ -403,7 +403,7 @@ void TabContentsViewMac::RemoveOverlayView() { } void TabContentsViewMac::CloseTab() { - tab_contents_->Close(tab_contents_->render_view_host()); + tab_contents_->Close(tab_contents_->GetRenderViewHost()); } @implementation TabContentsViewCocoa @@ -515,8 +515,8 @@ void TabContentsViewMac::CloseTab() { - (void)renderWidgetHostWasResized { TabContents* tabContents = [self tabContents]; - if (tabContents && tabContents->render_view_host()) - tabContents->render_view_host()->WasResized(); + if (tabContents && tabContents->GetRenderViewHost()) + tabContents->GetRenderViewHost()->WasResized(); } // NSDraggingSource methods diff --git a/chrome/browser/tab_contents/thumbnail_generator.cc b/chrome/browser/tab_contents/thumbnail_generator.cc index c271829..49147f2 100644 --- a/chrome/browser/tab_contents/thumbnail_generator.cc +++ b/chrome/browser/tab_contents/thumbnail_generator.cc @@ -373,7 +373,7 @@ void ThumbnailGenerator::TabContentsDisconnected(TabContents* contents) { // same renderer as this TabContents and remove them so they don't // hang around. ThumbnailCallbackMap::iterator iterator = callback_map_.begin(); - RenderWidgetHost* renderer = contents->render_view_host(); + RenderWidgetHost* renderer = contents->GetRenderViewHost(); while (iterator != callback_map_.end()) { if (iterator->second->renderer == renderer) { ThumbnailCallbackMap::iterator nuked = iterator; @@ -458,7 +458,7 @@ void ThumbnailGenerator::UpdateThumbnailIfNecessary( const int options = ThumbnailGenerator::kClippedThumbnail; ThumbnailGenerator::ClipResult clip_result = ThumbnailGenerator::kNotClipped; SkBitmap thumbnail = GetThumbnailForRendererWithOptions( - tab_contents->render_view_host(), options, &clip_result); + tab_contents->GetRenderViewHost(), options, &clip_result); // Failed to generate a thumbnail. Maybe the tab is in the background? if (thumbnail.isNull()) return; @@ -466,7 +466,7 @@ void ThumbnailGenerator::UpdateThumbnailIfNecessary( // Compute the thumbnail score. ThumbnailScore score; score.at_top = - (tab_contents->render_view_host()->last_scroll_offset().y() == 0); + (tab_contents->GetRenderViewHost()->last_scroll_offset().y() == 0); score.boring_score = ThumbnailGenerator::CalculateBoringScore(&thumbnail); score.good_clipping = (clip_result == ThumbnailGenerator::kTallerThanWide || diff --git a/chrome/browser/tab_contents/web_drag_source_win.cc b/chrome/browser/tab_contents/web_drag_source_win.cc index e37a0d8c..21dd68f 100644 --- a/chrome/browser/tab_contents/web_drag_source_win.cc +++ b/chrome/browser/tab_contents/web_drag_source_win.cc @@ -35,7 +35,7 @@ WebDragSource::WebDragSource(gfx::NativeWindow source_wnd, TabContents* tab_contents) : ui::DragSource(), source_wnd_(source_wnd), - render_view_host_(tab_contents->render_view_host()), + render_view_host_(tab_contents->GetRenderViewHost()), effect_(DROPEFFECT_NONE) { registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_SWAPPED, content::Source<TabContents>(tab_contents)); diff --git a/chrome/browser/tab_contents/web_drop_target_win.cc b/chrome/browser/tab_contents/web_drop_target_win.cc index 080668c..b25e1fa 100644 --- a/chrome/browser/tab_contents/web_drop_target_win.cc +++ b/chrome/browser/tab_contents/web_drop_target_win.cc @@ -101,7 +101,7 @@ DWORD WebDropTarget::OnDragEnter(IDataObject* data_object, DWORD key_state, POINT cursor_position, DWORD effects) { - current_rvh_ = tab_contents_->render_view_host(); + current_rvh_ = tab_contents_->GetRenderViewHost(); if (!tab_) tab_ = TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_); @@ -124,7 +124,7 @@ DWORD WebDropTarget::OnDragEnter(IDataObject* data_object, POINT client_pt = cursor_position; ScreenToClient(GetHWND(), &client_pt); - tab_contents_->render_view_host()->DragTargetDragEnter(drop_data, + tab_contents_->GetRenderViewHost()->DragTargetDragEnter(drop_data, gfx::Point(client_pt.x, client_pt.y), gfx::Point(cursor_position.x, cursor_position.y), web_drag_utils_win::WinDragOpMaskToWebDragOpMask(effects)); @@ -150,7 +150,7 @@ DWORD WebDropTarget::OnDragOver(IDataObject* data_object, POINT cursor_position, DWORD effects) { DCHECK(current_rvh_); - if (current_rvh_ != tab_contents_->render_view_host()) + if (current_rvh_ != tab_contents_->GetRenderViewHost()) OnDragEnter(data_object, key_state, cursor_position, effects); if (tab_contents_->showing_interstitial_page()) @@ -158,7 +158,7 @@ DWORD WebDropTarget::OnDragOver(IDataObject* data_object, POINT client_pt = cursor_position; ScreenToClient(GetHWND(), &client_pt); - tab_contents_->render_view_host()->DragTargetDragOver( + tab_contents_->GetRenderViewHost()->DragTargetDragOver( gfx::Point(client_pt.x, client_pt.y), gfx::Point(cursor_position.x, cursor_position.y), web_drag_utils_win::WinDragOpMaskToWebDragOpMask(effects)); @@ -177,13 +177,13 @@ DWORD WebDropTarget::OnDragOver(IDataObject* data_object, void WebDropTarget::OnDragLeave(IDataObject* data_object) { DCHECK(current_rvh_); - if (current_rvh_ != tab_contents_->render_view_host()) + if (current_rvh_ != tab_contents_->GetRenderViewHost()) return; if (tab_contents_->showing_interstitial_page()) { interstitial_drop_target_->OnDragLeave(data_object); } else { - tab_contents_->render_view_host()->DragTargetDragLeave(); + tab_contents_->GetRenderViewHost()->DragTargetDragLeave(); } if (tab_ && tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { @@ -201,7 +201,7 @@ DWORD WebDropTarget::OnDrop(IDataObject* data_object, POINT cursor_position, DWORD effect) { DCHECK(current_rvh_); - if (current_rvh_ != tab_contents_->render_view_host()) + if (current_rvh_ != tab_contents_->GetRenderViewHost()) OnDragEnter(data_object, key_state, cursor_position, effect); if (tab_contents_->showing_interstitial_page()) @@ -212,7 +212,7 @@ DWORD WebDropTarget::OnDrop(IDataObject* data_object, POINT client_pt = cursor_position; ScreenToClient(GetHWND(), &client_pt); - tab_contents_->render_view_host()->DragTargetDrop( + tab_contents_->GetRenderViewHost()->DragTargetDrop( gfx::Point(client_pt.x, client_pt.y), gfx::Point(cursor_position.x, cursor_position.y)); diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc index 5f8fa5a..71f464b 100644 --- a/chrome/browser/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/tabs/tab_strip_model_unittest.cc @@ -159,7 +159,7 @@ class TabStripModelTest : public ChromeRenderViewHostTestHarness { TabContentsWrapper* CreateTabContentsWithSharedRPH( TabContents* tab_contents) { TabContentsWrapper* retval = Browser::TabContentsFactory(profile(), - tab_contents->render_view_host()->site_instance(), MSG_ROUTING_NONE, + tab_contents->GetRenderViewHost()->site_instance(), MSG_ROUTING_NONE, NULL, NULL); EXPECT_EQ(retval->tab_contents()->GetRenderProcessHost(), tab_contents->GetRenderProcessHost()); diff --git a/chrome/browser/task_manager/task_manager_notification_resource_provider.cc b/chrome/browser/task_manager/task_manager_notification_resource_provider.cc index ae5b401..20b3aa0 100644 --- a/chrome/browser/task_manager/task_manager_notification_resource_provider.cc +++ b/chrome/browser/task_manager/task_manager_notification_resource_provider.cc @@ -37,7 +37,7 @@ TaskManagerNotificationResource::TaskManagerNotificationResource( default_icon_ = rb.GetBitmapNamed(IDR_PLUGIN); } process_handle_ = - balloon_host_->tab_contents()->render_view_host()->process()->GetHandle(); + balloon_host_->tab_contents()->GetRenderProcessHost()->GetHandle(); pid_ = base::GetProcId(process_handle_); title_ = l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_NOTIFICATION_PREFIX, balloon_host_->GetSource()); @@ -72,7 +72,7 @@ bool TaskManagerNotificationResource::CanInspect() const { void TaskManagerNotificationResource::Inspect() const { DevToolsWindow::OpenDevToolsWindow( - balloon_host_->tab_contents()->render_view_host()); + balloon_host_->tab_contents()->GetRenderViewHost()); } bool TaskManagerNotificationResource::SupportNetworkUsage() const { diff --git a/chrome/browser/task_manager/task_manager_resource_providers.cc b/chrome/browser/task_manager/task_manager_resource_providers.cc index 59f0a6e..43415fc 100644 --- a/chrome/browser/task_manager/task_manager_resource_providers.cc +++ b/chrome/browser/task_manager/task_manager_resource_providers.cc @@ -221,7 +221,7 @@ TaskManagerTabContentsResource::TaskManagerTabContentsResource( TabContentsWrapper* tab_contents) : TaskManagerRendererResource( tab_contents->tab_contents()->GetRenderProcessHost()->GetHandle(), - tab_contents->tab_contents()->render_view_host()), + tab_contents->tab_contents()->GetRenderViewHost()), tab_contents_(tab_contents), is_instant_preview_(false) { if (!prerender_icon_) { @@ -544,7 +544,7 @@ TaskManagerBackgroundContentsResource::TaskManagerBackgroundContentsResource( : TaskManagerRendererResource( background_contents->tab_contents()->GetRenderProcessHost()-> GetHandle(), - background_contents->tab_contents()->render_view_host()), + background_contents->tab_contents()->GetRenderViewHost()), background_contents_(background_contents), application_name_(application_name) { // Just use the same icon that other extension resources do. @@ -612,8 +612,8 @@ TaskManagerBackgroundContentsResourceProvider::GetResource( for (Resources::iterator i = resources_.begin(); i != resources_.end(); i++) { TabContents* tab = i->first->tab_contents(); - if (tab->render_view_host()->process()->GetID() == render_process_host_id - && tab->render_view_host()->routing_id() == routing_id) { + if (tab->GetRenderProcessHost()->GetID() == render_process_host_id + && tab->GetRenderViewHost()->routing_id() == routing_id) { return i->second; } } diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index b991a1d..abcf065 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -294,9 +294,8 @@ void TranslateManager::Observe(int type, base::Bind( &TranslateManager::InitiateTranslationPosted, weak_method_factory_.GetWeakPtr(), - controller->tab_contents()->render_view_host()->process()-> - GetID(), - controller->tab_contents()->render_view_host()->routing_id(), + controller->tab_contents()->GetRenderProcessHost()->GetID(), + controller->tab_contents()->GetRenderViewHost()->routing_id(), helper->language_state().original_language())); break; } @@ -572,7 +571,7 @@ void TranslateManager::TranslatePage(TabContents* tab_contents, // The script is not available yet. Queue that request and query for the // script. Once it is downloaded we'll do the translate. - RenderViewHost* rvh = tab_contents->render_view_host(); + RenderViewHost* rvh = tab_contents->GetRenderViewHost(); PendingRequest request; request.render_process_id = rvh->process()->GetID(); request.render_view_id = rvh->routing_id(); @@ -589,8 +588,8 @@ void TranslateManager::RevertTranslation(TabContents* tab_contents) { NOTREACHED(); return; } - tab_contents->render_view_host()->Send(new ChromeViewMsg_RevertTranslation( - tab_contents->render_view_host()->routing_id(), entry->page_id())); + tab_contents->GetRenderViewHost()->Send(new ChromeViewMsg_RevertTranslation( + tab_contents->GetRenderViewHost()->routing_id(), entry->page_id())); TranslateTabHelper* helper = TabContentsWrapper::GetCurrentWrapperForContents( tab_contents)->translate_tab_helper(); @@ -643,9 +642,9 @@ void TranslateManager::DoTranslatePage(TabContents* tab, wrapper->translate_tab_helper()->language_state().set_translation_pending( true); - tab->render_view_host()->Send(new ChromeViewMsg_TranslatePage( - tab->render_view_host()->routing_id(), entry->page_id(), translate_script, - source_lang, target_lang)); + tab->GetRenderViewHost()->Send(new ChromeViewMsg_TranslatePage( + tab->GetRenderViewHost()->routing_id(), entry->page_id(), + translate_script, source_lang, target_lang)); } void TranslateManager::PageTranslated(TabContents* tab, diff --git a/chrome/browser/ui/alternate_error_tab_observer.cc b/chrome/browser/ui/alternate_error_tab_observer.cc index c148416..dbd8603 100644 --- a/chrome/browser/ui/alternate_error_tab_observer.cc +++ b/chrome/browser/ui/alternate_error_tab_observer.cc @@ -54,14 +54,14 @@ void AlternateErrorPageTabObserver::Observe(int type, const content::NotificationDetails& details) { switch (type) { case chrome::NOTIFICATION_GOOGLE_URL_UPDATED: - UpdateAlternateErrorPageURL(tab_contents()->render_view_host()); + UpdateAlternateErrorPageURL(tab_contents()->GetRenderViewHost()); break; case chrome::NOTIFICATION_PREF_CHANGED: { std::string* pref_name = content::Details<std::string>(details).ptr(); DCHECK(content::Source<PrefService>(source).ptr() == wrapper_->profile()->GetPrefs()); if (*pref_name == prefs::kAlternateErrorPagesEnabled) { - UpdateAlternateErrorPageURL(tab_contents()->render_view_host()); + UpdateAlternateErrorPageURL(tab_contents()->GetRenderViewHost()); } else { NOTREACHED() << "unexpected pref change notification" << *pref_name; } diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 3b54f7d..94a725a 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -702,7 +702,7 @@ TabContents* Browser::OpenApplicationWindow( browser->AddSelectedTabWithURL(url, content::PAGE_TRANSITION_START_PAGE); TabContents* contents = wrapper->tab_contents(); contents->GetMutableRendererPrefs()->can_accept_load_drops = false; - contents->render_view_host()->SyncRendererPrefs(); + contents->GetRenderViewHost()->SyncRendererPrefs(); browser->window()->Show(); // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial @@ -1944,7 +1944,7 @@ void Browser::Zoom(content::PageZoom zoom) { return; RenderViewHost* host = - GetSelectedTabContentsWrapper()->tab_contents()->render_view_host(); + GetSelectedTabContentsWrapper()->tab_contents()->GetRenderViewHost(); if (zoom == content::PAGE_ZOOM_RESET) { host->SetZoomLevel(0); content::RecordAction(UserMetricsAction("ZoomNormal")); @@ -2082,7 +2082,7 @@ void Browser::ToggleDevToolsWindow(DevToolsToggleAction action) { content::RecordAction(UserMetricsAction("DevTools_ToggleWindow")); DevToolsWindow::ToggleDevToolsWindow( - GetSelectedTabContentsWrapper()->tab_contents()->render_view_host(), + GetSelectedTabContentsWrapper()->tab_contents()->GetRenderViewHost(), action); } @@ -2501,7 +2501,7 @@ bool Browser::RunUnloadEventsHelper(TabContents* contents) { // them. Once they have fired, we'll get a message back saying whether // to proceed closing the page or not, which sends us back to this method // with the NeedToFireBeforeUnload bit cleared. - contents->render_view_host()->FirePageBeforeUnload(false); + contents->GetRenderViewHost()->FirePageBeforeUnload(false); return true; } return false; @@ -2534,7 +2534,7 @@ void Browser::RunFileChooserHelper( // goes out of scope. scoped_refptr<FileSelectHelper> file_select_helper( new FileSelectHelper(profile)); - file_select_helper->RunFileChooser(tab->render_view_host(), tab, params); + file_select_helper->RunFileChooser(tab->GetRenderViewHost(), tab, params); } // static @@ -2542,10 +2542,8 @@ void Browser::EnumerateDirectoryHelper(TabContents* tab, int request_id, const FilePath& path) { ChildProcessSecurityPolicy* policy = ChildProcessSecurityPolicy::GetInstance(); - if (!policy->CanReadDirectory(tab->render_view_host()->process()->GetID(), - path)) { + if (!policy->CanReadDirectory(tab->GetRenderProcessHost()->GetID(), path)) return; - } Profile* profile = Profile::FromBrowserContext(tab->browser_context()); @@ -2555,7 +2553,7 @@ void Browser::EnumerateDirectoryHelper(TabContents* tab, int request_id, scoped_refptr<FileSelectHelper> file_select_helper( new FileSelectHelper(profile)); file_select_helper->EnumerateDirectory(request_id, - tab->render_view_host(), + tab->GetRenderViewHost(), path); } @@ -3497,7 +3495,7 @@ void Browser::AddNewContents(TabContents* source, return; } - new_contents->render_view_host()->DisassociateFromPopupCount(); + new_contents->GetRenderViewHost()->DisassociateFromPopupCount(); } browser::NavigateParams params(this, new_wrapper); @@ -3655,7 +3653,7 @@ void Browser::ConvertContentsToApplication(TabContents* contents) { app_browser->tabstrip_model()->AppendTabContents(wrapper, true); contents->GetMutableRendererPrefs()->can_accept_load_drops = false; - contents->render_view_host()->SyncRendererPrefs(); + contents->GetRenderViewHost()->SyncRendererPrefs(); app_browser->window()->Show(); } @@ -4909,8 +4907,8 @@ void Browser::ProcessPendingTabs() { TabContents* tab = *(tabs_needing_before_unload_fired_.begin()); // Null check render_view_host here as this gets called on a PostTask and // the tab's render_view_host may have been nulled out. - if (tab->render_view_host()) { - tab->render_view_host()->FirePageBeforeUnload(false); + if (tab->GetRenderViewHost()) { + tab->GetRenderViewHost()->FirePageBeforeUnload(false); } else { ClearUnloadState(tab, true); } @@ -4926,8 +4924,8 @@ void Browser::ProcessPendingTabs() { TabContents* tab = *(tabs_needing_unload_fired_.begin()); // Null check render_view_host here as this gets called on a PostTask and // the tab's render_view_host may have been nulled out. - if (tab->render_view_host()) { - tab->render_view_host()->ClosePage(); + if (tab->GetRenderViewHost()) { + tab->GetRenderViewHost()->ClosePage(); } else { ClearUnloadState(tab, true); } @@ -5317,7 +5315,7 @@ void Browser::ShowSyncSetup() { } void Browser::ToggleSpeechInput() { - GetSelectedTabContentsWrapper()->tab_contents()->render_view_host()-> + GetSelectedTabContentsWrapper()->tab_contents()->GetRenderViewHost()-> ToggleSpeechInput(); } diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index d35cecb..c34d6b2 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -212,7 +212,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, JavascriptAlertActivatesTab) { EXPECT_EQ(0, browser()->active_index()); TabContents* second_tab = browser()->GetTabContentsAt(1); ASSERT_TRUE(second_tab); - second_tab->render_view_host()->ExecuteJavascriptInWebFrame( + second_tab->GetRenderViewHost()->ExecuteJavascriptInWebFrame( string16(), ASCIIToUTF16("alert('Activate!');")); AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); @@ -269,7 +269,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ReloadThenCancelBeforeUnload) { EXPECT_FALSE(browser()->GetSelectedTabContents()->IsLoading()); // Clear the beforeunload handler so the test can easily exit. - browser()->GetSelectedTabContents()->render_view_host()-> + browser()->GetSelectedTabContents()->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16("onbeforeunload=null;")); } @@ -301,7 +301,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CancelBeforeUnloadResetsURL) { EXPECT_EQ(url.spec(), UTF16ToUTF8(browser()->toolbar_model()->GetText())); // Clear the beforeunload handler so the test can easily exit. - browser()->GetSelectedTabContents()->render_view_host()-> + browser()->GetSelectedTabContents()->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16("onbeforeunload=null;")); } @@ -318,14 +318,14 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CancelBeforeUnloadResetsURL) { // Test for crbug.com/11647. A page closed with window.close() should not have // two beforeunload dialogs shown. IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_SingleBeforeUnloadAfterWindowClose) { - browser()->GetSelectedTabContents()->render_view_host()-> + browser()->GetSelectedTabContents()->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16(kOpenNewBeforeUnloadPage)); // Close the new window with JavaScript, which should show a single // beforeunload dialog. Then show another alert, to make it easy to verify // that a second beforeunload dialog isn't shown. - browser()->GetTabContentsAt(0)->render_view_host()-> + browser()->GetTabContentsAt(0)->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16("w.close(); alert('bar');")); AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); @@ -357,7 +357,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NullOpenerRedirectForksProcess) { // Start with an http URL. ui_test_utils::NavigateToURL(browser(), http_url); TabContents* oldtab = browser()->GetSelectedTabContents(); - content::RenderProcessHost* process = oldtab->render_view_host()->process(); + content::RenderProcessHost* process = oldtab->GetRenderProcessHost(); // Now open a tab to a blank page, set its opener to null, and redirect it // cross-site. @@ -373,7 +373,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NullOpenerRedirectForksProcess) { ui_test_utils::WindowedNotificationObserver nav_observer( content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::NotificationService::AllSources()); - oldtab->render_view_host()-> + oldtab->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16(redirect_popup)); // Wait for popup window to appear and finish navigating. @@ -389,7 +389,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NullOpenerRedirectForksProcess) { // Popup window should not be in the opener's process. content::RenderProcessHost* popup_process = - newtab->render_view_host()->process(); + newtab->GetRenderProcessHost(); EXPECT_NE(process, popup_process); // Now open a tab to a blank page, set its opener to null, and use a @@ -407,7 +407,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NullOpenerRedirectForksProcess) { ui_test_utils::WindowedNotificationObserver nav_observer2( content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::NotificationService::AllSources()); - oldtab->render_view_host()-> + oldtab->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16(refresh_popup)); // Wait for popup window to appear and finish navigating. @@ -423,7 +423,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NullOpenerRedirectForksProcess) { // This popup window should also not be in the opener's process. content::RenderProcessHost* popup_process2 = - newtab2->render_view_host()->process(); + newtab2->GetRenderProcessHost(); EXPECT_NE(process, popup_process2); } @@ -445,7 +445,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, OtherRedirectsDontForkProcess) { // Start with an http URL. ui_test_utils::NavigateToURL(browser(), http_url); TabContents* oldtab = browser()->GetSelectedTabContents(); - content::RenderProcessHost* process = oldtab->render_view_host()->process(); + content::RenderProcessHost* process = oldtab->GetRenderProcessHost(); // Now open a tab to a blank page, set its opener to null, and redirect it // cross-site. @@ -460,7 +460,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, OtherRedirectsDontForkProcess) { ui_test_utils::WindowedNotificationObserver nav_observer( content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::NotificationService::AllSources()); - oldtab->render_view_host()-> + oldtab->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16(dont_fork_popup)); // Wait for popup window to appear and finish navigating. @@ -476,7 +476,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, OtherRedirectsDontForkProcess) { // Popup window should still be in the opener's process. content::RenderProcessHost* popup_process = - newtab->render_view_host()->process(); + newtab->GetRenderProcessHost(); EXPECT_EQ(process, popup_process); // Same thing if the current tab tries to navigate itself. @@ -487,7 +487,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, OtherRedirectsDontForkProcess) { ui_test_utils::WindowedNotificationObserver nav_observer2( content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::NotificationService::AllSources()); - oldtab->render_view_host()-> + oldtab->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16(navigate_str)); nav_observer2.Wait(); ASSERT_TRUE(oldtab->controller().GetLastCommittedEntry()); @@ -495,8 +495,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, OtherRedirectsDontForkProcess) { oldtab->controller().GetLastCommittedEntry()->url().spec()); // Original window should still be in the original process. - content::RenderProcessHost* new_process = - newtab->render_view_host()->process(); + content::RenderProcessHost* new_process = newtab->GetRenderProcessHost(); EXPECT_EQ(process, new_process); } diff --git a/chrome/browser/ui/browser_list_unittest.cc b/chrome/browser/ui/browser_list_unittest.cc index 0789bef..6ae4b08 100644 --- a/chrome/browser/ui/browser_list_unittest.cc +++ b/chrome/browser/ui/browser_list_unittest.cc @@ -32,7 +32,7 @@ size_t CountAllTabs() { // Helper function to navigate to the print preview page. void NavigateToPrintUrl(TabContentsWrapper* tab, int page_id) { static_cast<TestRenderViewHost*>( - tab->tab_contents()->render_view_host())->SendNavigate( + tab->tab_contents()->GetRenderViewHost())->SendNavigate( page_id, GURL(chrome::kChromeUIPrintURL)); } diff --git a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm index ef8aa25..13c4f5d 100644 --- a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm @@ -244,7 +244,7 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { } - (void)handlesUndoScriptCommand:(NSScriptCommand*)command { - RenderViewHost* view = tabContents_->tab_contents()->render_view_host(); + RenderViewHost* view = tabContents_->tab_contents()->GetRenderViewHost(); if (!view) { NOTREACHED(); return; @@ -254,7 +254,7 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { } - (void)handlesRedoScriptCommand:(NSScriptCommand*)command { - RenderViewHost* view = tabContents_->tab_contents()->render_view_host(); + RenderViewHost* view = tabContents_->tab_contents()->GetRenderViewHost(); if (!view) { NOTREACHED(); return; @@ -264,7 +264,7 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { } - (void)handlesCutScriptCommand:(NSScriptCommand*)command { - RenderViewHost* view = tabContents_->tab_contents()->render_view_host(); + RenderViewHost* view = tabContents_->tab_contents()->GetRenderViewHost(); if (!view) { NOTREACHED(); return; @@ -274,7 +274,7 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { } - (void)handlesCopyScriptCommand:(NSScriptCommand*)command { - RenderViewHost* view = tabContents_->tab_contents()->render_view_host(); + RenderViewHost* view = tabContents_->tab_contents()->GetRenderViewHost(); if (!view) { NOTREACHED(); return; @@ -284,7 +284,7 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { } - (void)handlesPasteScriptCommand:(NSScriptCommand*)command { - RenderViewHost* view = tabContents_->tab_contents()->render_view_host(); + RenderViewHost* view = tabContents_->tab_contents()->GetRenderViewHost(); if (!view) { NOTREACHED(); return; @@ -294,7 +294,7 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { } - (void)handlesSelectAllScriptCommand:(NSScriptCommand*)command { - RenderViewHost* view = tabContents_->tab_contents()->render_view_host(); + RenderViewHost* view = tabContents_->tab_contents()->GetRenderViewHost(); if (!view) { NOTREACHED(); return; @@ -325,7 +325,7 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { } - (void)handlesStopScriptCommand:(NSScriptCommand*)command { - RenderViewHost* view = tabContents_->tab_contents()->render_view_host(); + RenderViewHost* view = tabContents_->tab_contents()->GetRenderViewHost(); if (!view) { // We tolerate Stop being called even before a view has been created. // So just log a warning instead of a NOTREACHED(). @@ -400,7 +400,7 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { } - (id)handlesExecuteJavascriptScriptCommand:(NSScriptCommand*)command { - RenderViewHost* view = tabContents_->tab_contents()->render_view_host(); + RenderViewHost* view = tabContents_->tab_contents()->GetRenderViewHost(); if (!view) { NOTREACHED(); return nil; diff --git a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm index 235a221..5052b8b 100644 --- a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm +++ b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm @@ -234,7 +234,7 @@ const float kRightEdgeOffset = 25; // cmd-up/down if we ever decide to include |moveToBeginningOfDocument:| in // the list above. RenderViewHost* render_view_host = - contents->tab_contents()->render_view_host(); + contents->tab_contents()->GetRenderViewHost(); render_view_host->ForwardKeyboardEvent(NativeWebKeyboardEvent(event)); return YES; } diff --git a/chrome/browser/ui/cocoa/hung_renderer_controller.mm b/chrome/browser/ui/cocoa/hung_renderer_controller.mm index 41e616b..5a2147e 100644 --- a/chrome/browser/ui/cocoa/hung_renderer_controller.mm +++ b/chrome/browser/ui/cocoa/hung_renderer_controller.mm @@ -116,8 +116,8 @@ class TabContentsObserverBridge : public TabContentsObserver { } - (IBAction)wait:(id)sender { - if (hungContents_ && hungContents_->render_view_host()) - hungContents_->render_view_host()->RestartHangMonitorTimeout(); + if (hungContents_ && hungContents_->GetRenderViewHost()) + hungContents_->GetRenderViewHost()->RestartHangMonitorTimeout(); // Cannot call performClose:, because the close button is disabled. [self close]; } diff --git a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm index db10dc9..4b4aa77 100644 --- a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm +++ b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm @@ -186,7 +186,7 @@ void TabContentsNotificationBridge::ChangeTabContents(TabContents* contents) { // The RWHV is ripped out of the view hierarchy on tab switches, so it never // formally resigns first responder status. Handle this by explicitly sending // a Blur() message to the renderer, but only if the RWHV currently has focus. - RenderViewHost* rvh = [self tabContents]->render_view_host(); + RenderViewHost* rvh = [self tabContents]->GetRenderViewHost(); if (rvh && rvh->view() && rvh->view()->HasFocus()) rvh->Blur(); } diff --git a/chrome/browser/ui/cocoa/tabpose_window.mm b/chrome/browser/ui/cocoa/tabpose_window.mm index 6b3bb82..c643cbb 100644 --- a/chrome/browser/ui/cocoa/tabpose_window.mm +++ b/chrome/browser/ui/cocoa/tabpose_window.mm @@ -254,13 +254,13 @@ void ThumbnailLoader::LoadThumbnail() { TabContentsWrapper* devToolsContents = DevToolsWindow::GetDevToolsContents(contents_->tab_contents()); if (devToolsContents && devToolsContents->tab_contents() && - devToolsContents->tab_contents()->render_view_host() && - devToolsContents->tab_contents()->render_view_host()->view()) { + devToolsContents->tab_contents()->GetRenderViewHost() && + devToolsContents->tab_contents()->GetRenderViewHost()->view()) { // The devtool's size might not be up-to-date, but since its height doesn't // change on window resize, and since most users don't use devtools, this is // good enough. bottomOffset += - devToolsContents->tab_contents()->render_view_host()->view()-> + devToolsContents->tab_contents()->GetRenderViewHost()->view()-> GetViewBounds().height(); bottomOffset += 1; // :-( Divider line between web contents and devtools. } @@ -285,7 +285,7 @@ void ThumbnailLoader::LoadThumbnail() { } - (void)drawInContext:(CGContextRef)context { - RenderWidgetHost* rwh = contents_->tab_contents()->render_view_host(); + RenderWidgetHost* rwh = contents_->tab_contents()->GetRenderViewHost(); // NULL if renderer crashed. RenderWidgetHostView* rwhv = rwh ? rwh->view() : NULL; if (!rwhv) { diff --git a/chrome/browser/ui/constrained_window_tab_helper.cc b/chrome/browser/ui/constrained_window_tab_helper.cc index 6b4fb99..6d37816 100644 --- a/chrome/browser/ui/constrained_window_tab_helper.cc +++ b/chrome/browser/ui/constrained_window_tab_helper.cc @@ -75,7 +75,7 @@ void ConstrainedWindowTabHelper::BlockTabContent(bool blocked) { } // RenderViewHost may be NULL during shutdown. - RenderViewHost* host = contents->render_view_host(); + RenderViewHost* host = contents->GetRenderViewHost(); if (host) { host->set_ignore_input_events(blocked); host->Send( diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc index 8c38964..d60fc74 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc @@ -380,7 +380,7 @@ class ContentSettingPluginBubbleModel : public ContentSettingSingleRadioGroup { virtual void OnCustomLinkClicked() OVERRIDE { content::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Bubble")); DCHECK(tab_contents()); - RenderViewHost* host = tab_contents()->tab_contents()->render_view_host(); + RenderViewHost* host = tab_contents()->tab_contents()->GetRenderViewHost(); host->Send(new ChromeViewMsg_LoadBlockedPlugins(host->routing_id())); set_custom_link_enabled(false); tab_contents()->content_settings()->set_load_plugins_link_enabled(false); diff --git a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc index 7763acd..acbcb2f 100644 --- a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc +++ b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc @@ -226,7 +226,7 @@ bool FocusedOnPage(TabContents* tab_contents, std::string* result) bool FocusedOnPage(TabContents* tab_contents, std::string* result) { return ui_test_utils::ExecuteJavaScriptAndExtractString( - tab_contents->render_view_host(), + tab_contents->GetRenderViewHost(), L"", L"window.domAutomationController.send(getFocusedElement());", result); @@ -271,7 +271,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageEndState) { // Move the selection to link 1, after searching. ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - tab_contents->tab_contents()->render_view_host(), + tab_contents->tab_contents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(selectLink1());", &result)); @@ -345,7 +345,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, // Move the selection to link 1, after searching. std::string result; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( - tab->tab_contents()->render_view_host(), + tab->tab_contents()->GetRenderViewHost(), L"", L"window.domAutomationController.send(selectLink1());", &result)); diff --git a/chrome/browser/ui/find_bar/find_tab_helper.cc b/chrome/browser/ui/find_bar/find_tab_helper.cc index 1dfb494..974db90 100644 --- a/chrome/browser/ui/find_bar/find_tab_helper.cc +++ b/chrome/browser/ui/find_bar/find_tab_helper.cc @@ -84,8 +84,8 @@ void FindTabHelper::StartFinding(string16 search_string, options.forward = forward_direction; options.matchCase = case_sensitive; options.findNext = find_next; - tab_contents()->render_view_host()->Find(current_find_request_id_, - find_text_, options); + tab_contents()->GetRenderViewHost()->Find(current_find_request_id_, + find_text_, options); } void FindTabHelper::StopFinding( @@ -119,7 +119,7 @@ void FindTabHelper::StopFinding( NOTREACHED(); action = content::STOP_FIND_ACTION_KEEP_SELECTION; } - tab_contents()->render_view_host()->StopFinding(action); + tab_contents()->GetRenderViewHost()->StopFinding(action); } void FindTabHelper::HandleFindReply(int request_id, diff --git a/chrome/browser/ui/fullscreen_controller.cc b/chrome/browser/ui/fullscreen_controller.cc index 1b52730..8f2ca4c 100644 --- a/chrome/browser/ui/fullscreen_controller.cc +++ b/chrome/browser/ui/fullscreen_controller.cc @@ -281,8 +281,8 @@ bool FullscreenController::HandleUserPressedEscape() { void FullscreenController::NotifyTabOfFullscreenExitIfNecessary() { if (fullscreened_tab_ && - fullscreened_tab_->tab_contents()->render_view_host()) { - fullscreened_tab_->tab_contents()->render_view_host()->ExitFullscreen(); + fullscreened_tab_->tab_contents()->GetRenderViewHost()) { + fullscreened_tab_->tab_contents()->GetRenderViewHost()->ExitFullscreen(); } else { DCHECK_EQ(mouse_lock_state_, MOUSELOCK_NOT_REQUESTED); } diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc index 6d52c31..d9961b3 100644 --- a/chrome/browser/ui/gtk/browser_window_gtk.cc +++ b/chrome/browser/ui/gtk/browser_window_gtk.cc @@ -1414,7 +1414,7 @@ gboolean BrowserWindowGtk::OnConfigure(GtkWidget* widget, TabContentsWrapper* tab = GetDisplayedTab(); if (tab) { - tab->tab_contents()->render_view_host()->NotifyMoveOrResizeStarted(); + tab->tab_contents()->GetRenderViewHost()->NotifyMoveOrResizeStarted(); } if (bounds_.size() != bounds.size()) diff --git a/chrome/browser/ui/gtk/find_bar_gtk.cc b/chrome/browser/ui/gtk/find_bar_gtk.cc index ccaa78d..5bb733b 100644 --- a/chrome/browser/ui/gtk/find_bar_gtk.cc +++ b/chrome/browser/ui/gtk/find_bar_gtk.cc @@ -674,7 +674,7 @@ bool FindBarGtk::MaybeForwardKeyEventToRenderer(GdkEventKey* event) { return false; RenderViewHost* render_view_host = - contents->tab_contents()->render_view_host(); + contents->tab_contents()->GetRenderViewHost(); // Make sure we don't have a text field element interfering with keyboard // input. Otherwise Up and Down arrow key strokes get eaten. "Nom Nom Nom". diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc index 222fd3c..9c23ab8 100644 --- a/chrome/browser/ui/gtk/gtk_util.cc +++ b/chrome/browser/ui/gtk/gtk_util.cc @@ -1174,7 +1174,7 @@ void DoCutCopyPaste(BrowserWindow* window, TabContents* current_tab = GetBrowserWindowSelectedTabContents(window); if (current_tab && widget == current_tab->GetContentNativeView()) { - (current_tab->render_view_host()->*method)(); + (current_tab->GetRenderViewHost()->*method)(); } else { guint id; if ((id = g_signal_lookup(signal, G_OBJECT_TYPE(widget))) != 0) diff --git a/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc b/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc index 5172230..bf9342f 100644 --- a/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc @@ -234,8 +234,8 @@ void HungRendererDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { case GTK_RESPONSE_OK: case GTK_RESPONSE_DELETE_EVENT: // Start waiting again for responsiveness. - if (contents_ && contents_->render_view_host()) - contents_->render_view_host()->RestartHangMonitorTimeout(); + if (contents_ && contents_->GetRenderViewHost()) + contents_->GetRenderViewHost()->RestartHangMonitorTimeout(); break; default: NOTREACHED(); diff --git a/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc b/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc index af7f91c..2955305 100644 --- a/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc +++ b/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc @@ -18,7 +18,7 @@ BalloonViewHost::~BalloonViewHost() { } void BalloonViewHost::UpdateActualSize(const gfx::Size& new_size) { - RenderViewHost* host = tab_contents_->render_view_host(); + RenderViewHost* host = tab_contents_->GetRenderViewHost(); if (host) { RenderWidgetHostView* view = host->view(); if (view) diff --git a/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc b/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc index 634f6c0..7afd2148 100644 --- a/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc @@ -391,7 +391,7 @@ gboolean DraggedViewGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) { // Draw the render area. BackingStore* backing_store = drag_data_->GetSourceTabContents()-> - render_view_host()->GetBackingStore(false); + GetRenderViewHost()->GetBackingStore(false); if (backing_store && !attached_) { // This leaves room for the border. static_cast<BackingStoreGtk*>(backing_store)->PaintToRect( diff --git a/chrome/browser/ui/login/login_prompt_win.cc b/chrome/browser/ui/login/login_prompt_win.cc index f1f241d..e87e8e9 100644 --- a/chrome/browser/ui/login/login_prompt_win.cc +++ b/chrome/browser/ui/login/login_prompt_win.cc @@ -60,7 +60,7 @@ class LoginHandlerWin : public LoginHandler, TabContents* tab = GetTabContentsForLogin(); if (tab) - tab->render_view_host()->set_ignore_input_events(false); + tab->GetRenderViewHost()->set_ignore_input_events(false); // Reference is no longer valid. SetDialog(NULL); diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc index 1e4d991..b9015ee 100644 --- a/chrome/browser/ui/panels/panel.cc +++ b/chrome/browser/ui/panels/panel.cc @@ -598,7 +598,7 @@ void Panel::ConfigureAutoResize(TabContents* tab_contents) { return; // NULL might be returned if the tab has not been added. - RenderViewHost* render_view_host = tab_contents->render_view_host(); + RenderViewHost* render_view_host = tab_contents->GetRenderViewHost(); if (!render_view_host) return; diff --git a/chrome/browser/ui/panels/panel_browsertest.cc b/chrome/browser/ui/panels/panel_browsertest.cc index cacd99fc..973c8aa 100644 --- a/chrome/browser/ui/panels/panel_browsertest.cc +++ b/chrome/browser/ui/panels/panel_browsertest.cc @@ -815,7 +815,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, FLAKY_AutoResize) { chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)); EXPECT_TRUE(ui_test_utils::ExecuteJavaScript( - panel->browser()->GetSelectedTabContents()->render_view_host(), + panel->browser()->GetSelectedTabContents()->GetRenderViewHost(), std::wstring(), L"changeSize(50);")); enlarge.Wait(); @@ -828,7 +828,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, FLAKY_AutoResize) { chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)); EXPECT_TRUE(ui_test_utils::ExecuteJavaScript( - panel->browser()->GetSelectedTabContents()->render_view_host(), + panel->browser()->GetSelectedTabContents()->GetRenderViewHost(), std::wstring(), L"changeSize(-30);")); shrink.Wait(); @@ -1477,7 +1477,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, CreateWithExistingContents) { chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)); EXPECT_TRUE(ui_test_utils::ExecuteJavaScript( - panel_browser->GetSelectedTabContents()->render_view_host(), + panel_browser->GetSelectedTabContents()->GetRenderViewHost(), std::wstring(), L"changeSize(50);")); enlarge.Wait(); @@ -1543,7 +1543,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, TightAutosizeAroundSingleLine) { chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)); EXPECT_TRUE(ui_test_utils::ExecuteJavaScript( - panel->browser()->GetSelectedTabContents()->render_view_host(), + panel->browser()->GetSelectedTabContents()->GetRenderViewHost(), std::wstring(), L"document.body.innerHTML =" L"'<nobr>line of text and a <button>Button</button>';")); diff --git a/chrome/browser/ui/pdf/pdf_browsertest.cc b/chrome/browser/ui/pdf/pdf_browsertest.cc index 96831b1..0061627 100644 --- a/chrome/browser/ui/pdf/pdf_browsertest.cc +++ b/chrome/browser/ui/pdf/pdf_browsertest.cc @@ -232,12 +232,12 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_Scroll) { wheel_event.deltaY = -200; wheel_event.wheelTicksY = -2; TabContents* tab_contents = browser()->GetSelectedTabContents(); - tab_contents->render_view_host()->ForwardWheelEvent(wheel_event); + tab_contents->GetRenderViewHost()->ForwardWheelEvent(wheel_event); ASSERT_NO_FATAL_FAILURE(WaitForResponse()); int y_offset = 0; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractInt( - browser()->GetSelectedTabContents()->render_view_host(), + browser()->GetSelectedTabContents()->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(plugin.pageYOffset())", &y_offset)); @@ -266,7 +266,7 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_FindAndCopy) { objects[ui::Clipboard::CBF_TEXT] = params; clipboard.WriteObjects(objects); - browser()->GetSelectedTabContents()->render_view_host()->Copy(); + browser()->GetSelectedTabContents()->GetRenderViewHost()->Copy(); ASSERT_NO_FATAL_FAILURE(WaitForResponse()); std::string text; @@ -317,7 +317,7 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, FLAKY_SLOW_Loading) { // and before creating a byte-range request loader. bool complete = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetSelectedTabContents()->render_view_host(), + browser()->GetSelectedTabContents()->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(plugin.documentLoadComplete())", &complete)); @@ -350,7 +350,7 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_OnLoadAndReload) { content::Source<NavigationController>( &browser()->GetSelectedTabContents()->controller())); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( - browser()->GetSelectedTabContents()->render_view_host(), + browser()->GetSelectedTabContents()->GetRenderViewHost(), std::wstring(), L"reloadPDF();")); observer.Wait(); diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc index 4224b07..0663797 100644 --- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc +++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc @@ -138,11 +138,11 @@ void OpenUsingReader(TabContentsWrapper* tab, InfoBarDelegate* old_delegate, InfoBarDelegate* new_delegate) { ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( - tab->tab_contents()->render_view_host()->process()->GetID(), - tab->tab_contents()->render_view_host()->routing_id(), + tab->tab_contents()->GetRenderProcessHost()->GetID(), + tab->tab_contents()->GetRenderViewHost()->routing_id(), tab->tab_contents()->GetURL(), ASCIIToUTF16(PluginGroup::kAdobeReaderGroupName)); - tab->tab_contents()->render_view_host()->ReloadFrame(); + tab->tab_contents()->GetRenderViewHost()->ReloadFrame(); if (new_delegate) { if (old_delegate) { @@ -404,6 +404,6 @@ void PDFHasUnsupportedFeature(TabContentsWrapper* tab) { PluginService::GetInstance()->GetPluginGroups( base::Bind(&GotPluginGroupsCallback, - tab->tab_contents()->render_view_host()->process()->GetID(), - tab->tab_contents()->render_view_host()->routing_id())); + tab->tab_contents()->GetRenderProcessHost()->GetID(), + tab->tab_contents()->GetRenderViewHost()->routing_id())); } diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc index aae0a6a..3ea3f6ac 100644 --- a/chrome/browser/ui/prefs/prefs_tab_helper.cc +++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc @@ -429,11 +429,11 @@ void PrefsTabHelper::UpdateWebPreferences() { WebPreferences prefs = rvhd->GetWebkitPrefs(); prefs.javascript_enabled = per_tab_prefs_->GetBoolean(prefs::kWebKitJavascriptEnabled); - tab_contents()->render_view_host()->UpdateWebkitPreferences(prefs); + tab_contents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs); } void PrefsTabHelper::UpdateRendererPreferences() { renderer_preferences_util::UpdateFromSystemSettings( tab_contents()->GetMutableRendererPrefs(), wrapper_->profile()); - tab_contents()->render_view_host()->SyncRendererPrefs(); + tab_contents()->GetRenderViewHost()->SyncRendererPrefs(); } diff --git a/chrome/browser/ui/views/aura/app_list_window.cc b/chrome/browser/ui/views/aura/app_list_window.cc index d0de9d8..1b3f9a0 100644 --- a/chrome/browser/ui/views/aura/app_list_window.cc +++ b/chrome/browser/ui/views/aura/app_list_window.cc @@ -107,7 +107,7 @@ void AppListWindow::Init(const gfx::Rect& bounds) { background.allocPixels(); background.eraseARGB(0x00, 0x00, 0x00, 0x00); - RenderViewHost* host = tab->render_view_host(); + RenderViewHost* host = tab->GetRenderViewHost(); host->view()->SetBackground(background); views::Widget::InitParams widget_params( diff --git a/chrome/browser/ui/views/find_bar_host.cc b/chrome/browser/ui/views/find_bar_host.cc index 442b8dd..c1f19eb 100644 --- a/chrome/browser/ui/views/find_bar_host.cc +++ b/chrome/browser/ui/views/find_bar_host.cc @@ -70,7 +70,7 @@ bool FindBarHost::MaybeForwardKeyEventToWebpage( return false; RenderViewHost* render_view_host = - contents->tab_contents()->render_view_host(); + contents->tab_contents()->GetRenderViewHost(); // Make sure we don't have a text field element interfering with keyboard // input. Otherwise Up and Down arrow key strokes get eaten. "Nom Nom Nom". diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index d16938a..04484ef 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -1669,7 +1669,7 @@ void BrowserView::OnWindowBeginUserBoundsChange() { TabContents* tab_contents = GetSelectedTabContents(); if (!tab_contents) return; - tab_contents->render_view_host()->NotifyMoveOrResizeStarted(); + tab_contents->GetRenderViewHost()->NotifyMoveOrResizeStarted(); } void BrowserView::OnWidgetMove() { diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc index 0c78d03..9c89b2e 100644 --- a/chrome/browser/ui/views/hung_renderer_view.cc +++ b/chrome/browser/ui/views/hung_renderer_view.cc @@ -132,7 +132,7 @@ content::RenderProcessHost* HungPagesTableModel::GetRenderProcessHost() { RenderViewHost* HungPagesTableModel::GetRenderViewHost() { return tab_observers_.empty() ? NULL : - tab_observers_[0]->tab_contents()->render_view_host(); + tab_observers_[0]->tab_contents()->GetRenderViewHost(); } void HungPagesTableModel::InitForTabContents(TabContents* hung_contents) { diff --git a/chrome/browser/ui/views/notifications/balloon_view_host.cc b/chrome/browser/ui/views/notifications/balloon_view_host.cc index aebef32..3945f72 100644 --- a/chrome/browser/ui/views/notifications/balloon_view_host.cc +++ b/chrome/browser/ui/views/notifications/balloon_view_host.cc @@ -49,7 +49,7 @@ void BalloonViewHost::Init(gfx::NativeView parent_native_view) { BalloonHost::Init(); RenderWidgetHostView* render_widget_host_view = - tab_contents_->render_view_host()->view(); + tab_contents_->GetRenderViewHost()->view(); native_host_->Attach(render_widget_host_view->GetNativeView()); } diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc index f2f21bb..4cb9ab6 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc @@ -48,7 +48,7 @@ class WebDragSourceAura : public MessageLoopForUI::Observer { RenderViewHost* rvh = NULL; switch (type) { case ui::ET_MOUSE_DRAGGED: - rvh = view_->GetTabContents()->render_view_host(); + rvh = view_->GetTabContents()->GetRenderViewHost(); if (rvh) { gfx::Point screen_loc = ui::EventLocationFromNative(event); gfx::Point client_loc = screen_loc; @@ -211,7 +211,7 @@ void NativeTabContentsViewAura::StartDragging(const WebDropData& drop_data, MessageLoop::current()->SetNestableTasksAllowed(old_state); EndDrag(ConvertToWeb(result_op)); - GetTabContents()->render_view_host()->DragSourceSystemDragEnded(); + GetTabContents()->GetRenderViewHost()->DragSourceSystemDragEnded(); } void NativeTabContentsViewAura::CancelDrag() { @@ -268,7 +268,7 @@ void NativeTabContentsViewAura::OnDragEntered( WebKit::WebDragOperationsMask op = ConvertToWeb(event.source_operations()); gfx::Point screen_pt = aura::RootWindow::GetInstance()->last_mouse_location(); - GetTabContents()->render_view_host()->DragTargetDragEnter( + GetTabContents()->GetRenderViewHost()->DragTargetDragEnter( drop_data, event.location(), screen_pt, op); } @@ -276,18 +276,18 @@ int NativeTabContentsViewAura::OnDragUpdated( const aura::DropTargetEvent& event) { WebKit::WebDragOperationsMask op = ConvertToWeb(event.source_operations()); gfx::Point screen_pt = aura::RootWindow::GetInstance()->last_mouse_location(); - GetTabContents()->render_view_host()->DragTargetDragOver( + GetTabContents()->GetRenderViewHost()->DragTargetDragOver( event.location(), screen_pt, op); return ConvertFromWeb(current_drag_op_); } void NativeTabContentsViewAura::OnDragExited() { - GetTabContents()->render_view_host()->DragTargetDragLeave(); + GetTabContents()->GetRenderViewHost()->DragTargetDragLeave(); } int NativeTabContentsViewAura::OnPerformDrop( const aura::DropTargetEvent& event) { - GetTabContents()->render_view_host()->DragTargetDrop( + GetTabContents()->GetRenderViewHost()->DragTargetDrop( event.location(), aura::RootWindow::GetInstance()->last_mouse_location()); return current_drag_op_; } @@ -299,7 +299,7 @@ void NativeTabContentsViewAura::EndDrag(WebKit::WebDragOperationsMask ops) { gfx::Point screen_loc = aura::RootWindow::GetInstance()->last_mouse_location(); gfx::Point client_loc = screen_loc; - RenderViewHost* rvh = GetTabContents()->render_view_host(); + RenderViewHost* rvh = GetTabContents()->GetRenderViewHost(); aura::Window* window = rvh->view()->GetNativeView(); aura::Window::ConvertPointToWindow(aura::RootWindow::GetInstance(), window, &client_loc); diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc index 4f44b7b..a9ca3f4 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc @@ -292,7 +292,7 @@ void TabContentsViewViews::TakeFocus(bool reverse) { } void TabContentsViewViews::CloseTab() { - tab_contents_->Close(tab_contents_->render_view_host()); + tab_contents_->Close(tab_contents_->GetRenderViewHost()); } void TabContentsViewViews::CreateNewWindow( @@ -305,12 +305,12 @@ void TabContentsViewViews::CreateNewWindow( void TabContentsViewViews::CreateNewWidget( int route_id, WebKit::WebPopupType popup_type) { delegate_view_helper_.CreateNewWidget(route_id, popup_type, - tab_contents_->render_view_host()->process()); + tab_contents_->GetRenderProcessHost()); } void TabContentsViewViews::CreateNewFullscreenWidget(int route_id) { delegate_view_helper_.CreateNewFullscreenWidget( - route_id, tab_contents_->render_view_host()->process()); + route_id, tab_contents_->GetRenderProcessHost()); } void TabContentsViewViews::ShowCreatedWindow(int route_id, diff --git a/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc b/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc index 86883cf..b346cd8 100644 --- a/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc +++ b/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc @@ -352,7 +352,7 @@ void KeyboardWidget::RenderViewGone(base::TerminationStatus status) { void KeyboardWidget::OnRequest(const ExtensionHostMsg_Request_Params& request) { extension_dispatcher_.Dispatch(request, - dom_view_->dom_contents()->tab_contents()->render_view_host()); + dom_view_->dom_contents()->tab_contents()->GetRenderViewHost()); } void KeyboardWidget::TextInputTypeChanged(ui::TextInputType type, diff --git a/chrome/browser/ui/webui/cloud_print_signin_dialog.cc b/chrome/browser/ui/webui/cloud_print_signin_dialog.cc index 1d26652..b516cbd 100644 --- a/chrome/browser/ui/webui/cloud_print_signin_dialog.cc +++ b/chrome/browser/ui/webui/cloud_print_signin_dialog.cc @@ -82,7 +82,7 @@ void CloudPrintSigninFlowHandler::Observe( url.path() == dialog_url.path() && url.scheme() == dialog_url.scheme()) { StoreDialogSize(); - web_ui_->tab_contents()->render_view_host()->ClosePage(); + web_ui_->tab_contents()->GetRenderViewHost()->ClosePage(); static_cast<PrintPreviewUI*>( parent_tab_->web_ui())->OnReloadPrintersList(); } diff --git a/chrome/browser/ui/webui/hung_renderer_dialog.cc b/chrome/browser/ui/webui/hung_renderer_dialog.cc index 5f95776..228c464 100644 --- a/chrome/browser/ui/webui/hung_renderer_dialog.cc +++ b/chrome/browser/ui/webui/hung_renderer_dialog.cc @@ -186,8 +186,8 @@ void HungRendererDialog::OnDialogClosed(const std::string& json_retval) { } else { // No indication from the user that it is ok to kill anything. Just wait. // Start waiting again for responsiveness. - if (contents_ && contents_->render_view_host()) - contents_->render_view_host()->RestartHangMonitorTimeout(); + if (contents_ && contents_->GetRenderViewHost()) + contents_->GetRenderViewHost()->RestartHangMonitorTimeout(); } } g_instance = NULL; diff --git a/chrome/browser/ui/webui/media/media_internals_handler.cc b/chrome/browser/ui/webui/media/media_internals_handler.cc index 6798ad5..fc9a6be 100644 --- a/chrome/browser/ui/webui/media/media_internals_handler.cc +++ b/chrome/browser/ui/webui/media/media_internals_handler.cc @@ -43,7 +43,7 @@ void MediaInternalsMessageHandler::OnGetEverything(const ListValue* list) { void MediaInternalsMessageHandler::OnUpdate(const string16& update) { // Don't try to execute JavaScript in a RenderView that no longer exists. - RenderViewHost* host = web_ui_->tab_contents()->render_view_host(); + RenderViewHost* host = web_ui_->tab_contents()->GetRenderViewHost(); if (host) host->ExecuteJavascriptInWebFrame(string16(), update); } diff --git a/chrome/browser/ui/webui/net_internals_ui_browsertest.cc b/chrome/browser/ui/webui/net_internals_ui_browsertest.cc index 3cc5474..4ae132e 100644 --- a/chrome/browser/ui/webui/net_internals_ui_browsertest.cc +++ b/chrome/browser/ui/webui/net_internals_ui_browsertest.cc @@ -257,7 +257,7 @@ void NetInternalsTest::MessageHandler::AddCacheEntry( void NetInternalsTest::MessageHandler::NavigateToPrerender( const ListValue* list_value) { - RenderViewHost* host = browser()->GetTabContentsAt(1)->render_view_host(); + RenderViewHost* host = browser()->GetTabContentsAt(1)->GetRenderViewHost(); host->ExecuteJavascriptInWebFrame(string16(), ASCIIToUTF16("Click()")); } diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc b/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc index 4a79f8e..feee76c 100644 --- a/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc +++ b/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc @@ -26,7 +26,7 @@ IN_PROC_BROWSER_TEST_F(NewTabUIBrowserTest, ChromeInternalLoadsNTP) { ui_test_utils::NavigateToURL(browser(), GURL("chrome-internal:")); bool empty_inner_html = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetTabContentsAt(0)->render_view_host(), L"", + browser()->GetTabContentsAt(0)->GetRenderViewHost(), L"", L"window.domAutomationController.send(document.body.innerHTML == '')", &empty_inner_html)); ASSERT_FALSE(empty_inner_html); diff --git a/chrome/browser/ui/webui/options/extension_settings_handler.cc b/chrome/browser/ui/webui/options/extension_settings_handler.cc index 093b7a42..bf3c673 100644 --- a/chrome/browser/ui/webui/options/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/options/extension_settings_handler.cc @@ -617,7 +617,7 @@ void ExtensionSettingsHandler::Observe( break; case chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED: deleting_rvh_ = content::Details<BackgroundContents>(details)-> - tab_contents()->render_view_host(); + tab_contents()->GetRenderViewHost(); // Fall through. case chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED: case chrome::NOTIFICATION_EXTENSION_HOST_CREATED: @@ -646,7 +646,7 @@ const Extension* ExtensionSettingsHandler::GetExtension(const ListValue* args) { void ExtensionSettingsHandler::MaybeUpdateAfterNotification() { TabContents* contents = web_ui_->tab_contents(); - if (!ignore_notifications_ && contents && contents->render_view_host()) + if (!ignore_notifications_ && contents && contents->GetRenderViewHost()) HandleRequestExtensionsData(NULL); deleting_rvh_ = NULL; } diff --git a/chrome/browser/ui/webui/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview_handler.cc index cc65922..4161476 100644 --- a/chrome/browser/ui/webui/print_preview_handler.cc +++ b/chrome/browser/ui/webui/print_preview_handler.cc @@ -340,7 +340,7 @@ void PrintPreviewHandler::HandleGetPreview(const ListValue* args) { } VLOG(1) << "Print preview request start"; - RenderViewHost* rvh = initiator_tab->tab_contents()->render_view_host(); + RenderViewHost* rvh = initiator_tab->tab_contents()->GetRenderViewHost(); rvh->Send(new PrintMsg_PrintPreview(rvh->routing_id(), *settings)); } @@ -355,7 +355,7 @@ void PrintPreviewHandler::HandlePrint(const ListValue* args) { TabContentsWrapper* initiator_tab = GetInitiatorTab(); CHECK(initiator_tab); - RenderViewHost* init_rvh = initiator_tab->tab_contents()->render_view_host(); + RenderViewHost* init_rvh = initiator_tab->tab_contents()->GetRenderViewHost(); init_rvh->Send(new PrintMsg_ResetScriptedPrintCount(init_rvh->routing_id())); scoped_ptr<DictionaryValue> settings(GetSettingsDictionary(args)); @@ -421,7 +421,7 @@ void PrintPreviewHandler::HandlePrint(const ListValue* args) { // The PDF being printed contains only the pages that the user selected, // so ignore the page range and print all pages. settings->Remove(printing::kSettingPageRange, NULL); - RenderViewHost* rvh = web_ui_->tab_contents()->render_view_host(); + RenderViewHost* rvh = web_ui_->tab_contents()->GetRenderViewHost(); rvh->Send(new PrintMsg_PrintForPrintPreview(rvh->routing_id(), *settings)); } initiator_tab->print_view_manager()->PrintPreviewDone(); diff --git a/chrome/browser/ui/webui/task_manager_handler.cc b/chrome/browser/ui/webui/task_manager_handler.cc index 5fd1888..63ef9af 100644 --- a/chrome/browser/ui/webui/task_manager_handler.cc +++ b/chrome/browser/ui/webui/task_manager_handler.cc @@ -404,7 +404,7 @@ void TaskManagerHandler::EnableTaskManager(const ListValue* indexes) { } void TaskManagerHandler::OpenAboutMemory(const ListValue* indexes) { - RenderViewHost* rvh = web_ui_->tab_contents()->render_view_host(); + RenderViewHost* rvh = web_ui_->tab_contents()->GetRenderViewHost(); if (rvh && rvh->delegate()) { WebPreferences webkit_prefs = rvh->delegate()->GetWebkitPrefs(); webkit_prefs.allow_scripts_to_close_windows = true; @@ -419,7 +419,7 @@ void TaskManagerHandler::OpenAboutMemory(const ListValue* indexes) { // TaskManagerHandler, private: ----------------------------------------------- bool TaskManagerHandler::is_alive() { - return web_ui_->tab_contents()->render_view_host() != NULL; + return web_ui_->tab_contents()->GetRenderViewHost() != NULL; } void TaskManagerHandler::UpdateResourceGroupTable(int start, int length) { diff --git a/chrome/browser/ui/webui/tracing_ui.cc b/chrome/browser/ui/webui/tracing_ui.cc index 8db166c..ab81f84 100644 --- a/chrome/browser/ui/webui/tracing_ui.cc +++ b/chrome/browser/ui/webui/tracing_ui.cc @@ -321,7 +321,7 @@ void TracingMessageHandler::LoadTraceFileComplete(std::string* file_contents) { std::string javascript = "tracingController.onLoadTraceFileComplete(" + *file_contents + ");"; - web_ui_->tab_contents()->render_view_host()-> + web_ui_->tab_contents()->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), UTF8ToUTF16(javascript)); } @@ -395,7 +395,7 @@ void TracingMessageHandler::OnTraceDataCollected( trace_buffer.Finish(); output.Append(");"); - web_ui_->tab_contents()->render_view_host()-> + web_ui_->tab_contents()->GetRenderViewHost()-> ExecuteJavascriptInWebFrame(string16(), UTF8ToUTF16(output.json_output)); } diff --git a/chrome/browser/ui/webui/web_ui_test_handler.cc b/chrome/browser/ui/webui/web_ui_test_handler.cc index 72e9999..69efe4c 100644 --- a/chrome/browser/ui/webui/web_ui_test_handler.cc +++ b/chrome/browser/ui/webui/web_ui_test_handler.cc @@ -33,14 +33,14 @@ void WebUITestHandler::PreloadJavaScript(const string16& js_text, } void WebUITestHandler::RunJavaScript(const string16& js_text) { - web_ui_->tab_contents()->render_view_host()->ExecuteJavascriptInWebFrame( + web_ui_->tab_contents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame( string16(), js_text); } bool WebUITestHandler::RunJavaScriptTestWithResult(const string16& js_text) { test_succeeded_ = false; run_test_succeeded_ = false; - RenderViewHost* rvh = web_ui_->tab_contents()->render_view_host(); + RenderViewHost* rvh = web_ui_->tab_contents()->GetRenderViewHost(); content::NotificationRegistrar notification_registrar; notification_registrar.Add( this, content::NOTIFICATION_EXECUTE_JAVASCRIPT_RESULT, diff --git a/chrome/browser/ui/webui/web_ui_unittest.cc b/chrome/browser/ui/webui/web_ui_unittest.cc index 09ae9eb..eeb3d0d 100644 --- a/chrome/browser/ui/webui/web_ui_unittest.cc +++ b/chrome/browser/ui/webui/web_ui_unittest.cc @@ -44,7 +44,7 @@ class WebUITest : public TabContentsWrapperTestHarness { // Now commit the load. static_cast<TestRenderViewHost*>( - contents->render_view_host())->SendNavigate(page_id, new_tab_url); + contents->GetRenderViewHost())->SendNavigate(page_id, new_tab_url); // The same flags should be set as before now that the load has committed. EXPECT_FALSE(wrapper->favicon_tab_helper()->ShouldDisplayFavicon()); @@ -72,7 +72,7 @@ class WebUITest : public TabContentsWrapperTestHarness { pending_render_view_host())->SendNavigate(page_id + 1, next_url); } else { static_cast<TestRenderViewHost*>( - contents->render_view_host())->SendNavigate(page_id + 1, next_url); + contents->GetRenderViewHost())->SendNavigate(page_id + 1, next_url); } // The state should now reflect a regular page. diff --git a/chrome/browser/ui/webui/workers_ui_browsertest.cc b/chrome/browser/ui/webui/workers_ui_browsertest.cc index b14ab2b..d864771 100644 --- a/chrome/browser/ui/webui/workers_ui_browsertest.cc +++ b/chrome/browser/ui/webui/workers_ui_browsertest.cc @@ -50,7 +50,7 @@ IN_PROC_BROWSER_TEST_F(WorkersUITest, MAYBE_SharedWorkersList) { std::string result; ASSERT_TRUE( ui_test_utils::ExecuteJavaScriptAndExtractString( - tab_contents->render_view_host(), + tab_contents->GetRenderViewHost(), L"", L"window.domAutomationController.send(" L"'' + document.getElementsByTagName('td')[1].textContent);", |