Chromium Code Reviews| Index: chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc |
| diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc |
| index 567a8dd516d1a61206ff9db253b184623b7cbd08..dd1cc48ac2654359774a996561f8e58eed5d169d 100644 |
| --- a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc |
| +++ b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc |
| @@ -13,6 +13,7 @@ |
| #include "content/public/browser/navigation_controller.h" |
| #include "content/public/browser/navigation_details.h" |
| #include "content/public/browser/navigation_entry.h" |
| +#include "content/public/browser/navigation_handle.h" |
| #include "content/public/browser/notification_service.h" |
| #include "content/public/browser/notification_types.h" |
| #include "content/public/browser/render_frame_host.h" |
| @@ -125,9 +126,11 @@ void ChromeOmniboxNavigationObserver::Observe( |
| // DidStartNavigationToPendingEntry() will be called for this load as well. |
| } |
| -void ChromeOmniboxNavigationObserver::DidStartNavigationToPendingEntry( |
| - const GURL& url, |
| - content::ReloadType reload_type) { |
| +void ChromeOmniboxNavigationObserver::DidStartNavigation( |
| + content::NavigationHandle* navigation_handle) { |
| + if (!navigation_handle->IsInMainFrame() || navigation_handle->IsSamePage()) |
| + return; |
| + |
| if (load_state_ == LOAD_NOT_SEEN) { |
| load_state_ = LOAD_PENDING; |
| if (fetcher_) |
| @@ -137,13 +140,12 @@ void ChromeOmniboxNavigationObserver::DidStartNavigationToPendingEntry( |
| } |
| } |
| -void ChromeOmniboxNavigationObserver::DidFailProvisionalLoad( |
| - content::RenderFrameHost* render_frame_host, |
| - const GURL& validated_url, |
| - int error_code, |
| - const base::string16& error_description, |
| - bool was_ignored_by_handler) { |
| - if ((load_state_ != LOAD_COMMITTED) && !render_frame_host->GetParent()) |
| +void ChromeOmniboxNavigationObserver::DidFinishNavigation( |
| + content::NavigationHandle* navigation_handle) { |
| + if ((load_state_ != LOAD_COMMITTED) && |
| + navigation_handle->IsErrorPage() && |
|
Peter Kasting
2017/01/24 00:15:31
Does IsErrorPage() mean the same thing that "faile
jam
2017/01/24 00:21:51
Yep should be. A failing provisional load is equiv
jam
2017/01/24 00:22:26
but if you have any test cases that aren't in exis
|
| + navigation_handle->IsInMainFrame() && |
| + !navigation_handle->IsSamePage()) |
| delete this; |
| } |