Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc

Issue 2636183004: Convert ChromeOmniboxNavigationObserver to use the new navigation callbacks. (Closed)
Patch Set: closer to original Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698