From f652760c7a1d4053bb81fd29f40975dacd5b192b Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Tue, 11 Oct 2016 13:47:06 +0530 Subject: [PATCH] use dock state from peferences when not set by embedder --- brightray/browser/inspectable_web_contents_impl.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 6506e4490db..4affb2f786d 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -380,6 +380,13 @@ void InspectableWebContentsImpl::LoadCompleted() { if (!can_dock_) { SetIsDocked(DispatchCallback(), false); } else { + if (dock_state_.empty()) { + const base::DictionaryValue* prefs = pref_service_->GetDictionary( + kDevToolsPreferences); + std::string current_dock_state; + prefs->GetString("currentDockState", ¤t_dock_state); + base::RemoveChars(current_dock_state, "\"", &dock_state_); + } base::string16 javascript = base::UTF8ToUTF16( "WebInspector.dockController.setDockSide(\"" + dock_state_ + "\");"); devtools_web_contents_->GetMainFrame()->ExecuteJavaScript(javascript);