diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-31 17:39:13 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-31 17:39:13 +0000 |
commit | 8286f51aaab9c769e70a1bcad5c568cec6636ba0 (patch) | |
tree | a741bc9016024ee0e092dfcbdc292a3d54c28c34 | |
parent | c8e2646cd5873468fe7497889c8b30da5f3cd2d4 (diff) | |
download | chromium_src-8286f51aaab9c769e70a1bcad5c568cec6636ba0.zip chromium_src-8286f51aaab9c769e70a1bcad5c568cec6636ba0.tar.gz chromium_src-8286f51aaab9c769e70a1bcad5c568cec6636ba0.tar.bz2 |
Factor load notification detail structs out of NavigationController and into
their own file in the |content| namespace. Remove un-necessary includes of
navigation_controller.h.
BUG=none
TEST=everything compiles
Review URL: http://codereview.chromium.org/7008018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87319 0039d316-1c4b-4281-b951-d872f2087c98
71 files changed, 303 insertions, 240 deletions
diff --git a/chrome/browser/alternate_nav_url_fetcher.h b/chrome/browser/alternate_nav_url_fetcher.h index 2531733..86a7af8d 100644 --- a/chrome/browser/alternate_nav_url_fetcher.h +++ b/chrome/browser/alternate_nav_url_fetcher.h @@ -8,10 +8,12 @@ #include <string> +#include "base/scoped_ptr.h" #include "chrome/browser/tab_contents/link_infobar_delegate.h" #include "chrome/common/net/url_fetcher.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" +#include "googleurl/src/gurl.h" class NavigationController; diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc index 49d16ae..79988bf 100644 --- a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc +++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc @@ -41,7 +41,7 @@ void AutofillCCInfoBarDelegate::LogUserAction( } bool AutofillCCInfoBarDelegate::ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const { + const content::LoadCommittedDetails& details) const { // The user has submitted a form, causing the page to navigate elsewhere. We // don't want the infobar to be expired at this point, because the user won't // get a chance to answer the question. diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.h b/chrome/browser/autofill/autofill_cc_infobar_delegate.h index 91be6f8..6d0b9e1 100644 --- a/chrome/browser/autofill/autofill_cc_infobar_delegate.h +++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.h @@ -12,13 +12,15 @@ #include "base/string16.h" #include "chrome/browser/autofill/autofill_metrics.h" #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" -#include "content/browser/tab_contents/navigation_controller.h" #include "webkit/glue/window_open_disposition.h" class CreditCard; class PersonalDataManager; class SkBitmap; class TabContents; +namespace content { +struct LoadCommittedDetails; +} // An InfoBar delegate that enables the user to allow or deny storing credit // card information gathered from a form submission. @@ -36,7 +38,7 @@ class AutofillCCInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual bool ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const OVERRIDE; + const content::LoadCommittedDetails& details) const OVERRIDE; virtual void InfoBarDismissed() OVERRIDE; virtual gfx::Image* GetIcon() const OVERRIDE; virtual Type GetInfoBarType() const OVERRIDE; diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc index d9dff1f..2bd3643 100644 --- a/chrome/browser/autofill/autofill_manager.cc +++ b/chrome/browser/autofill/autofill_manager.cc @@ -296,7 +296,7 @@ void AutofillManager::RegisterUserPrefs(PrefService* prefs) { } void AutofillManager::DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { Reset(); } diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h index ae62a90..314910e 100644 --- a/chrome/browser/autofill/autofill_manager.h +++ b/chrome/browser/autofill/autofill_manager.h @@ -20,7 +20,6 @@ #include "chrome/browser/autofill/autofill_download.h" #include "chrome/browser/autofill/field_types.h" #include "chrome/browser/autofill/form_structure.h" -#include "content/browser/tab_contents/navigation_controller.h" #include "content/browser/tab_contents/tab_contents_observer.h" class AutofillField; @@ -59,7 +58,7 @@ class AutofillManager : public TabContentsObserver, // TabContentsObserver implementation. virtual void DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params); virtual bool OnMessageReceived(const IPC::Message& message); diff --git a/chrome/browser/chrome_quota_permission_context.cc b/chrome/browser/chrome_quota_permission_context.cc index f5de89d..cb46017 100644 --- a/chrome/browser/chrome_quota_permission_context.cc +++ b/chrome/browser/chrome_quota_permission_context.cc @@ -14,7 +14,7 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/pref_names.h" #include "content/browser/browser_thread.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/tab_contents.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" @@ -54,7 +54,7 @@ class RequestQuotaInfoBarDelegate : public ConfirmInfoBarDelegate { } virtual bool ShouldExpire( - const NavigationController::LoadCommittedDetails& details) + const content::LoadCommittedDetails& details) const OVERRIDE { return false; } diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc index 7449a6d..287d3a9 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.cc +++ b/chrome/browser/content_settings/tab_specific_content_settings.cc @@ -20,6 +20,7 @@ #include "chrome/common/render_messages.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_delegate.h" #include "content/common/notification_service.h" @@ -395,7 +396,7 @@ void TabSpecificContentSettings::SetPopupsBlocked(bool blocked) { } void TabSpecificContentSettings::GeolocationDidNavigate( - const NavigationController::LoadCommittedDetails& details) { + const content::LoadCommittedDetails& details) { geolocation_settings_state_.DidNavigate(details); } @@ -423,7 +424,7 @@ bool TabSpecificContentSettings::OnMessageReceived( } void TabSpecificContentSettings::DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { if (!details.is_in_page) { // Clear "blocked" flags. diff --git a/chrome/browser/content_settings/tab_specific_content_settings.h b/chrome/browser/content_settings/tab_specific_content_settings.h index c90c8e5..d262b92 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.h +++ b/chrome/browser/content_settings/tab_specific_content_settings.h @@ -10,7 +10,6 @@ #include "chrome/browser/geolocation/geolocation_settings_state.h" #include "chrome/common/content_settings.h" #include "chrome/common/content_settings_types.h" -#include "content/browser/tab_contents/navigation_controller.h" #include "content/browser/tab_contents/tab_contents_observer.h" #include "content/common/dom_storage_common.h" #include "content/common/notification_observer.h" @@ -120,7 +119,7 @@ class TabSpecificContentSettings : public TabContentsObserver, // Updates Geolocation settings on navigation. void GeolocationDidNavigate( - const NavigationController::LoadCommittedDetails& details); + const content::LoadCommittedDetails& details); // Returns whether a particular kind of content has been blocked for this // page. @@ -158,7 +157,7 @@ class TabSpecificContentSettings : public TabContentsObserver, // TabContentsObserver overrides. virtual bool OnMessageReceived(const IPC::Message& message); virtual void DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; virtual void DidStartProvisionalLoadForFrame( int64 frame_id, diff --git a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc index 56fcc04..cb10e35 100644 --- a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc +++ b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc @@ -20,7 +20,7 @@ RegisterProtocolHandlerInfoBarDelegate::RegisterProtocolHandlerInfoBarDelegate( } bool RegisterProtocolHandlerInfoBarDelegate::ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const { + const content::LoadCommittedDetails& details) const { // The user has submitted a form, causing the page to navigate elsewhere. We // don't want the infobar to be expired at this point, because the user won't // get a chance to answer the question. diff --git a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.h b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.h index 855901b..9d7a688 100644 --- a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.h +++ b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.h @@ -22,7 +22,7 @@ class RegisterProtocolHandlerInfoBarDelegate : public ConfirmInfoBarDelegate { ProtocolHandler handler); // ConfirmInfoBarDelegate: - virtual bool ShouldExpire(const NavigationController::LoadCommittedDetails& + virtual bool ShouldExpire(const content::LoadCommittedDetails& details) const OVERRIDE; virtual Type GetInfoBarType() const OVERRIDE; virtual string16 GetMessageText() const OVERRIDE; diff --git a/chrome/browser/download/download_request_infobar_delegate_unittest.cc b/chrome/browser/download/download_request_infobar_delegate_unittest.cc index 5a8b251..85e0459 100644 --- a/chrome/browser/download/download_request_infobar_delegate_unittest.cc +++ b/chrome/browser/download/download_request_infobar_delegate_unittest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/scoped_ptr.h" #include "chrome/browser/download/download_request_infobar_delegate.h" #include "chrome/browser/download/download_request_limiter.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/extensions/extension_infobar_delegate.h b/chrome/browser/extensions/extension_infobar_delegate.h index 7f46e85..e7bb347 100644 --- a/chrome/browser/extensions/extension_infobar_delegate.h +++ b/chrome/browser/extensions/extension_infobar_delegate.h @@ -6,11 +6,15 @@ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_DELEGATE_H_ #pragma once +#include "base/scoped_ptr.h" #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" +#include "content/common/notification_observer.h" +#include "content/common/notification_registrar.h" class Browser; class Extension; class ExtensionHost; +class GURL; class TabContentsWrapper; // The InfobarDelegate for creating and managing state for the ExtensionInfobar diff --git a/chrome/browser/extensions/extension_tab_helper.cc b/chrome/browser/extensions/extension_tab_helper.cc index 8a1caa5..e927d19 100644 --- a/chrome/browser/extensions/extension_tab_helper.cc +++ b/chrome/browser/extensions/extension_tab_helper.cc @@ -15,8 +15,8 @@ #include "chrome/common/extensions/extension_messages.h" #include "chrome/common/extensions/extension_resource.h" #include "content/browser/renderer_host/render_widget_host_view.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/browser/tab_contents/navigation_controller.h" #include "content/common/notification_service.h" ExtensionTabHelper::ExtensionTabHelper(TabContentsWrapper* wrapper) @@ -80,7 +80,7 @@ SkBitmap* ExtensionTabHelper::GetExtensionAppIcon() { } void ExtensionTabHelper::DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { if (details.is_in_page) return; diff --git a/chrome/browser/extensions/extension_tab_helper.h b/chrome/browser/extensions/extension_tab_helper.h index 8a4b51e..9590e68 100644 --- a/chrome/browser/extensions/extension_tab_helper.h +++ b/chrome/browser/extensions/extension_tab_helper.h @@ -16,6 +16,10 @@ class Extension; class TabContentsWrapper; struct WebApplicationInfo; +namespace content { +struct LoadCommittedDetails; +} + // Per-tab extension helper. Also handles non-extension apps. class ExtensionTabHelper : public TabContentsObserver, public ExtensionFunctionDispatcher::Delegate, @@ -75,7 +79,7 @@ class ExtensionTabHelper : public TabContentsObserver, private: // TabContentsObserver overrides. virtual void DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message); diff --git a/chrome/browser/extensions/theme_installed_infobar_delegate.h b/chrome/browser/extensions/theme_installed_infobar_delegate.h index f31b957..9efa54a 100644 --- a/chrome/browser/extensions/theme_installed_infobar_delegate.h +++ b/chrome/browser/extensions/theme_installed_infobar_delegate.h @@ -7,10 +7,12 @@ #pragma once #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" +#include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" class ThemeService; class Extension; +class Profile; class SkBitmap; class TabContents; diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index db1e903..b235d2e 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -38,6 +38,7 @@ #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/provisional_load_details.h" #include "content/common/bindings_policy.h" #include "content/common/native_web_keyboard_event.h" @@ -368,7 +369,7 @@ void ExternalTabContainer::OpenURLFromTab(TabContents* source, params.page_id = -1; params.transition = PageTransition::LINK; - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; details.did_replace_entry = false; scoped_refptr<history::HistoryAddPageArgs> add_page_args( @@ -728,8 +729,8 @@ void ExternalTabContainer::Observe(NotificationType type, return; } - const NavigationController::LoadCommittedDetails* commit = - Details<NavigationController::LoadCommittedDetails>(details).ptr(); + const content::LoadCommittedDetails* commit = + Details<content::LoadCommittedDetails>(details).ptr(); if (commit->http_status_code >= kHttpClientErrorStart && commit->http_status_code <= kHttpServerErrorEnd) { diff --git a/chrome/browser/favicon/favicon_tab_helper.cc b/chrome/browser/favicon/favicon_tab_helper.cc index afd9b1c..2601984 100644 --- a/chrome/browser/favicon/favicon_tab_helper.cc +++ b/chrome/browser/favicon/favicon_tab_helper.cc @@ -9,6 +9,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/icon_messages.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/webui/web_ui.h" #include "ui/gfx/codec/png_codec.h" @@ -124,7 +125,7 @@ void FaviconTabHelper::NavigateToPendingEntry( } void FaviconTabHelper::DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { // Get the favicon, either from history or request it from the net. FetchFavicon(details.entry->url()); diff --git a/chrome/browser/favicon/favicon_tab_helper.h b/chrome/browser/favicon/favicon_tab_helper.h index a558848..ab555b9 100644 --- a/chrome/browser/favicon/favicon_tab_helper.h +++ b/chrome/browser/favicon/favicon_tab_helper.h @@ -76,7 +76,7 @@ class FaviconTabHelper : public TabContentsObserver { const GURL& url, NavigationController::ReloadType reload_type) OVERRIDE; virtual void DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; diff --git a/chrome/browser/geolocation/geolocation_settings_state.cc b/chrome/browser/geolocation/geolocation_settings_state.cc index 2e2fdfb..751904e 100644 --- a/chrome/browser/geolocation/geolocation_settings_state.cc +++ b/chrome/browser/geolocation/geolocation_settings_state.cc @@ -10,6 +10,7 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "net/base/net_util.h" @@ -27,7 +28,7 @@ void GeolocationSettingsState::OnGeolocationPermissionSet( } void GeolocationSettingsState::DidNavigate( - const NavigationController::LoadCommittedDetails& details) { + const content::LoadCommittedDetails& details) { if (details.entry) embedder_url_ = details.entry->url(); if (state_map_.empty()) diff --git a/chrome/browser/geolocation/geolocation_settings_state.h b/chrome/browser/geolocation/geolocation_settings_state.h index 5dadbaf..fd94f12 100644 --- a/chrome/browser/geolocation/geolocation_settings_state.h +++ b/chrome/browser/geolocation/geolocation_settings_state.h @@ -10,9 +10,14 @@ #include <set> #include "chrome/common/content_settings.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "googleurl/src/gurl.h" class GeolocationContentSettingsMap; +class Profile; + +namespace content { +struct LoadCommittedDetails; +} // This class manages the geolocation state per tab, and provides information // and presentation data about the geolocation usage. @@ -31,7 +36,7 @@ class GeolocationSettingsState { // Delegated by TabContents to indicate a navigation has happened and we // may need to clear our settings. - void DidNavigate(const NavigationController::LoadCommittedDetails& details); + void DidNavigate(const content::LoadCommittedDetails& details); void ClearStateMap(); diff --git a/chrome/browser/geolocation/geolocation_settings_state_unittest.cc b/chrome/browser/geolocation/geolocation_settings_state_unittest.cc index 14baeb4..f7c5e7b 100644 --- a/chrome/browser/geolocation/geolocation_settings_state_unittest.cc +++ b/chrome/browser/geolocation/geolocation_settings_state_unittest.cc @@ -6,6 +6,7 @@ #include "chrome/browser/geolocation/geolocation_settings_state.h" #include "chrome/test/testing_profile.h" #include "content/browser/browser_thread.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "testing/gtest/include/gtest/gtest.h" @@ -29,7 +30,7 @@ TEST_F(GeolocationSettingsStateTests, ClearOnNewOrigin) { NavigationEntry entry; entry.set_url(url_0); - NavigationController::LoadCommittedDetails load_committed_details; + content::LoadCommittedDetails load_committed_details; load_committed_details.entry = &entry; state.DidNavigate(load_committed_details); @@ -126,7 +127,7 @@ TEST_F(GeolocationSettingsStateTests, ShowPortOnSameHost) { NavigationEntry entry; entry.set_url(url_0); - NavigationController::LoadCommittedDetails load_committed_details; + content::LoadCommittedDetails load_committed_details; load_committed_details.entry = &entry; state.DidNavigate(load_committed_details); diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc index 25963ea..dcb46fe 100644 --- a/chrome/browser/history/history_tab_helper.cc +++ b/chrome/browser/history/history_tab_helper.cc @@ -8,7 +8,7 @@ #include "chrome/browser/history/top_sites.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/render_messages.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_delegate.h" @@ -42,7 +42,7 @@ void HistoryTabHelper::UpdateHistoryPageTitle(const NavigationEntry& entry) { scoped_refptr<history::HistoryAddPageArgs> HistoryTabHelper::CreateHistoryAddPageArgs( const GURL& virtual_url, - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { scoped_refptr<history::HistoryAddPageArgs> add_page_args( new history::HistoryAddPageArgs( @@ -76,14 +76,14 @@ bool HistoryTabHelper::OnMessageReceived(const IPC::Message& message) { } void HistoryTabHelper::DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { // Allow the new page to set the title again. received_page_title_ = false; } void HistoryTabHelper::DidNavigateAnyFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { // Update history. Note that this needs to happen after the entry is complete, // which WillNavigate[Main,Sub]Frame will do before this function is called. diff --git a/chrome/browser/history/history_tab_helper.h b/chrome/browser/history/history_tab_helper.h index 90abd24..80bdec6 100644 --- a/chrome/browser/history/history_tab_helper.h +++ b/chrome/browser/history/history_tab_helper.h @@ -37,17 +37,17 @@ class HistoryTabHelper : public TabContentsObserver, // history. scoped_refptr<history::HistoryAddPageArgs> CreateHistoryAddPageArgs( const GURL& virtual_url, - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params); private: // TabContentsObserver implementation. virtual bool OnMessageReceived(const IPC::Message& message); virtual void DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params); virtual void DidNavigateAnyFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params); // NotificationObserver implementation. diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc index 483b021..b625e65 100644 --- a/chrome/browser/history/top_sites.cc +++ b/chrome/browser/history/top_sites.cc @@ -26,7 +26,7 @@ #include "chrome/common/pref_names.h" #include "chrome/common/thumbnail_score.h" #include "content/browser/browser_thread.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/common/notification_service.h" #include "grit/chromium_strings.h" @@ -817,8 +817,8 @@ void TopSites::Observe(NotificationType type, StartQueryForMostVisited(); } else if (type == NotificationType::NAV_ENTRY_COMMITTED) { if (!IsFull()) { - NavigationController::LoadCommittedDetails* load_details = - Details<NavigationController::LoadCommittedDetails>(details).ptr(); + content::LoadCommittedDetails* load_details = + Details<content::LoadCommittedDetails>(details).ptr(); if (!load_details) return; const GURL& url = load_details->entry->url(); diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc index 1c7a874..3972777 100644 --- a/chrome/browser/instant/instant_loader.cc +++ b/chrome/browser/instant/instant_loader.cc @@ -31,7 +31,7 @@ #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host.h" #include "content/browser/renderer_host/render_widget_host_view.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/provisional_load_details.h" #include "content/browser/tab_contents/tab_contents.h" @@ -940,8 +940,8 @@ void InstantLoader::Observe(NotificationType type, } #endif if (type.value == NotificationType::NAV_ENTRY_COMMITTED) { - NavigationController::LoadCommittedDetails* load_details = - Details<NavigationController::LoadCommittedDetails>(details).ptr(); + content::LoadCommittedDetails* load_details = + Details<content::LoadCommittedDetails>(details).ptr(); if (load_details->is_main_frame) { if (load_details->http_status_code == kHostBlacklistStatusCode) { delegate_->AddToBlacklist(this, load_details->entry->url()); diff --git a/chrome/browser/omnibox_search_hint.cc b/chrome/browser/omnibox_search_hint.cc index 6121dc60..102d9c4 100644 --- a/chrome/browser/omnibox_search_hint.cc +++ b/chrome/browser/omnibox_search_hint.cc @@ -24,6 +24,7 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" #include "content/common/notification_type.h" @@ -56,7 +57,7 @@ class HintInfoBar : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual bool ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const OVERRIDE; + const content::LoadCommittedDetails& details) const OVERRIDE; virtual void InfoBarDismissed() OVERRIDE; virtual gfx::Image* GetIcon() const OVERRIDE; virtual Type GetInfoBarType() const OVERRIDE; @@ -99,7 +100,7 @@ HintInfoBar::~HintInfoBar() { } bool HintInfoBar::ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const { + const content::LoadCommittedDetails& details) const { return details.is_user_initiated_main_frame_load() && should_expire_; } diff --git a/chrome/browser/password_manager/password_manager.cc b/chrome/browser/password_manager/password_manager.cc index b08330fd..9f98545 100644 --- a/chrome/browser/password_manager/password_manager.cc +++ b/chrome/browser/password_manager/password_manager.cc @@ -158,7 +158,7 @@ void PasswordManager::DidStopLoading() { } void PasswordManager::DidNavigateAnyFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { if (params.password_form.origin.is_valid()) ProvisionallySavePassword(params.password_form); diff --git a/chrome/browser/password_manager/password_manager.h b/chrome/browser/password_manager/password_manager.h index a412bb6..ce94a54 100644 --- a/chrome/browser/password_manager/password_manager.h +++ b/chrome/browser/password_manager/password_manager.h @@ -52,7 +52,7 @@ class PasswordManager : public LoginModel, // TabContentsObserver overrides. virtual void DidStopLoading(); virtual void DidNavigateAnyFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params); virtual bool OnMessageReceived(const IPC::Message& message); diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc index a69285f..6127443 100644 --- a/chrome/browser/printing/print_preview_tab_controller.cc +++ b/chrome/browser/printing/print_preview_tab_controller.cc @@ -12,6 +12,7 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/webui/print_preview_ui.h" #include "chrome/common/url_constants.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" @@ -77,7 +78,7 @@ void PrintPreviewTabController::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { TabContents* source_tab = NULL; - NavigationController::LoadCommittedDetails* detail_info = NULL; + content::LoadCommittedDetails* detail_info = NULL; switch (type.value) { case NotificationType::TAB_CONTENTS_DESTROYED: { @@ -88,8 +89,7 @@ void PrintPreviewTabController::Observe(NotificationType type, NavigationController* controller = Source<NavigationController>(source).ptr(); source_tab = controller->tab_contents(); - detail_info = - Details<NavigationController::LoadCommittedDetails>(details).ptr(); + detail_info = Details<content::LoadCommittedDetails>(details).ptr(); break; } default: { diff --git a/chrome/browser/safe_browsing/client_side_detection_host.cc b/chrome/browser/safe_browsing/client_side_detection_host.cc index 3979cf0..88e17f2 100644 --- a/chrome/browser/safe_browsing/client_side_detection_host.cc +++ b/chrome/browser/safe_browsing/client_side_detection_host.cc @@ -23,7 +23,7 @@ #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_service.h" #include "content/common/notification_type.h" @@ -289,7 +289,7 @@ bool ClientSideDetectionHost::OnMessageReceived(const IPC::Message& message) { } void ClientSideDetectionHost::DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { // TODO(noelutz): move this DCHECK to TabContents and fix all the unit tests // that don't call this method on the UI thread. diff --git a/chrome/browser/safe_browsing/client_side_detection_host.h b/chrome/browser/safe_browsing/client_side_detection_host.h index 068e254..d229310 100644 --- a/chrome/browser/safe_browsing/client_side_detection_host.h +++ b/chrome/browser/safe_browsing/client_side_detection_host.h @@ -39,7 +39,7 @@ class ClientSideDetectionHost : public TabContentsObserver { // callbacks that could show an interstitial, and check to see whether // we should classify the new URL. virtual void DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params); private: diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc index 2977357..506f86b 100644 --- a/chrome/browser/sessions/session_service.cc +++ b/chrome/browser/sessions/session_service.cc @@ -28,7 +28,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/extensions/extension.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_details.h" @@ -547,7 +547,7 @@ void SessionService::Observe(NotificationType type, case NotificationType::NAV_LIST_PRUNED: { NavigationController* controller = Source<NavigationController>(source).ptr(); - Details<NavigationController::PrunedDetails> pruned_details(details); + Details<content::PrunedDetails> pruned_details(details); if (pruned_details->from_front) { TabNavigationPathPrunedFromFront(controller->window_id(), controller->session_id(), @@ -565,7 +565,7 @@ void SessionService::Observe(NotificationType type, case NotificationType::NAV_ENTRY_CHANGED: { NavigationController* controller = Source<NavigationController>(source).ptr(); - Details<NavigationController::EntryChangedDetails> changed(details); + Details<content::EntryChangedDetails> changed(details); UpdateTabNavigation(controller->window_id(), controller->session_id(), changed->index, *changed->changed_entry); break; @@ -581,7 +581,7 @@ void SessionService::Observe(NotificationType type, UpdateTabNavigation(controller->window_id(), controller->session_id(), current_entry_index, *controller->GetEntryAtIndex(current_entry_index)); - Details<NavigationController::LoadCommittedDetails> changed(details); + Details<content::LoadCommittedDetails> changed(details); if (changed->type == NavigationType::NEW_PAGE || changed->type == NavigationType::EXISTING_PAGE) { RecordSessionUpdateHistogramData(NotificationType::NAV_ENTRY_COMMITTED, diff --git a/chrome/browser/ssl/ssl_manager.cc b/chrome/browser/ssl/ssl_manager.cc index c6e7797..90a34c0 100644 --- a/chrome/browser/ssl/ssl_manager.cc +++ b/chrome/browser/ssl/ssl_manager.cc @@ -13,7 +13,7 @@ #include "content/browser/renderer_host/resource_dispatcher_host.h" #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" #include "content/browser/renderer_host/resource_request_details.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/provisional_load_details.h" #include "content/browser/tab_contents/tab_contents.h" @@ -131,8 +131,8 @@ SSLManager::~SSLManager() { void SSLManager::DidCommitProvisionalLoad( const NotificationDetails& in_details) { - NavigationController::LoadCommittedDetails* details = - Details<NavigationController::LoadCommittedDetails>(in_details).ptr(); + content::LoadCommittedDetails* details = + Details<content::LoadCommittedDetails>(in_details).ptr(); NavigationEntry* entry = controller_->GetActiveEntry(); diff --git a/chrome/browser/tab_contents/infobar.cc b/chrome/browser/tab_contents/infobar.cc index 16d0fe7..540fffd 100644 --- a/chrome/browser/tab_contents/infobar.cc +++ b/chrome/browser/tab_contents/infobar.cc @@ -8,6 +8,7 @@ #include <cmath> +#include "base/logging.h" #include "chrome/browser/tab_contents/infobar_container.h" #include "chrome/browser/tab_contents/infobar_delegate.h" #include "ui/base/animation/slide_animation.h" diff --git a/chrome/browser/tab_contents/infobar_delegate.cc b/chrome/browser/tab_contents/infobar_delegate.cc index d17bc11..85f005a 100644 --- a/chrome/browser/tab_contents/infobar_delegate.cc +++ b/chrome/browser/tab_contents/infobar_delegate.cc @@ -6,7 +6,7 @@ #include "base/logging.h" #include "build/build_config.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" @@ -20,7 +20,7 @@ bool InfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { } bool InfoBarDelegate::ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const { + const content::LoadCommittedDetails& details) const { // Only hide InfoBars when the user has done something that makes the main // frame load. We don't want various automatic or subframe navigations making // it disappear. @@ -31,7 +31,7 @@ bool InfoBarDelegate::ShouldExpire( } bool InfoBarDelegate::ShouldExpireInternal( - const NavigationController::LoadCommittedDetails& details) const { + const content::LoadCommittedDetails& details) const { return (contents_unique_id_ != details.entry->unique_id()) || (PageTransition::StripQualifier(details.entry->transition_type()) == PageTransition::RELOAD); diff --git a/chrome/browser/tab_contents/infobar_delegate.h b/chrome/browser/tab_contents/infobar_delegate.h index 88e183f3b..5457b81 100644 --- a/chrome/browser/tab_contents/infobar_delegate.h +++ b/chrome/browser/tab_contents/infobar_delegate.h @@ -8,7 +8,6 @@ #include "base/basictypes.h" #include "base/string16.h" -#include "content/browser/tab_contents/navigation_controller.h" #include "webkit/glue/window_open_disposition.h" class ConfirmInfoBarDelegate; @@ -24,6 +23,9 @@ class TranslateInfoBarDelegate; namespace gfx { class Image; } +namespace content { +struct LoadCommittedDetails; +} // An interface implemented by objects wishing to control an InfoBar. // Implementing this interface is not sufficient to use an InfoBar, since it @@ -57,7 +59,7 @@ class InfoBarDelegate { // is navigated. The default behavior is to return true if the user initiated // navigation somewhere else or reloaded. virtual bool ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const; + const content::LoadCommittedDetails& details) const; // Called when the user clicks on the close button to dismiss the infobar. virtual void InfoBarDismissed(); @@ -95,7 +97,7 @@ class InfoBarDelegate { // Returns true if the navigation is to a new URL or a reload occured. bool ShouldExpireInternal( - const NavigationController::LoadCommittedDetails& details) const; + const content::LoadCommittedDetails& details) const; private: // The unique id of the active NavigationEntry of the TabContents that we were diff --git a/chrome/browser/tab_contents/language_state.cc b/chrome/browser/tab_contents/language_state.cc index baf1bdd..834bb5d 100644 --- a/chrome/browser/tab_contents/language_state.cc +++ b/chrome/browser/tab_contents/language_state.cc @@ -4,7 +4,7 @@ #include "chrome/browser/tab_contents/language_state.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" LanguageState::LanguageState(NavigationController* nav_controller) @@ -19,7 +19,7 @@ LanguageState::~LanguageState() { } void LanguageState::DidNavigate( - const NavigationController::LoadCommittedDetails& details) { + const content::LoadCommittedDetails& details) { in_page_navigation_ = details.is_in_page; if (in_page_navigation_ || !details.is_main_frame) return; // Don't reset our states, the page has not changed. diff --git a/chrome/browser/tab_contents/language_state.h b/chrome/browser/tab_contents/language_state.h index b9f4d33..1335b58 100644 --- a/chrome/browser/tab_contents/language_state.h +++ b/chrome/browser/tab_contents/language_state.h @@ -27,7 +27,7 @@ class LanguageState { // Should be called when the page did a new navigation (whether it is a main // frame or sub-frame navigation). - void DidNavigate(const NavigationController::LoadCommittedDetails& details); + void DidNavigate(const content::LoadCommittedDetails& details); // Should be called when the language of the page has been determined. // |page_translatable| when false indicates that the browser should not offer diff --git a/chrome/browser/tab_contents/simple_alert_infobar_delegate.cc b/chrome/browser/tab_contents/simple_alert_infobar_delegate.cc index da52690..e51935a 100644 --- a/chrome/browser/tab_contents/simple_alert_infobar_delegate.cc +++ b/chrome/browser/tab_contents/simple_alert_infobar_delegate.cc @@ -5,7 +5,6 @@ #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h" #include "content/browser/tab_contents/tab_contents.h" -#include "content/browser/tab_contents/navigation_controller.h" #include "third_party/skia/include/core/SkBitmap.h" SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate( @@ -23,7 +22,7 @@ SimpleAlertInfoBarDelegate::~SimpleAlertInfoBarDelegate() { } bool SimpleAlertInfoBarDelegate::ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const { + const content::LoadCommittedDetails& details) const { return auto_expire_ && ConfirmInfoBarDelegate::ShouldExpire(details); } diff --git a/chrome/browser/tab_contents/simple_alert_infobar_delegate.h b/chrome/browser/tab_contents/simple_alert_infobar_delegate.h index 1e30125..55cda91 100644 --- a/chrome/browser/tab_contents/simple_alert_infobar_delegate.h +++ b/chrome/browser/tab_contents/simple_alert_infobar_delegate.h @@ -26,7 +26,7 @@ class SimpleAlertInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual bool ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const OVERRIDE; + const content::LoadCommittedDetails& details) const OVERRIDE; virtual gfx::Image* GetIcon() const OVERRIDE; virtual string16 GetMessageText() const OVERRIDE; virtual int GetButtons() const OVERRIDE; diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index f4d4bc5..4830397 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -18,7 +18,7 @@ #include "content/browser/renderer_host/test_render_view_host.h" #include "content/browser/site_instance.h" #include "content/browser/tab_contents/constrained_window.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/test_tab_contents.h" #include "content/common/bindings_policy.h" @@ -217,7 +217,7 @@ TEST_F(TabContentsTest, UpdateTitle) { InitNavigateParams(¶ms, 0, GURL(chrome::kAboutBlankURL), PageTransition::TYPED); - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; controller().RendererDidNavigate(params, 0, &details); contents()->UpdateTitle(rvh(), 0, L" Lots O' Whitespace\n"); @@ -239,7 +239,7 @@ TEST_F(TabContentsTest, NTPViewSource) { ViewHostMsg_FrameNavigate_Params params; InitNavigateParams(¶ms, 0, kGURL, PageTransition::TYPED); - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; controller().RendererDidNavigate(params, 0, &details); // Also check title and url. EXPECT_EQ(ASCIIToUTF16(kUrl), contents()->GetTitle()); diff --git a/chrome/browser/tabs/tab_finder.cc b/chrome/browser/tabs/tab_finder.cc index 448455b..5a2551d 100644 --- a/chrome/browser/tabs/tab_finder.cc +++ b/chrome/browser/tabs/tab_finder.cc @@ -11,6 +11,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/common/chrome_switches.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_observer.h" @@ -29,7 +30,7 @@ class TabFinder::TabContentsObserverImpl : public TabContentsObserver { // TabContentsObserver overrides: virtual void DidNavigateAnyFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE; @@ -50,7 +51,7 @@ TabFinder::TabContentsObserverImpl::~TabContentsObserverImpl() { } void TabFinder::TabContentsObserverImpl::DidNavigateAnyFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { finder_->DidNavigateAnyFramePostCommit(tab_contents(), details, params); } @@ -136,7 +137,7 @@ void TabFinder::Init() { void TabFinder::DidNavigateAnyFramePostCommit( TabContents* source, - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { CancelRequestsFor(source); diff --git a/chrome/browser/tabs/tab_finder.h b/chrome/browser/tabs/tab_finder.h index 283e60f..9106eba 100644 --- a/chrome/browser/tabs/tab_finder.h +++ b/chrome/browser/tabs/tab_finder.h @@ -13,13 +13,17 @@ #include "base/memory/singleton.h" #include "chrome/browser/history/history_types.h" #include "content/browser/cancelable_request.h" -#include "content/browser/tab_contents/navigation_controller.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" class Browser; class GURL; class TabContents; +struct ViewHostMsg_FrameNavigate_Params; + +namespace content { +struct LoadCommittedDetails; +} // TabFinder is used to locate a tab by URL. TabFinder matches tabs based // on the tabs current url, or the start of the redirect chain. @@ -62,7 +66,7 @@ class TabFinder : public NotificationObserver { // Forwarded from TabContentsObserverImpl. void DidNavigateAnyFramePostCommit( TabContents* source, - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params); // Returns true if the tab's current url is |url|, or the start of the diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/chrome/browser/translate/translate_infobar_delegate.cc index 76e6a4b..ee69b0f 100644 --- a/chrome/browser/translate/translate_infobar_delegate.cc +++ b/chrome/browser/translate/translate_infobar_delegate.cc @@ -14,6 +14,7 @@ #include "chrome/browser/translate/translate_tab_helper.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/chrome_constants.h" +#include "content/browser/tab_contents/navigation_details.h" #include "grit/generated_resources.h" #include "grit/theme_resources_standard.h" #include "ui/base/l10n/l10n_util.h" @@ -354,7 +355,7 @@ TranslateInfoBarDelegate::TranslateInfoBarDelegate( } bool TranslateInfoBarDelegate::ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const { + const content::LoadCommittedDetails& details) const { // Note: we allow closing this infobar even if the main frame navigation // was programmatic and not initiated by the user - crbug.com/70261 . if (!details.is_user_initiated_main_frame_load() && !details.is_main_frame) diff --git a/chrome/browser/translate/translate_infobar_delegate.h b/chrome/browser/translate/translate_infobar_delegate.h index ab63712..c94893c 100644 --- a/chrome/browser/translate/translate_infobar_delegate.h +++ b/chrome/browser/translate/translate_infobar_delegate.h @@ -9,6 +9,7 @@ #include <string> #include <vector> +#include "base/compiler_specific.h" #include "chrome/browser/tab_contents/infobar_delegate.h" #include "chrome/browser/translate/translate_prefs.h" #include "chrome/common/translate_errors.h" @@ -164,7 +165,7 @@ class TranslateInfoBarDelegate : public InfoBarDelegate { virtual gfx::Image* GetIcon() const OVERRIDE; virtual InfoBarDelegate::Type GetInfoBarType() const OVERRIDE; virtual bool ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const; + const content::LoadCommittedDetails& details) const; virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate() OVERRIDE; // Gets the host of the page being translated, or an empty string if no URL is diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index 2ccba27..1e72f97 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -31,7 +31,7 @@ #include "chrome/common/url_constants.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_details.h" @@ -202,8 +202,8 @@ void TranslateManager::Observe(NotificationType type, case NotificationType::NAV_ENTRY_COMMITTED: { NavigationController* controller = Source<NavigationController>(source).ptr(); - NavigationController::LoadCommittedDetails* load_details = - Details<NavigationController::LoadCommittedDetails>(details).ptr(); + content::LoadCommittedDetails* load_details = + Details<content::LoadCommittedDetails>(details).ptr(); NavigationEntry* entry = controller->GetActiveEntry(); if (!entry) { NOTREACHED(); diff --git a/chrome/browser/translate/translate_manager_browsertest.cc b/chrome/browser/translate/translate_manager_browsertest.cc index e6da867..20467cd 100644 --- a/chrome/browser/translate/translate_manager_browsertest.cc +++ b/chrome/browser/translate/translate_manager_browsertest.cc @@ -23,7 +23,7 @@ #include "content/browser/browser_thread.h" #include "content/browser/renderer_host/mock_render_process_host.h" #include "content/browser/renderer_host/test_render_view_host.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/test_tab_contents.h" #include "content/common/notification_details.h" #include "content/common/notification_observer_mock.h" @@ -224,16 +224,16 @@ class NavEntryCommittedObserver : public NotificationObserver { const NotificationDetails& details) { DCHECK(type == NotificationType::NAV_ENTRY_COMMITTED); details_ = - *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); + *(Details<content::LoadCommittedDetails>(details).ptr()); } - const NavigationController::LoadCommittedDetails& + const content::LoadCommittedDetails& get_load_commited_details() const { return details_; } private: - NavigationController::LoadCommittedDetails details_; + content::LoadCommittedDetails details_; NotificationRegistrar registrar_; DISALLOW_COPY_AND_ASSIGN(NavEntryCommittedObserver); @@ -573,7 +573,7 @@ TEST_F(TranslateManagerTest, Reload) { Reload(); // Ensures it is really handled a reload. - const NavigationController::LoadCommittedDetails& nav_details = + const content::LoadCommittedDetails& nav_details = nav_observer.get_load_commited_details(); EXPECT_TRUE(nav_details.entry != NULL); // There was a navigation. EXPECT_EQ(NavigationType::EXISTING_PAGE, nav_details.type); @@ -603,7 +603,7 @@ TEST_F(TranslateManagerTest, ReloadFromLocationBar) { // Test that we are really getting a same page navigation, the test would be // useless if it was not the case. - const NavigationController::LoadCommittedDetails& nav_details = + const content::LoadCommittedDetails& nav_details = nav_observer.get_load_commited_details(); EXPECT_TRUE(nav_details.entry != NULL); // There was a navigation. EXPECT_EQ(NavigationType::SAME_PAGE, nav_details.type); diff --git a/chrome/browser/translate/translate_tab_helper.cc b/chrome/browser/translate/translate_tab_helper.cc index d7ec4fc..dd162b4 100644 --- a/chrome/browser/translate/translate_tab_helper.cc +++ b/chrome/browser/translate/translate_tab_helper.cc @@ -30,7 +30,7 @@ bool TranslateTabHelper::OnMessageReceived(const IPC::Message& message) { } void TranslateTabHelper::DidNavigateAnyFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { // Let the LanguageState clear its state. language_state_.DidNavigate(details); diff --git a/chrome/browser/translate/translate_tab_helper.h b/chrome/browser/translate/translate_tab_helper.h index 58ceba0..4c8aea2 100644 --- a/chrome/browser/translate/translate_tab_helper.h +++ b/chrome/browser/translate/translate_tab_helper.h @@ -21,7 +21,7 @@ class TranslateTabHelper : public TabContentsObserver { // TabContentsObserver implementation. virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; virtual void DidNavigateAnyFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; void OnLanguageDetermined(const std::string& language, diff --git a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc index 6cf4a6d..f0d73ef0 100644 --- a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc +++ b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc @@ -11,6 +11,7 @@ #include "chrome/browser/ui/blocked_content/blocked_content_container.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "content/browser/renderer_host/render_view_host.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_service.h" @@ -26,7 +27,7 @@ BlockedContentTabHelper::~BlockedContentTabHelper() { } void BlockedContentTabHelper::DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { // Clear all page actions, blocked content notifications and browser actions // for this tab, unless this is an in-page navigation. diff --git a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.h b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.h index 10f7615..321d74a 100644 --- a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.h +++ b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.h @@ -57,7 +57,7 @@ class BlockedContentTabHelper : public TabContentsObserver { // TabContentsObserver overrides: virtual void DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; private: diff --git a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc index 7e3b5e4..01582b0 100644 --- a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc +++ b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc @@ -28,7 +28,7 @@ BookmarkTabHelper::~BookmarkTabHelper() { } void BookmarkTabHelper::DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& /*details*/, + const content::LoadCommittedDetails& /*details*/, const ViewHostMsg_FrameNavigate_Params& /*params*/) { UpdateStarredStateForCurrentURL(); } diff --git a/chrome/browser/ui/bookmarks/bookmark_tab_helper.h b/chrome/browser/ui/bookmarks/bookmark_tab_helper.h index 6e82c9e..a39e493 100644 --- a/chrome/browser/ui/bookmarks/bookmark_tab_helper.h +++ b/chrome/browser/ui/bookmarks/bookmark_tab_helper.h @@ -27,7 +27,7 @@ class BookmarkTabHelper : public NotificationObserver, // TabContentsObserver overrides: virtual void DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; // NotificationObserver overrides: diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc index d29f756..ec1c083 100644 --- a/chrome/browser/ui/browser_init.cc +++ b/chrome/browser/ui/browser_init.cc @@ -62,7 +62,7 @@ #include "content/browser/browser_thread.h" #include "content/browser/child_process_security_policy.h" #include "content/browser/renderer_host/render_process_host.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/tab_contents_view.h" #include "content/common/result_codes.h" #include "grit/chromium_strings.h" @@ -142,7 +142,7 @@ class DefaultBrowserInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual bool ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const OVERRIDE; + const content::LoadCommittedDetails& details) const OVERRIDE; virtual gfx::Image* GetIcon() const OVERRIDE; virtual string16 GetMessageText() const OVERRIDE; virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; @@ -185,7 +185,7 @@ DefaultBrowserInfoBarDelegate::~DefaultBrowserInfoBarDelegate() { } bool DefaultBrowserInfoBarDelegate::ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const { + const content::LoadCommittedDetails& details) const { return details.is_user_initiated_main_frame_load() && should_expire_; } diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc index 2b7998c..b5352d3 100644 --- a/chrome/browser/ui/browser_list.cc +++ b/chrome/browser/ui/browser_list.cc @@ -14,7 +14,7 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/browser_window.h" #include "content/browser/renderer_host/render_process_host.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/common/notification_registrar.h" #include "content/common/notification_service.h" #include "content/common/result_codes.h" @@ -50,8 +50,8 @@ class BrowserActivityObserver : public NotificationObserver { const NotificationSource& source, const NotificationDetails& details) { DCHECK(type == NotificationType::NAV_ENTRY_COMMITTED); - const NavigationController::LoadCommittedDetails& load = - *Details<NavigationController::LoadCommittedDetails>(details).ptr(); + const content::LoadCommittedDetails& load = + *Details<content::LoadCommittedDetails>(details).ptr(); if (!load.is_main_frame || load.is_auto || load.is_in_page) return; // Don't log for subframes or other trivial types. diff --git a/chrome/browser/ui/cocoa/keystone_infobar.mm b/chrome/browser/ui/cocoa/keystone_infobar.mm index b51c622..bb49f27 100644 --- a/chrome/browser/ui/cocoa/keystone_infobar.mm +++ b/chrome/browser/ui/cocoa/keystone_infobar.mm @@ -21,7 +21,7 @@ #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -47,7 +47,7 @@ class KeystonePromotionInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate virtual bool ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const OVERRIDE; + const content::LoadCommittedDetails& details) const OVERRIDE; virtual gfx::Image* GetIcon() const OVERRIDE; virtual string16 GetMessageText() const OVERRIDE; virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; @@ -83,7 +83,7 @@ KeystonePromotionInfoBarDelegate::~KeystonePromotionInfoBarDelegate() { } bool KeystonePromotionInfoBarDelegate::ShouldExpire( - const NavigationController::LoadCommittedDetails& details) const { + const content::LoadCommittedDetails& details) const { return details.is_user_initiated_main_frame_load() && can_expire_; } diff --git a/chrome/browser/ui/find_bar/find_bar_controller.cc b/chrome/browser/ui/find_bar/find_bar_controller.cc index ec65f97..d63d688 100644 --- a/chrome/browser/ui/find_bar/find_bar_controller.cc +++ b/chrome/browser/ui/find_bar/find_bar_controller.cc @@ -12,6 +12,7 @@ #include "chrome/browser/ui/find_bar/find_bar_state.h" #include "chrome/browser/ui/find_bar/find_tab_helper.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" @@ -126,8 +127,8 @@ void FindBarController::Observe(NotificationType type, NavigationController* source_controller = Source<NavigationController>(source).ptr(); if (source_controller == &tab_contents_->controller()) { - NavigationController::LoadCommittedDetails* commit_details = - Details<NavigationController::LoadCommittedDetails>(details).ptr(); + content::LoadCommittedDetails* commit_details = + Details<content::LoadCommittedDetails>(details).ptr(); PageTransition::Type transition_type = commit_details->entry->transition_type(); // We hide the FindInPage window when the user navigates away, except on diff --git a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc index 99dbc96..64a6ac8 100644 --- a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc +++ b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc @@ -32,7 +32,7 @@ SearchEngineTabHelper::~SearchEngineTabHelper() { } void SearchEngineTabHelper::DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& /*details*/, + const content::LoadCommittedDetails& /*details*/, const ViewHostMsg_FrameNavigate_Params& params) { GenerateKeywordIfNecessary(params); } diff --git a/chrome/browser/ui/search_engines/search_engine_tab_helper.h b/chrome/browser/ui/search_engines/search_engine_tab_helper.h index 7e1d9c8..1b863d5 100644 --- a/chrome/browser/ui/search_engines/search_engine_tab_helper.h +++ b/chrome/browser/ui/search_engines/search_engine_tab_helper.h @@ -26,7 +26,7 @@ class SearchEngineTabHelper : public TabContentsObserver { // TabContentsObserver overrides. virtual void DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc index 6dbb9b5..9ed4b89 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc @@ -48,6 +48,7 @@ #include "chrome/common/render_messages.h" #include "content/browser/child_process_security_policy.h" #include "content/browser/renderer_host/render_view_host.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_service.h" #include "content/common/view_messages.h" @@ -382,8 +383,8 @@ void TabContentsWrapper::Observe(NotificationType type, DCHECK(&tab_contents_->controller() == Source<NavigationController>(source).ptr()); - NavigationController::LoadCommittedDetails& committed_details = - *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); + content::LoadCommittedDetails& committed_details = + *(Details<content::LoadCommittedDetails>(details).ptr()); // NOTE: It is not safe to change the following code to count upwards or // use iterators, as the RemoveInfoBar() call synchronously modifies our diff --git a/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc b/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc index b1625e0..67852a4 100644 --- a/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc +++ b/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc @@ -5,7 +5,7 @@ #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "chrome/common/url_constants.h" -#include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/common/notification_registrar.h" #include "content/common/notification_service.h" #include "content/common/notification_source.h" @@ -27,7 +27,7 @@ class NavigationNotificationObserver : public NotificationObserver { DCHECK_EQ(NotificationType::NAV_ENTRY_COMMITTED, type.value); got_navigation_ = true; http_status_code_ = - Details<NavigationController::LoadCommittedDetails>(details)-> + Details<content::LoadCommittedDetails>(details)-> http_status_code; } diff --git a/content/browser/renderer_host/render_view_host_browsertest.cc b/content/browser/renderer_host/render_view_host_browsertest.cc index 2146acd..2b46ab8 100644 --- a/content/browser/renderer_host/render_view_host_browsertest.cc +++ b/content/browser/renderer_host/render_view_host_browsertest.cc @@ -213,7 +213,7 @@ class RenderViewHostTestTabContentsObserver : public TabContentsObserver { virtual ~RenderViewHostTestTabContentsObserver() {} virtual void DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { observed_socket_address_ = params.socket_address; ++navigation_count_; diff --git a/content/browser/tab_contents/navigation_controller.cc b/content/browser/tab_contents/navigation_controller.cc index 564203f..324d6e0 100644 --- a/content/browser/tab_contents/navigation_controller.cc +++ b/content/browser/tab_contents/navigation_controller.cc @@ -18,6 +18,7 @@ #include "content/browser/in_process_webkit/session_storage_namespace.h" #include "content/browser/site_instance.h" #include "content/browser/tab_contents/interstitial_page.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_delegate.h" @@ -42,13 +43,13 @@ const int kInvalidateAllButShelves = void NotifyPrunedEntries(NavigationController* nav_controller, bool from_front, int count) { - NavigationController::PrunedDetails details; + content::PrunedDetails details; details.from_front = from_front; details.count = count; NotificationService::current()->Notify( NotificationType::NAV_LIST_PRUNED, Source<NavigationController>(nav_controller), - Details<NavigationController::PrunedDetails>(&details)); + Details<content::PrunedDetails>(&details)); } // Ensure the given NavigationEntry has a valid state, so that WebKit does not @@ -499,7 +500,7 @@ void NavigationController::DocumentLoadedInFrame() { bool NavigationController::RendererDidNavigate( const ViewHostMsg_FrameNavigate_Params& params, int extra_invalidate_flags, - LoadCommittedDetails* details) { + content::LoadCommittedDetails* details) { // Save the previous state before we clobber it. if (GetLastCommittedEntry()) { @@ -1090,11 +1091,11 @@ void NavigationController::NavigateToPendingEntry(ReloadType reload_type) { } void NavigationController::NotifyNavigationEntryCommitted( - LoadCommittedDetails* details, + content::LoadCommittedDetails* details, int extra_invalidate_flags) { details->entry = GetActiveEntry(); NotificationDetails notification_details = - Details<LoadCommittedDetails>(details); + Details<content::LoadCommittedDetails>(details); // We need to notify the ssl_manager_ before the tab_contents_ so the // location bar will have up-to-date information about the security style @@ -1136,12 +1137,12 @@ void NavigationController::LoadIfNecessary() { void NavigationController::NotifyEntryChanged(const NavigationEntry* entry, int index) { - EntryChangedDetails det; + content::EntryChangedDetails det; det.changed_entry = entry; det.index = index; NotificationService::current()->Notify(NotificationType::NAV_ENTRY_CHANGED, - Source<NavigationController>(this), - Details<EntryChangedDetails>(&det)); + Source<NavigationController>(this), + Details<content::EntryChangedDetails>(&det)); } void NavigationController::FinishRestore(int selected_index, diff --git a/content/browser/tab_contents/navigation_controller.h b/content/browser/tab_contents/navigation_controller.h index d753a29..e36a4b0 100644 --- a/content/browser/tab_contents/navigation_controller.h +++ b/content/browser/tab_contents/navigation_controller.h @@ -27,6 +27,10 @@ class TabContents; class TabNavigation; struct ViewHostMsg_FrameNavigate_Params; +namespace content { +struct LoadCommittedDetails; +} + // A NavigationController maintains the back-forward list for a single tab and // manages all navigation within that list. // @@ -34,96 +38,6 @@ struct ViewHostMsg_FrameNavigate_Params; // make sure that we have at most one TabContents instance per type. class NavigationController { public: - // Notification details ------------------------------------------------------ - - // Provides the details for a NOTIFY_NAV_ENTRY_CHANGED notification. - struct EntryChangedDetails { - // The changed navigation entry after it has been updated. - const NavigationEntry* changed_entry; - - // Indicates the current index in the back/forward list of the entry. - int index; - }; - - // Provides the details for a NOTIFY_NAV_ENTRY_COMMITTED notification. - // TODO(brettw) this mostly duplicates ProvisionalLoadDetails, it would be - // nice to unify these somehow. - struct LoadCommittedDetails { - // By default, the entry will be filled according to a new main frame - // navigation. - LoadCommittedDetails() - : entry(NULL), - type(NavigationType::UNKNOWN), - previous_entry_index(-1), - is_auto(false), - did_replace_entry(false), - is_in_page(false), - is_main_frame(true), - http_status_code(0) { - } - - // The committed entry. This will be the active entry in the controller. - NavigationEntry* entry; - - // The type of navigation that just occurred. Note that not all types of - // navigations in the enum are valid here, since some of them don't actually - // cause a "commit" and won't generate this notification. - NavigationType::Type type; - - // The index of the previously committed navigation entry. This will be -1 - // if there are no previous entries. - int previous_entry_index; - - // The previous URL that the user was on. This may be empty if none. - GURL previous_url; - - // True when this load was non-user initated. This corresponds to a - // a NavigationGestureAuto call from WebKit (see webview_delegate.h). - // We also count reloads and meta-refreshes as "auto" to account for the - // fact that WebKit doesn't always set the user gesture properly in these - // cases (see bug 1051891). - bool is_auto; - - // True if the committed entry has replaced the exisiting one. - // A non-user initiated redirect causes such replacement. - // This is somewhat similiar to is_auto, but not exactly the same. - bool did_replace_entry; - - // True if the navigation was in-page. This means that the active entry's - // URL and the |previous_url| are the same except for reference fragments. - bool is_in_page; - - // True when the main frame was navigated. False means the navigation was a - // sub-frame. - bool is_main_frame; - - // When the committed load is a web page from the renderer, this string - // specifies the security state if the page is secure. - // See ViewHostMsg_FrameNavigate_Params.security_info, where it comes from. - // Use SSLManager::DeserializeSecurityInfo to decode it. - std::string serialized_security_info; - - // Returns whether the user probably felt like they navigated somewhere new. - // We often need this logic for showing or hiding something, and this - // returns true only for main frame loads that the user initiated, that go - // to a new page. - bool is_user_initiated_main_frame_load() const { - return !is_auto && !is_in_page && is_main_frame; - } - - // The HTTP status code for this entry.. - int http_status_code; - }; - - // Details sent for NOTIFY_NAV_LIST_PRUNED. - struct PrunedDetails { - // If true, count items were removed from the front of the list, otherwise - // count items were removed from the back of the list. - bool from_front; - - // Number of items removed. - int count; - }; enum ReloadType { NO_RELOAD, // Normal load. @@ -317,7 +231,7 @@ class NavigationController { // added to the flags sent to the delegate's NotifyNavigationStateChanged. bool RendererDidNavigate(const ViewHostMsg_FrameNavigate_Params& params, int extra_invalidate_flags, - LoadCommittedDetails* details); + content::LoadCommittedDetails* details); // Notifies us that we just became active. This is used by the TabContents // so that we know to load URLs that were pending as "lazy" loads. @@ -472,7 +386,7 @@ class NavigationController { // // |extra_invalidate_flags| are an additional set of flags (InvalidateTypes) // added to the flags sent to the delegate's NotifyNavigationStateChanged. - void NotifyNavigationEntryCommitted(LoadCommittedDetails* details, + void NotifyNavigationEntryCommitted(content::LoadCommittedDetails* details, int extra_invalidate_flags); // Updates the virtual URL of an entry to match a new URL, for cases where diff --git a/content/browser/tab_contents/navigation_controller_unittest.cc b/content/browser/tab_contents/navigation_controller_unittest.cc index 29b6cdf..64052f4 100644 --- a/content/browser/tab_contents/navigation_controller_unittest.cc +++ b/content/browser/tab_contents/navigation_controller_unittest.cc @@ -21,6 +21,7 @@ #include "content/browser/renderer_host/test_render_view_host.h" #include "content/browser/site_instance.h" #include "content/browser/tab_contents/navigation_controller.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_delegate.h" @@ -320,7 +321,7 @@ TEST_F(NavigationControllerTest, LoadURL_ExistingPending) { // Before that commits, do a new navigation. const GURL kNewURL("http://see"); - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; rvh()->SendNavigate(3, kNewURL); // There should no longer be any pending entry, and the third navigation we @@ -770,7 +771,7 @@ TEST_F(NavigationControllerTest, Redirect) { params.is_post = false; params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url2)); - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; EXPECT_EQ(0U, notifications.size()); EXPECT_TRUE(controller().RendererDidNavigate(params, 0, &details)); @@ -826,7 +827,7 @@ TEST_F(NavigationControllerTest, PostThenRedirect) { params.is_post = false; params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url2)); - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; EXPECT_EQ(0U, notifications.size()); EXPECT_TRUE(controller().RendererDidNavigate(params, 0, &details)); @@ -872,7 +873,7 @@ TEST_F(NavigationControllerTest, ImmediateRedirect) { params.is_post = false; params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url2)); - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; EXPECT_EQ(0U, notifications.size()); EXPECT_TRUE(controller().RendererDidNavigate(params, 0, &details)); @@ -912,7 +913,7 @@ TEST_F(NavigationControllerTest, NewSubframe) { params.is_post = false; params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url2)); - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; EXPECT_TRUE(controller().RendererDidNavigate(params, 0, &details)); EXPECT_TRUE(notifications.Check1AndReset( NotificationType::NAV_ENTRY_COMMITTED)); @@ -948,7 +949,7 @@ TEST_F(NavigationControllerTest, SubframeOnEmptyPage) { params.is_post = false; params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url)); - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; EXPECT_FALSE(controller().RendererDidNavigate(params, 0, &details)); EXPECT_EQ(0U, notifications.size()); } @@ -975,7 +976,7 @@ TEST_F(NavigationControllerTest, AutoSubframe) { params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url2)); // Navigating should do nothing. - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; EXPECT_FALSE(controller().RendererDidNavigate(params, 0, &details)); EXPECT_EQ(0U, notifications.size()); @@ -1006,7 +1007,7 @@ TEST_F(NavigationControllerTest, BackSubframe) { params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url2)); // This should generate a new entry. - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; EXPECT_TRUE(controller().RendererDidNavigate(params, 0, &details)); EXPECT_TRUE(notifications.Check1AndReset( NotificationType::NAV_ENTRY_COMMITTED)); @@ -1090,7 +1091,7 @@ TEST_F(NavigationControllerTest, InPage) { params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url2)); // This should generate a new entry. - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; EXPECT_TRUE(controller().RendererDidNavigate(params, 0, &details)); EXPECT_TRUE(notifications.Check1AndReset( NotificationType::NAV_ENTRY_COMMITTED)); @@ -1171,7 +1172,7 @@ TEST_F(NavigationControllerTest, InPage_Replace) { params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url2)); // This should NOT generate a new entry. - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; EXPECT_TRUE(controller().RendererDidNavigate(params, 0, &details)); EXPECT_TRUE(notifications.Check2AndReset( NotificationType::NAV_LIST_PRUNED, @@ -1222,7 +1223,7 @@ TEST_F(NavigationControllerTest, ClientRedirectAfterInPageNavigation) { params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url)); // This should NOT generate a new entry. - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; EXPECT_TRUE(controller().RendererDidNavigate(params, 0, &details)); EXPECT_TRUE(notifications.Check2AndReset( NotificationType::NAV_LIST_PRUNED, @@ -1247,7 +1248,7 @@ TEST_F(NavigationControllerTest, ClientRedirectAfterInPageNavigation) { params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url)); // This SHOULD generate a new entry. - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; EXPECT_TRUE(controller().RendererDidNavigate(params, 0, &details)); EXPECT_TRUE(notifications.Check1AndReset( NotificationType::NAV_ENTRY_COMMITTED)); @@ -1281,7 +1282,7 @@ class PrunedListener : public NotificationObserver { const NotificationDetails& details) { if (type == NotificationType::NAV_LIST_PRUNED) { notification_count_++; - details_ = *(Details<NavigationController::PrunedDetails>(details).ptr()); + details_ = *(Details<content::PrunedDetails>(details).ptr()); } } @@ -1289,7 +1290,7 @@ class PrunedListener : public NotificationObserver { int notification_count_; // Details from the last NAV_LIST_PRUNED. - NavigationController::PrunedDetails details_; + content::PrunedDetails details_; private: NotificationRegistrar registrar_; @@ -1379,7 +1380,7 @@ TEST_F(NavigationControllerTest, RestoreNavigate) { params.gesture = NavigationGestureUser; params.is_post = false; params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url)); - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; our_controller.RendererDidNavigate(params, 0, &details); // There should be no longer any pending entry and one committed one. This @@ -1644,7 +1645,7 @@ TEST_F(NavigationControllerTest, SameSubframe) { params.gesture = NavigationGestureAuto; params.is_post = false; params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(subframe)); - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; EXPECT_FALSE(controller().RendererDidNavigate(params, 0, &details)); // Nothing should have changed. @@ -1671,7 +1672,7 @@ TEST_F(NavigationControllerTest, ViewSourceRedirect) { params.is_post = false; params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(result_url)); - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; controller().RendererDidNavigate(params, 0, &details); EXPECT_EQ(ASCIIToUTF16(kExpected), contents()->GetTitle()); @@ -1735,7 +1736,7 @@ TEST_F(NavigationControllerTest, SubframeWhilePending) { params.gesture = NavigationGestureAuto; params.is_post = false; params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url1_sub)); - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; // This should return false meaning that nothing was actually updated. EXPECT_FALSE(controller().RendererDidNavigate(params, 0, &details)); diff --git a/content/browser/tab_contents/navigation_details.h b/content/browser/tab_contents/navigation_details.h new file mode 100644 index 0000000..a31cef1 --- /dev/null +++ b/content/browser/tab_contents/navigation_details.h @@ -0,0 +1,108 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_DETAILS_H_ +#define CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_DETAILS_H_ +#pragma once + +#include <string> +#include "content/common/navigation_types.h" +#include "googleurl/src/gurl.h" + +class NavigationEntry; + +namespace content { + +// Provides the details for a NOTIFY_NAV_ENTRY_COMMITTED notification. +// TODO(brettw) this mostly duplicates ProvisionalLoadDetails, it would be +// nice to unify these somehow. +struct LoadCommittedDetails { + // By default, the entry will be filled according to a new main frame + // navigation. + LoadCommittedDetails() + : entry(NULL), + type(NavigationType::UNKNOWN), + previous_entry_index(-1), + is_auto(false), + did_replace_entry(false), + is_in_page(false), + is_main_frame(true), + http_status_code(0) { + } + + // The committed entry. This will be the active entry in the controller. + NavigationEntry* entry; + + // The type of navigation that just occurred. Note that not all types of + // navigations in the enum are valid here, since some of them don't actually + // cause a "commit" and won't generate this notification. + NavigationType::Type type; + + // The index of the previously committed navigation entry. This will be -1 + // if there are no previous entries. + int previous_entry_index; + + // The previous URL that the user was on. This may be empty if none. + GURL previous_url; + + // True when this load was non-user initated. This corresponds to a + // a NavigationGestureAuto call from WebKit (see webview_delegate.h). + // We also count reloads and meta-refreshes as "auto" to account for the + // fact that WebKit doesn't always set the user gesture properly in these + // cases (see bug 1051891). + bool is_auto; + + // True if the committed entry has replaced the exisiting one. + // A non-user initiated redirect causes such replacement. + // This is somewhat similiar to is_auto, but not exactly the same. + bool did_replace_entry; + + // True if the navigation was in-page. This means that the active entry's + // URL and the |previous_url| are the same except for reference fragments. + bool is_in_page; + + // True when the main frame was navigated. False means the navigation was a + // sub-frame. + bool is_main_frame; + + // When the committed load is a web page from the renderer, this string + // specifies the security state if the page is secure. + // See ViewHostMsg_FrameNavigate_Params.security_info, where it comes from. + // Use SSLManager::DeserializeSecurityInfo to decode it. + std::string serialized_security_info; + + // Returns whether the user probably felt like they navigated somewhere new. + // We often need this logic for showing or hiding something, and this + // returns true only for main frame loads that the user initiated, that go + // to a new page. + bool is_user_initiated_main_frame_load() const { + return !is_auto && !is_in_page && is_main_frame; + } + + // The HTTP status code for this entry.. + int http_status_code; +}; + +// Provides the details for a NOTIFY_NAV_ENTRY_CHANGED notification. +struct EntryChangedDetails { + // The changed navigation entry after it has been updated. + const NavigationEntry* changed_entry; + + // Indicates the current index in the back/forward list of the entry. + int index; +}; + +// Details sent for NOTIFY_NAV_LIST_PRUNED. +struct PrunedDetails { + // If true, count items were removed from the front of the list, otherwise + // count items were removed from the back of the list. + bool from_front; + + // Number of items removed. + int count; +}; + +} // namespace content + +#endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_DETAILS_H_ diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index 3c994af..2f5629f 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -33,6 +33,7 @@ #include "content/browser/renderer_host/resource_request_details.h" #include "content/browser/site_instance.h" #include "content/browser/tab_contents/interstitial_page.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/provisional_load_details.h" #include "content/browser/tab_contents/tab_contents_delegate.h" @@ -1063,7 +1064,7 @@ WebUI::TypeID TabContents::GetWebUITypeForCurrentState() { } void TabContents::DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { if (opener_web_ui_type_ != WebUI::kNoWebUI) { // If this is a window.open navigation, use the same WebUI as the renderer @@ -1109,7 +1110,7 @@ void TabContents::DidNavigateMainFramePostCommit( void TabContents::DidNavigateAnyFramePostCommit( RenderViewHost* render_view_host, - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { // If we navigate, start showing messages again. This does nothing to prevent // a malicious script from spamming messages, since the script could just @@ -1374,7 +1375,7 @@ void TabContents::DidNavigate(RenderViewHost* rvh, if (PageTransition::IsMainFrame(params.transition)) contents_mime_type_ = params.contents_mime_type; - NavigationController::LoadCommittedDetails details; + content::LoadCommittedDetails details; bool did_navigate = controller_.RendererDidNavigate( params, extra_invalidate_flags, &details); diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h index a4ec6b2..b3472af 100644 --- a/content/browser/tab_contents/tab_contents.h +++ b/content/browser/tab_contents/tab_contents.h @@ -588,11 +588,11 @@ class TabContents : public PageNavigator, // not provided since it may be invalid/changed after being committed. The // current navigation entry is in the NavigationController at this point. void DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params); void DidNavigateAnyFramePostCommit( RenderViewHost* render_view_host, - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params); // Closes all constrained windows. diff --git a/content/browser/tab_contents/tab_contents_observer.cc b/content/browser/tab_contents/tab_contents_observer.cc index 03f8f75..e3f7027 100644 --- a/content/browser/tab_contents/tab_contents_observer.cc +++ b/content/browser/tab_contents/tab_contents_observer.cc @@ -5,6 +5,7 @@ #include "content/browser/tab_contents/tab_contents_observer.h" #include "content/browser/renderer_host/render_view_host.h" +#include "content/browser/tab_contents/navigation_details.h" #include "content/browser/tab_contents/tab_contents.h" TabContentsObserver::Registrar::Registrar(TabContentsObserver* observer) @@ -34,12 +35,12 @@ void TabContentsObserver::NavigateToPendingEntry( } void TabContentsObserver::DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { } void TabContentsObserver::DidNavigateAnyFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params) { } diff --git a/content/browser/tab_contents/tab_contents_observer.h b/content/browser/tab_contents/tab_contents_observer.h index e1b11c9..3456895 100644 --- a/content/browser/tab_contents/tab_contents_observer.h +++ b/content/browser/tab_contents/tab_contents_observer.h @@ -45,10 +45,10 @@ class TabContentsObserver : public IPC::Channel::Listener, const GURL& url, NavigationController::ReloadType reload_type); virtual void DidNavigateMainFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params); virtual void DidNavigateAnyFramePostCommit( - const NavigationController::LoadCommittedDetails& details, + const content::LoadCommittedDetails& details, const ViewHostMsg_FrameNavigate_Params& params); // |render_view_host| is the RenderViewHost for which the provisional load is // happening. diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 806cdfe..59b2c95 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -312,6 +312,7 @@ 'browser/tab_contents/interstitial_page.h', 'browser/tab_contents/navigation_controller.cc', 'browser/tab_contents/navigation_controller.h', + 'browser/tab_contents/navigation_details.h', 'browser/tab_contents/navigation_entry.cc', 'browser/tab_contents/navigation_entry.h', 'browser/tab_contents/page_navigator.h', |