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

Unified Diff: chrome/browser/devtools/devtools_ui_bindings.cc

Issue 2421913003: DevTools: allow reattaching main target live. (Closed)
Patch Set: link fixed Created 4 years, 2 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/devtools/devtools_ui_bindings.h ('k') | chrome/browser/devtools/devtools_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/devtools_ui_bindings.cc
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc
index fd3f0dd9223737448c8a11a3282c3041fd5ad212..4f8473b3a3a2cba63f1732f50f64872e28eb518c 100644
--- a/chrome/browser/devtools/devtools_ui_bindings.cc
+++ b/chrome/browser/devtools/devtools_ui_bindings.cc
@@ -402,7 +402,7 @@ DevToolsUIBindings::DevToolsUIBindings(content::WebContents* web_contents)
delegate_(new DefaultBindingsDelegate(web_contents_)),
devices_updates_enabled_(false),
frontend_loaded_(false),
- reattaching_(false),
+ reloading_(false),
weak_factory_(this) {
g_instances.Get().push_back(this);
frontend_contents_observer_.reset(new FrontendWebContentsObserver(this));
@@ -856,6 +856,13 @@ void DevToolsUIBindings::ClearPreferences() {
update.Get()->Clear();
}
+void DevToolsUIBindings::Reattach(const DispatchCallback& callback) {
+ DCHECK(agent_host_.get());
+ agent_host_->DetachClient(this);
+ agent_host_->AttachClient(this);
+ callback.Run(nullptr);
+}
+
void DevToolsUIBindings::ReadyForTest() {
delegate_->ReadyForTest();
}
@@ -1106,9 +1113,10 @@ void DevToolsUIBindings::AttachTo(
agent_host_->ForceAttachClient(this);
}
-void DevToolsUIBindings::Reattach() {
+void DevToolsUIBindings::Reload() {
DCHECK(agent_host_.get());
- reattaching_ = true;
+ reloading_ = true;
+ web_contents_->GetController().Reload(false);
}
void DevToolsUIBindings::Detach() {
@@ -1145,9 +1153,9 @@ void DevToolsUIBindings::CallClientFunction(const std::string& function_name,
}
void DevToolsUIBindings::DocumentAvailableInMainFrame() {
- if (!reattaching_)
+ if (!reloading_)
return;
- reattaching_ = false;
+ reloading_ = false;
agent_host_->DetachClient(this);
agent_host_->AttachClient(this);
}
« no previous file with comments | « chrome/browser/devtools/devtools_ui_bindings.h ('k') | chrome/browser/devtools/devtools_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698