diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-18 19:52:40 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-18 19:52:40 +0000 |
commit | 1ef5ad42064c8ef0d1503b68a7fbac01887ca093 (patch) | |
tree | 34a32b11a9db6f69fef27e7e81863d82a29bcd2d /chrome/browser/dom_ui | |
parent | 59b49a66c3cd959fcf9d7b4bd9c6d88c70b39919 (diff) | |
download | chromium_src-1ef5ad42064c8ef0d1503b68a7fbac01887ca093.zip chromium_src-1ef5ad42064c8ef0d1503b68a7fbac01887ca093.tar.gz chromium_src-1ef5ad42064c8ef0d1503b68a7fbac01887ca093.tar.bz2 |
Reverting 14005.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14006 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r-- | chrome/browser/dom_ui/dom_ui_unittest.cc | 18 | ||||
-rw-r--r-- | chrome/browser/dom_ui/new_tab_ui.cc | 7 |
2 files changed, 16 insertions, 9 deletions
diff --git a/chrome/browser/dom_ui/dom_ui_unittest.cc b/chrome/browser/dom_ui/dom_ui_unittest.cc index e108c23..51b045a 100644 --- a/chrome/browser/dom_ui/dom_ui_unittest.cc +++ b/chrome/browser/dom_ui/dom_ui_unittest.cc @@ -16,7 +16,7 @@ class DOMUITest : public RenderViewHostTestHarness { // ID that we should use is passed as a parameter. We'll use the next two // values. This must be increasing for the life of the tests. static void DoNavigationTest(WebContents* contents, int page_id) { - NavigationController* controller = &contents->controller(); + NavigationController* controller = contents->controller(); // Start a pending load. GURL new_tab_url(chrome::kChromeUINewTabURL); @@ -88,19 +88,23 @@ TEST_F(DOMUITest, DOMUIToStandard) { // slightly different than the very-first-navigation case since the // SiteInstance will be the same (the original WebContents must still be // alive), which will trigger different behavior in RenderViewHostManager. - TestWebContents contents2(profile_.get(), NULL); + WebContents* contents2 = new TestWebContents(profile_.get(), NULL); + NavigationController* controller2 = + new NavigationController(contents2, profile_.get()); + contents2->set_controller(controller2); - DoNavigationTest(&contents2, 101); + DoNavigationTest(contents2, 101); + contents2->CloseContents(); } TEST_F(DOMUITest, DOMUIToDOMUI) { // Do a load (this state is tested above). GURL new_tab_url(chrome::kChromeUINewTabURL); - controller().LoadURL(new_tab_url, GURL(), PageTransition::LINK); + controller()->LoadURL(new_tab_url, GURL(), PageTransition::LINK); rvh()->SendNavigate(1, new_tab_url); // Start another pending load of the new tab page. - controller().LoadURL(new_tab_url, GURL(), PageTransition::LINK); + controller()->LoadURL(new_tab_url, GURL(), PageTransition::LINK); rvh()->SendNavigate(2, new_tab_url); // The flags should be the same as the non-pending state. @@ -113,7 +117,7 @@ TEST_F(DOMUITest, DOMUIToDOMUI) { TEST_F(DOMUITest, StandardToDOMUI) { // Start a pending navigation to a regular page. GURL std_url("http://google.com/"); - controller().LoadURL(std_url, GURL(), PageTransition::LINK); + controller()->LoadURL(std_url, GURL(), PageTransition::LINK); // The state should now reflect the default. EXPECT_TRUE(contents()->ShouldDisplayURL()); @@ -130,7 +134,7 @@ TEST_F(DOMUITest, StandardToDOMUI) { // Start a pending load for a DOMUI. GURL new_tab_url(chrome::kChromeUINewTabURL); - controller().LoadURL(new_tab_url, GURL(), PageTransition::LINK); + controller()->LoadURL(new_tab_url, GURL(), PageTransition::LINK); EXPECT_FALSE(contents()->ShouldDisplayURL()); EXPECT_TRUE(contents()->ShouldDisplayFavIcon()); EXPECT_FALSE(contents()->IsBookmarkBarAlwaysVisible()); diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index 90bf3dc..cd9b5d9 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -890,8 +890,9 @@ RecentlyClosedTabsHandler::~RecentlyClosedTabsHandler() { } void RecentlyClosedTabsHandler::HandleReopenTab(const Value* content) { + NavigationController* controller = dom_ui_->web_contents()->controller(); Browser* browser = Browser::GetBrowserForController( - &dom_ui_->web_contents()->controller(), NULL); + controller, NULL); if (!browser) return; @@ -1052,7 +1053,9 @@ void HistoryHandler::HandleSearchHistoryPage(const Value* content) { #if defined(OS_WIN) // TODO(port): include this once history is converted to HTML - dom_ui_->web_contents()->controller().LoadURL( + NavigationController* controller = + dom_ui_->web_contents()->controller(); + controller->LoadURL( HistoryUI::GetHistoryURLWithSearchText(wstring_value), GURL(), PageTransition::LINK); |