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
This commit is contained in:
Marshall Greenblatt 2011-06-14 17:44:19 +00:00
parent 0d893166d3
commit 92cec88ffd
1 changed files with 7 additions and 3 deletions

View File

@ -13,6 +13,7 @@
#include "base/file_path.h" #include "base/file_path.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/stringprintf.h"
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
#include "base/utf_string_conversions.h" #include "base/utf_string_conversions.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
@ -1430,11 +1431,14 @@ void CefBrowserImpl::UIT_ShowDevTools()
FilePath devtools_path = FilePath devtools_path =
dir_exe.AppendASCII("resources/inspector/devtools.html"); 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; CefPopupFeatures features;
CefRefPtr<CefBrowserImpl> browser = CefRefPtr<CefBrowserImpl> browser = UIT_CreatePopupWindow(url, features);
UIT_CreatePopupWindow(devtools_path.value(), features);
browser->UIT_CreateDevToolsClient(dev_tools_agent_.get()); 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); browser->UIT_Show(WebKit::WebNavigationPolicyNewWindow);
} else { } else {
// Give focus to the existing inspector window. // Give focus to the existing inspector window.