From 92cec88ffd2736f673fb2550d57cf722d1945baa Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 14 Jun 2011 17:44:19 +0000 Subject: [PATCH] Use a file URL for the DevTools path to fix a DevTools load problem on Mac (issue #265). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@259 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser_impl.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libcef/browser_impl.cc b/libcef/browser_impl.cc index e1b6fef9d..472030df4 100644 --- a/libcef/browser_impl.cc +++ b/libcef/browser_impl.cc @@ -13,6 +13,7 @@ #include "base/file_path.h" #include "base/path_service.h" +#include "base/stringprintf.h" #include "base/synchronization/waitable_event.h" #include "base/utf_string_conversions.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" @@ -1430,11 +1431,14 @@ void CefBrowserImpl::UIT_ShowDevTools() FilePath devtools_path = dir_exe.AppendASCII("resources/inspector/devtools.html"); + // Mac requires that the URL have a file:// prefix. + CefString path = devtools_path.value(); + CefString url(base::StringPrintf("file://%s", path.ToString().c_str())); + CefPopupFeatures features; - CefRefPtr browser = - UIT_CreatePopupWindow(devtools_path.value(), features); + CefRefPtr browser = UIT_CreatePopupWindow(url, features); browser->UIT_CreateDevToolsClient(dev_tools_agent_.get()); - browser->UIT_LoadURL(browser->GetMainFrame(), devtools_path.value()); + browser->UIT_LoadURL(browser->GetMainFrame(), url); browser->UIT_Show(WebKit::WebNavigationPolicyNewWindow); } else { // Give focus to the existing inspector window.