diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-02 20:38:22 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-02 20:38:22 +0000 |
commit | ee61392aa2dafe8bf6275a781b24ab0b35d0254e (patch) | |
tree | cbe8e94683758897b7efb052d14cf299b33bbfb0 /chrome | |
parent | 5980c304e7cdc554af5a2eba4d5cca573b0b0d1f (diff) | |
download | chromium_src-ee61392aa2dafe8bf6275a781b24ab0b35d0254e.zip chromium_src-ee61392aa2dafe8bf6275a781b24ab0b35d0254e.tar.gz chromium_src-ee61392aa2dafe8bf6275a781b24ab0b35d0254e.tar.bz2 |
Remove the ability to load lazy URLs from the NavigationController. This is no
longer used (except for a test that doens't seem to need it). We used to use
this feature for session restore, but it has since changed.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/191008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/blocked_popup_container_unittest.cc | 5 | ||||
-rw-r--r-- | chrome/browser/cocoa/blocked_popup_container_controller_unittest.mm | 5 | ||||
-rw-r--r-- | chrome/browser/login_prompt.h | 2 | ||||
-rw-r--r-- | chrome/browser/tab_contents/navigation_controller.cc | 50 | ||||
-rw-r--r-- | chrome/browser/tab_contents/navigation_controller.h | 19 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 4 |
6 files changed, 10 insertions, 75 deletions
diff --git a/chrome/browser/blocked_popup_container_unittest.cc b/chrome/browser/blocked_popup_container_unittest.cc index 4828074d..f31a1cb 100644 --- a/chrome/browser/blocked_popup_container_unittest.cc +++ b/chrome/browser/blocked_popup_container_unittest.cc @@ -90,9 +90,8 @@ TEST_F(BlockedPopupContainerTest, BasicCase) { // Create another TabContents representing the blocked popup case. TabContents* popup = BuildTabContents(); - popup->controller().LoadURLLazily(GetTestCase("error"), GURL(), - PageTransition::LINK, - L"", NULL); + popup->controller().LoadURL(GetTestCase("error"), GURL(), + PageTransition::LINK); container_->AddTabContents(popup, gfx::Rect(), host1); EXPECT_EQ(container_->GetBlockedPopupCount(), static_cast<size_t>(1)); diff --git a/chrome/browser/cocoa/blocked_popup_container_controller_unittest.mm b/chrome/browser/cocoa/blocked_popup_container_controller_unittest.mm index 393d4a6..623ee27 100644 --- a/chrome/browser/cocoa/blocked_popup_container_controller_unittest.mm +++ b/chrome/browser/cocoa/blocked_popup_container_controller_unittest.mm @@ -69,9 +69,8 @@ class BlockedPopupContainerControllerTest : public RenderViewHostTestHarness { TEST_F(BlockedPopupContainerControllerTest, BasicPopupBlock) { // This is taken from the popup blocker unit test. TabContents* popup = BuildTabContents(); - popup->controller().LoadURLLazily(GetTestCase("error"), GURL(), - PageTransition::LINK, - L"", NULL); + popup->controller().LoadURL(GetTestCase("error"), GURL(), + PageTransition::LINK); container_->AddTabContents(popup, gfx::Rect(), host1); EXPECT_EQ(container_->GetBlockedPopupCount(), static_cast<size_t>(1)); EXPECT_EQ(container_->GetTabContentsAt(0), popup); diff --git a/chrome/browser/login_prompt.h b/chrome/browser/login_prompt.h index 6279c7a..bcb63d8 100644 --- a/chrome/browser/login_prompt.h +++ b/chrome/browser/login_prompt.h @@ -78,7 +78,7 @@ class LoginNotificationDetails { LoginHandler* handler_; // Where to send the response. - DISALLOW_EVIL_CONSTRUCTORS(LoginNotificationDetails); + DISALLOW_COPY_AND_ASSIGN(LoginNotificationDetails); }; // Prompts the user for their username and password. This is designed to diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc index 7f5fa99..3b41cf3 100644 --- a/chrome/browser/tab_contents/navigation_controller.cc +++ b/chrome/browser/tab_contents/navigation_controller.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -125,8 +125,7 @@ NavigationController::NavigationController(TabContents* contents, tab_contents_(contents), max_restored_page_id_(-1), ALLOW_THIS_IN_INITIALIZER_LIST(ssl_manager_(this)), - needs_reload_(false), - load_pending_entry_when_active_(false) { + needs_reload_(false) { DCHECK(profile_); } @@ -390,41 +389,6 @@ void NavigationController::LoadURL(const GURL& url, const GURL& referrer, LoadEntry(entry); } -void NavigationController::LoadURLLazily(const GURL& url, - const GURL& referrer, - PageTransition::Type type, - const std::wstring& title, - SkBitmap* icon) { - NavigationEntry* entry = CreateNavigationEntry(url, referrer, type); - entry->set_title(WideToUTF16Hack(title)); - if (icon) - entry->favicon().set_bitmap(*icon); - - DiscardNonCommittedEntriesInternal(); - pending_entry_ = entry; - load_pending_entry_when_active_ = true; -} - -bool NavigationController::LoadingURLLazily() const { - return load_pending_entry_when_active_; -} - -const string16& NavigationController::GetLazyTitle() const { - if (pending_entry_) - return pending_entry_->GetTitleForDisplay(this); - else - return EmptyString16(); -} - -const SkBitmap& NavigationController::GetLazyFavIcon() const { - if (pending_entry_) { - return pending_entry_->favicon().bitmap(); - } else { - ResourceBundle &rb = ResourceBundle::GetSharedInstance(); - return *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); - } -} - void NavigationController::DocumentLoadedInFrame() { last_document_loaded_ = base::TimeTicks::Now(); } @@ -951,14 +915,8 @@ void NavigationController::DisablePromptOnRepost() { } void NavigationController::SetActive(bool is_active) { - if (is_active) { - if (needs_reload_) { - LoadIfNecessary(); - } else if (load_pending_entry_when_active_) { - NavigateToPendingEntry(false); - load_pending_entry_when_active_ = false; - } - } + if (is_active && needs_reload_) + LoadIfNecessary(); } void NavigationController::LoadIfNecessary() { diff --git a/chrome/browser/tab_contents/navigation_controller.h b/chrome/browser/tab_contents/navigation_controller.h index 6bd9309..9be8437 100644 --- a/chrome/browser/tab_contents/navigation_controller.h +++ b/chrome/browser/tab_contents/navigation_controller.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -248,11 +248,6 @@ class NavigationController { void LoadURL(const GURL& url, const GURL& referrer, PageTransition::Type type); - // Load the specified URL the next time it becomes active. - void LoadURLLazily(const GURL& url, const GURL& referrer, - PageTransition::Type type, const std::wstring& title, - SkBitmap* icon); - // Loads the current page if this NavigationController was restored from // history and the current page has not loaded yet. void LoadIfNecessary(); @@ -346,14 +341,6 @@ class NavigationController { // Random data --------------------------------------------------------------- - // Returns true if this NavigationController is is configured to load a URL - // lazily. If true, use GetLazyTitle() and GetLazyFavIcon() to discover the - // titles and favicons. Since no request was made, this is the only info - // we have about this page. This feature is used by web application clusters. - bool LoadingURLLazily() const; - const string16& GetLazyTitle() const; - const SkBitmap& GetLazyFavIcon() const; - // Returns the identifier used by session restore. const SessionID& session_id() const { return session_id_; } @@ -503,10 +490,6 @@ class NavigationController { // Whether we need to be reloaded when made active. bool needs_reload_; - // If true, the pending entry is lazy and should be loaded as soon as this - // controller becomes active. - bool load_pending_entry_when_active_; - // Unique identifier of this controller for session restore. This id is only // unique within the current session, and is not guaranteed to be unique // across sessions. diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index d86a9bf..b5b5111 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -472,8 +472,6 @@ const string16& TabContents::GetTitle() const { entry = controller_.GetLastCommittedEntry(); if (entry) return entry->GetTitleForDisplay(&controller_); - else if (controller_.LoadingURLLazily()) - return controller_.GetLazyTitle(); return EmptyString16(); } @@ -523,8 +521,6 @@ SkBitmap TabContents::GetFavIcon() const { entry = controller_.GetLastCommittedEntry(); if (entry) return entry->favicon().bitmap(); - else if (controller_.LoadingURLLazily()) - return controller_.GetLazyFavIcon(); return SkBitmap(); } |