diff options
16 files changed, 39 insertions, 29 deletions
diff --git a/chrome/browser/favicon/favicon_tab_helper.cc b/chrome/browser/favicon/favicon_tab_helper.cc index a3d5fa7a..4ab113b 100644 --- a/chrome/browser/favicon/favicon_tab_helper.cc +++ b/chrome/browser/favicon/favicon_tab_helper.cc @@ -157,7 +157,7 @@ void FaviconTabHelper::NotifyFaviconUpdated(bool icon_url_changed) { web_contents()->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB); } -void FaviconTabHelper::NavigateToPendingEntry( +void FaviconTabHelper::DidStartNavigationToPendingEntry( const GURL& url, NavigationController::ReloadType reload_type) { if (reload_type != NavigationController::NO_RELOAD && diff --git a/chrome/browser/favicon/favicon_tab_helper.h b/chrome/browser/favicon/favicon_tab_helper.h index a5ef1ae2..b8255a6 100644 --- a/chrome/browser/favicon/favicon_tab_helper.h +++ b/chrome/browser/favicon/favicon_tab_helper.h @@ -84,7 +84,7 @@ class FaviconTabHelper : public content::WebContentsObserver, friend class content::WebContentsUserData<FaviconTabHelper>; // content::WebContentsObserver overrides. - virtual void NavigateToPendingEntry( + virtual void DidStartNavigationToPendingEntry( const GURL& url, content::NavigationController::ReloadType reload_type) OVERRIDE; virtual void DidNavigateMainFrame( diff --git a/chrome/browser/net/predictor_tab_helper.cc b/chrome/browser/net/predictor_tab_helper.cc index b1fd450..a29e677 100644 --- a/chrome/browser/net/predictor_tab_helper.cc +++ b/chrome/browser/net/predictor_tab_helper.cc @@ -41,7 +41,7 @@ PredictorTabHelper::PredictorTabHelper(content::WebContents* web_contents) PredictorTabHelper::~PredictorTabHelper() { } -void PredictorTabHelper::NavigateToPendingEntry( +void PredictorTabHelper::DidStartNavigationToPendingEntry( const GURL& url, content::NavigationController::ReloadType reload_type) { Profile* profile = diff --git a/chrome/browser/net/predictor_tab_helper.h b/chrome/browser/net/predictor_tab_helper.h index 90a121d..c173139 100644 --- a/chrome/browser/net/predictor_tab_helper.h +++ b/chrome/browser/net/predictor_tab_helper.h @@ -19,7 +19,7 @@ class PredictorTabHelper virtual ~PredictorTabHelper(); // content::WebContentsObserver implementation - virtual void NavigateToPendingEntry( + virtual void DidStartNavigationToPendingEntry( const GURL& url, content::NavigationController::ReloadType reload_type) OVERRIDE; virtual void DidNavigateMainFrame( diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index aba8e8d..e17bfa1 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -278,7 +278,7 @@ class RenderViewSizeObserver : public content::WebContentsObserver { // Enlarge WebContentsView by |wcv_resize_insets_| while the navigation entry // is pending. - virtual void NavigateToPendingEntry( + virtual void DidStartNavigationToPendingEntry( const GURL& url, NavigationController::ReloadType reload_type) OVERRIDE { if (wcv_resize_insets_.IsEmpty()) @@ -319,7 +319,8 @@ class RenderViewSizeObserver : public content::WebContentsObserver { typedef std::map<content::RenderViewHost*, Sizes> RenderViewSizes; RenderViewSizes render_view_sizes_; - // Enlarge WebContentsView by this size insets in NavigateToPendingEntry. + // Enlarge WebContentsView by this size insets in + // DidStartNavigationToPendingEntry. gfx::Size wcv_resize_insets_; BrowserWindow* browser_window_; // Weak ptr. @@ -2544,8 +2545,9 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, DISABLED_GetSizeForNewRenderView) { initial_wcv_size.height() + height_inset), rwhv_create_size2); // WebContentsView was resized in - // RenderViewSizeObserver::NavigateToPendingEntry after RenderWidgetHostView - // was created, so the commit size should be resized accordingly. + // RenderViewSizeObserver::DidStartNavigationToPendingEntry after + // RenderWidgetHostView was created, so the commit size should be resized + // accordingly. gfx::Size exp_commit_size(initial_wcv_size); exp_commit_size.Enlarge(wcv_resize_insets.width(), wcv_resize_insets.height() + height_inset); diff --git a/chrome/browser/ui/browser_instant_controller_unittest.cc b/chrome/browser/ui/browser_instant_controller_unittest.cc index 52540aa..1c8d9c0 100644 --- a/chrome/browser/ui/browser_instant_controller_unittest.cc +++ b/chrome/browser/ui/browser_instant_controller_unittest.cc @@ -56,14 +56,14 @@ class FakeWebContentsObserver : public content::WebContentsObserver { url_(contents->GetURL()), num_reloads_(0) {} - virtual void NavigateToPendingEntry( + virtual void DidStartNavigationToPendingEntry( const GURL& url, content::NavigationController::ReloadType reload_type) OVERRIDE { // The tab reload event doesn't work with BrowserWithTestWindowTest. - // So we capture the NavigateToPendingEntry, and use the + // So we capture the DidStartNavigationToPendingEntry, and use the // BrowserWithTestWindowTest::NavigateAndCommit to simulate the complete - // reload. Note that this will again trigger NavigateToPendingEntry, so we - // remove this as observer. + // reload. Note that this will again trigger + // DidStartNavigationToPendingEntry, so we remove this as observer. content::NavigationController* controller = &web_contents()->GetController(); Observe(NULL); diff --git a/chrome/browser/ui/omnibox/omnibox_navigation_observer.cc b/chrome/browser/ui/omnibox/omnibox_navigation_observer.cc index 736efa3..b7b9057 100644 --- a/chrome/browser/ui/omnibox/omnibox_navigation_observer.cc +++ b/chrome/browser/ui/omnibox/omnibox_navigation_observer.cc @@ -95,7 +95,7 @@ void OmniboxNavigationObserver::Observe( controller->GetBrowserContext()->GetRequestContext()); } WebContentsObserver::Observe(controller->GetWebContents()); - // NavigateToPendingEntry() will be called for this load as well. + // DidStartNavigationToPendingEntry() will be called for this load as well. } void OmniboxNavigationObserver::NavigationEntryCommitted( @@ -113,7 +113,7 @@ void OmniboxNavigationObserver::WebContentsDestroyed( delete this; } -void OmniboxNavigationObserver::NavigateToPendingEntry( +void OmniboxNavigationObserver::DidStartNavigationToPendingEntry( const GURL& url, content::NavigationController::ReloadType reload_type) { if (load_state_ == LOAD_NOT_SEEN) { diff --git a/chrome/browser/ui/omnibox/omnibox_navigation_observer.h b/chrome/browser/ui/omnibox/omnibox_navigation_observer.h index 39754d6..1d0a6bc 100644 --- a/chrome/browser/ui/omnibox/omnibox_navigation_observer.h +++ b/chrome/browser/ui/omnibox/omnibox_navigation_observer.h @@ -79,7 +79,7 @@ class OmniboxNavigationObserver : public content::NotificationObserver, const content::NotificationDetails& details) OVERRIDE; // content::WebContentsObserver: - virtual void NavigateToPendingEntry( + virtual void DidStartNavigationToPendingEntry( const GURL& url, content::NavigationController::ReloadType reload_type) OVERRIDE; virtual void NavigationEntryCommitted( diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc index c210405..94b1de3 100644 --- a/chrome/browser/ui/sync/one_click_signin_helper.cc +++ b/chrome/browser/ui/sync/one_click_signin_helper.cc @@ -1099,10 +1099,11 @@ void OneClickSigninHelper::set_do_not_start_sync_for_testing() { do_not_start_sync_for_testing_ = true; } -void OneClickSigninHelper::NavigateToPendingEntry( +void OneClickSigninHelper::DidStartNavigationToPendingEntry( const GURL& url, content::NavigationController::ReloadType reload_type) { - VLOG(1) << "OneClickSigninHelper::NavigateToPendingEntry: url=" << url.spec(); + VLOG(1) << "OneClickSigninHelper::DidStartNavigationToPendingEntry: url=" << + url.spec(); // If the tab navigates to a new page, and this page is not a valid Gaia // sign in redirect or reponse, or the expected continue URL, make sure to // clear the internal state. This is needed to detect navigations in the diff --git a/chrome/browser/ui/sync/one_click_signin_helper.h b/chrome/browser/ui/sync/one_click_signin_helper.h index 92e281b..2c0b09d 100644 --- a/chrome/browser/ui/sync/one_click_signin_helper.h +++ b/chrome/browser/ui/sync/one_click_signin_helper.h @@ -226,7 +226,7 @@ class OneClickSigninHelper void PasswordSubmitted(const autofill::PasswordForm& form); // content::WebContentsObserver overrides. - virtual void NavigateToPendingEntry( + virtual void DidStartNavigationToPendingEntry( const GURL& url, content::NavigationController::ReloadType reload_type) OVERRIDE; virtual void DidNavigateMainFrame( diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc index ccd58a1..5b79087 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc @@ -457,7 +457,8 @@ void ExtensionSettingsHandler::RenderViewDeleted( MaybeUpdateAfterNotification(); } -void ExtensionSettingsHandler::NavigateToPendingEntry(const GURL& url, +void ExtensionSettingsHandler::DidStartNavigationToPendingEntry( + const GURL& url, content::NavigationController::ReloadType reload_type) { if (reload_type != content::NavigationController::NO_RELOAD) ReloadUnpackedExtensions(); diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.h b/chrome/browser/ui/webui/extensions/extension_settings_handler.h index ff7ecac..c773b3e 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.h +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.h @@ -95,7 +95,7 @@ class ExtensionSettingsHandler // content::WebContentsObserver implementation. virtual void RenderViewDeleted( content::RenderViewHost* render_view_host) OVERRIDE; - virtual void NavigateToPendingEntry( + virtual void DidStartNavigationToPendingEntry( const GURL& url, content::NavigationController::ReloadType reload_type) OVERRIDE; diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc index 0676557..1f31e11 100644 --- a/content/browser/frame_host/navigation_controller_impl_unittest.cc +++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc @@ -193,7 +193,7 @@ class NavigationControllerTest } // WebContentsObserver: - virtual void NavigateToPendingEntry( + virtual void DidStartNavigationToPendingEntry( const GURL& url, NavigationController::ReloadType reload_type) OVERRIDE { navigated_url_ = url; diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index afbe44b..9504900 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -1658,9 +1658,10 @@ bool WebContentsImpl::NavigateToEntry( } // Notify observers about navigation. - FOR_EACH_OBSERVER(WebContentsObserver, - observers_, - NavigateToPendingEntry(entry.GetURL(), reload_type)); + FOR_EACH_OBSERVER( + WebContentsObserver, + observers_, + DidStartNavigationToPendingEntry(entry.GetURL(), reload_type)); if (delegate_) delegate_->DidNavigateToPendingEntry(this); diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc index 48cba05..b06a628 100644 --- a/content/browser/web_contents/web_contents_impl_browsertest.cc +++ b/content/browser/web_contents/web_contents_impl_browsertest.cc @@ -135,7 +135,7 @@ class RenderViewSizeObserver : public WebContentsObserver { rwhv_create_size_ = rvh->GetView()->GetViewBounds().size(); } - virtual void NavigateToPendingEntry( + virtual void DidStartNavigationToPendingEntry( const GURL& url, NavigationController::ReloadType reload_type) OVERRIDE { ResizeWebContentsView(shell_, wcv_new_size_, false); @@ -288,8 +288,9 @@ IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, // RenderWidgetHostView is created at specified size. init_size.Enlarge(size_insets.width(), size_insets.height()); EXPECT_EQ(init_size, observer.rwhv_create_size()); - // RenderViewSizeObserver resizes WebContentsView in NavigateToPendingEntry, - // so both WebContentsView and RenderWidgetHostView adopt this new size. + // RenderViewSizeObserver resizes WebContentsView in + // DidStartNavigationToPendingEntry, so both WebContentsView and + // RenderWidgetHostView adopt this new size. new_size.Enlarge(size_insets.width(), size_insets.height()); EXPECT_EQ(new_size, shell()->web_contents()->GetRenderWidgetHostView()->GetViewBounds(). diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h index fbc5206..5c7c935 100644 --- a/content/public/browser/web_contents_observer.h +++ b/content/public/browser/web_contents_observer.h @@ -79,8 +79,12 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener, virtual void AboutToNavigateRenderView( RenderViewHost* render_view_host) {} - // This method is invoked right after the navigation was initiated. - virtual void NavigateToPendingEntry( + // This method is invoked after the browser process starts a navigation to a + // pending NavigationEntry. It is not called for renderer-initiated + // navigations unless they are sent to the browser process via OpenURL. It may + // be called multiple times for a given navigation, such as a typed URL + // followed by a cross-process client or server redirect. + virtual void DidStartNavigationToPendingEntry( const GURL& url, NavigationController::ReloadType reload_type) {} |