Merge pull request #255 from deepak1556/dock_state_use_preferences_patch
use dock state from peferences when not set by embedder
This commit is contained in:
commit
9456ce44c4
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue