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

Unified Diff: chrome/browser/ui/webui/inspect_ui.cc

Issue 2657313002: Convert DevToolsUIBindingsEnabler to use the new navigation callbacks. (Closed)
Patch Set: a 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/inspect_ui.cc
diff --git a/chrome/browser/ui/webui/inspect_ui.cc b/chrome/browser/ui/webui/inspect_ui.cc
index 02a7116c176f9b6140220af38b16ef8220e817a3..48e8dba6f074b1e6db9b6dd9a903742f79ffb711 100644
--- a/chrome/browser/ui/webui/inspect_ui.cc
+++ b/chrome/browser/ui/webui/inspect_ui.cc
@@ -20,6 +20,7 @@
#include "components/ui_devtools/devtools_server.h"
#include "content/public/browser/devtools_agent_host.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_source.h"
#include "content/public/browser/notification_types.h"
@@ -286,9 +287,8 @@ class DevToolsUIBindingsEnabler
private:
// contents::WebContentsObserver overrides.
void WebContentsDestroyed() override;
- void DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) override;
+ void DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) override;
DevToolsUIBindings bindings_;
GURL url_;
@@ -311,10 +311,12 @@ void DevToolsUIBindingsEnabler::WebContentsDestroyed() {
delete this;
}
-void DevToolsUIBindingsEnabler::DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
- if (url_ != params.url)
+void DevToolsUIBindingsEnabler::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted())
+ return;
+
+ if (url_ != navigation_handle->GetURL())
delete this;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698