summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Negyokru <negyokru@inf.u-szeged.hu>2023-04-17 14:48:19 +0200
committerMartin Negyokru <negyokru@inf.u-szeged.hu>2023-04-19 16:57:02 +0200
commit59e1a33ffa4e9ba670c099e96d2677e06bf665c7 (patch)
tree7d5872c40b8364f036c9acf852d95d4a29195bd0
parentffc26420b81901bf7f47fe783f8582588451c7e9 (diff)
downloadqtwebengine-59e1a33ffa4e9ba670c099e96d2677e06bf665c7.tar.gz
Disable devtools screencast by default
After 73acb3b3e devtools starts with screencast opened. Bring back old behavior. Fixes: QTBUG-112772 Pick-to: 6.5 Change-Id: Ifa1b860dc125e006ab5c2e3cd60a82980c32abe0 Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/core/devtools_frontend_qt.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 8ac834c9d..731414db9 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -15,6 +15,8 @@
#include "chrome/browser/devtools/devtools_eye_dropper.h"
#include "chrome/browser/devtools/devtools_ui_bindings.h"
+#include "chrome/common/pref_names.h"
+#include "components/prefs/scoped_user_pref_update.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/navigation_controller.h"
@@ -25,6 +27,7 @@
using namespace QtWebEngineCore;
namespace {
+static const char kScreencastEnabled[] = "screencastEnabled";
static std::string GetFrontendURL()
{
@@ -80,6 +83,14 @@ DevToolsFrontendQt::DevToolsFrontendQt(QSharedPointer<WebContentsAdapter> webCon
// bindings take ownership over devtools
m_bindings->SetDelegate(this);
m_bindings->AttachTo(content::DevToolsAgentHost::GetOrCreateFor(m_inspectedContents));
+
+ auto *prefService = m_bindings->profile()->GetPrefs();
+ const auto &devtoolsPrefs = prefService->GetDict(prefs::kDevToolsPreferences);
+
+ if (!devtoolsPrefs.Find(kScreencastEnabled)) {
+ ScopedDictPrefUpdate update(prefService, prefs::kDevToolsPreferences);
+ update->Set(kScreencastEnabled, "false");
+ }
}
DevToolsFrontendQt::~DevToolsFrontendQt()