Skip to content

Commit

Permalink
Making necessary changes to make it work with CEF branch 2171.
Browse files Browse the repository at this point in the history
This is PHP Desktop Chrome 39.0 Release Candidate.

ShowDevTools code have been simplified, as CEF now exposes
ShowDevTools method.

Chrome 39 supports High DPI natively and it's doing it correctly
using page zooming.
  • Loading branch information
cztomczak committed Nov 25, 2014
1 parent 3a4a855 commit a9b5b68
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 27 deletions.
57 changes: 40 additions & 17 deletions phpdesktop-chrome-cef2171/cef/README.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Chromium Embedded Framework (CEF) Standard Binary Distribution for Windows
-------------------------------------------------------------------------------

Date: January 13, 2014
Date: November 03, 2014

CEF Version: 3.1650.1562
CEF URL: http://chromiumembedded.googlecode.com/svn/branches/1650/cef3@1562
CEF Version: 3.2171.1902
CEF URL: https://[email protected]/chromiumembedded/branches-2171-cef3.git
@1902

Chromium Verison: 31.0.1650.57
Chromium URL: http://src.chromium.org/svn/branches/1650/src@235101
Chromium Verison: 39.0.2171.36
Chromium URL: https://chromium.googlesource.com/chromium/src.git
@438546a6d26d33f457aa7cbbbfcd2f762c4a1611

This distribution contains all components necessary to build and distribute an
application using CEF on the Windows platform. Please see the LICENSING
Expand All @@ -18,7 +20,12 @@ CONTENTS
--------

cefclient Contains the cefclient sample application configured to build
using the files in this distribution.
using the files in this distribution. This application demonstrates
a wide range of CEF functionalities.

cefsimple Contains the cefsimple sample application configured to build
using the files in this distribution. This application demonstrates
the minimal functionality required to create a browser window.

Debug Contains libcef.dll, libcef.lib and other components required to
build and run the debug version of CEF-based applications. By
Expand All @@ -44,18 +51,23 @@ Resources Contains resources required by libcef.dll. By default these files
USAGE
-----

Visual Studio 2012 and Visual Studio 2010:
Open the cefclient2010.sln solution in Visual Studio and build.
Building using CMake:
CMake can be used to generate project files in many different formats. See
usage instructions at the top of the CMakeLists.txt file.

Building using the pre-existing Visual Studio solution (DEPRECATED):
Visual Studio 2013 and newer:
Open the cefclient2010.sln solution in Visual Studio and build.

Visual Studio 2008:
Open the cefclient2008.sln solution in Visual Studio and build.
Visual Studio 2008:
Open the cefclient2008.sln solution in Visual Studio and build.

Visual Studio 2005:
1. Open the cefclient.vcproj and libcef_dll_wrapper.vcproj files in a text
editor. Change Version="9.00" to Version="8.00".
2. Open the cefclient2005.sln file in a text editor. Change "Version 9.00" to
"Version 8.00".
3. Open the cefclient2005.sln solution in Visual Studio and build.
Visual Studio 2005:
1. Open the cefclient.vcproj and libcef_dll_wrapper.vcproj files in a text
editor. Change Version="9.00" to Version="8.00".
2. Open the cefclient2005.sln file in a text editor. Change "Version 9.00"
to "Version 8.00".
3. Open the cefclient2005.sln solution in Visual Studio and build.

Please visit the CEF Website for additional usage information.

Expand All @@ -76,7 +88,7 @@ Required components:
libcef.dll

* Unicode support
icudt.dll
icudtl.dat

Optional components:

Expand All @@ -91,6 +103,8 @@ Optional components:

* Other resources
cef.pak
cef_100_percent.pak
cef_200_percent.pak
devtools_resources.pak
Note: Contains WebKit image and inspector resources. Pack file loading can be
disabled completely using CefSettings.pack_loading_disabled. The resources
Expand All @@ -100,6 +114,10 @@ Optional components:
ffmpegsumo.dll
Note: Without this component HTML5 audio and video will not function.

* PDF support
pdf.dll
Note: Without this component printing will not function.

* Angle and Direct3D support
d3dcompiler_43.dll (required for Windows XP)
d3dcompiler_46.dll (required for Windows Vista and newer)
Expand All @@ -108,6 +126,11 @@ Optional components:
Note: Without these components HTML5 accelerated content like 2D canvas, 3D
CSS and WebGL will not function.

* Windows Vista 64-bit sandbox support (32-bit distributions only)
wow_helper.exe
Note: Without this component the 32-bit build of CEF will not run on 64-bit
Vista machines with the sandbox enabled.


LICENSING
---------
Expand Down
2 changes: 1 addition & 1 deletion phpdesktop-chrome-cef2171/cef/client_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class ClientHandler : public CefClient,

private:
// Include the default reference counting implementation.
IMPLEMENT_REFCOUNTING(SimpleHandler);
IMPLEMENT_REFCOUNTING(ClientHandler);
};

class ApplicationStartupContentVisitor : public CefStringVisitor {
Expand Down
15 changes: 15 additions & 0 deletions phpdesktop-chrome-cef2171/cef/devtools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
#include "../string_utils.h"
#include "../popup_window.h"

bool ShowDevTools(CefRefPtr<CefBrowser> browser) {
CefWindowInfo windowInfo;
CefBrowserSettings settings;

#if defined(OS_WIN)
windowInfo.SetAsPopup(browser->GetHost()->GetWindowHandle(), "DevTools");
#endif

browser->GetHost()->ShowDevTools(windowInfo, browser->GetHost()->GetClient(),
settings, CefPoint());
return true;
}

/*
bool ShowDevTools(CefRefPtr<CefBrowser> cefBrowser) {
std::string devtools_url = cefBrowser->GetHost()->GetDevToolsURL(true);
// Example url returned:
Expand Down Expand Up @@ -47,3 +61,4 @@ bool ShowDevTools(CefRefPtr<CefBrowser> cefBrowser) {
}
return true;
}
*/
2 changes: 1 addition & 1 deletion phpdesktop-chrome-cef2171/cef/javascript_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ class JavascriptApi : public CefV8Handler

private:
// Provide the reference counting implementation for this class.
IMPLEMENT_REFCOUNTING(MyV8Handler);
IMPLEMENT_REFCOUNTING(JavascriptApi);
};
9 changes: 9 additions & 0 deletions phpdesktop-chrome-cef2171/dpi_aware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
#include "include/cef_runnable.h"

void SetBrowserDpiSettings(CefRefPtr<CefBrowser> cefBrowser) {
// Chrome 39 handles High DPI just fine. Looks like it uses
// zooming and not native OS display scaling that would make
// fonts look fuzzy. Commenting out the old code from Chrome 31.
// We still need to handle window size when dpi_aware=true
// in settings.json. So GetDpiAwareWindowSize() is still required.
return;

/*
// Setting zoom level immediately after browser was created
// won't work. We need to wait a moment before we can set it.
REQUIRE_UI_THREAD();
Expand Down Expand Up @@ -66,6 +74,7 @@ void SetBrowserDpiSettings(CefRefPtr<CefBrowser> cefBrowser) {
TID_UI,
NewCefRunnableFunction(&SetBrowserDpiSettings, cefBrowser),
50);
*/
}

void GetDpiAwareWindowSize(int* width, int* height) {
Expand Down
9 changes: 5 additions & 4 deletions phpdesktop-chrome-cef2171/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
// CEF subprocesses.
CefMainArgs main_args(hInstance);
CefRefPtr<App> app(new App);
int exit_code = CefExecuteProcess(main_args, app.get());
int exit_code = CefExecuteProcess(main_args, app.get(), NULL);
if (exit_code >= 0) {
ShutdownLogging();
return exit_code;
Expand Down Expand Up @@ -237,8 +237,6 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
log_severity = LOGSEVERITY_WARNING;
} else if (chrome_log_severity == "error") {
log_severity = LOGSEVERITY_ERROR;
} else if (chrome_log_severity == "error-report") {
log_severity = LOGSEVERITY_ERROR_REPORT;
} else if (chrome_log_severity == "disable") {
log_severity = LOGSEVERITY_DISABLE;
}
Expand All @@ -265,7 +263,10 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
cef_settings.remote_debugging_port = remote_debugging_port;
}

CefInitialize(main_args, cef_settings, app.get());
// Sandbox support
cef_settings.no_sandbox = true;

CefInitialize(main_args, cef_settings, app.get(), NULL);
CreateMainWindow(hInstance, nCmdShow, main_window_title);
CefRunMessageLoop();
CefShutdown();
Expand Down
8 changes: 4 additions & 4 deletions phpdesktop-chrome-cef2171/resource.rc
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ IDR_MAINWINDOW ICON "icon.ico"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 31,8,0,0
PRODUCTVERSION 31,8,0,0
FILEVERSION 39,0,0,0
PRODUCTVERSION 39,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -65,12 +65,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "PHP Desktop"
VALUE "FileDescription", "PHP Desktop Chrome"
VALUE "FileVersion", "31.8.0.0"
VALUE "FileVersion", "39.0.0.0"
VALUE "InternalName", "phpdesktop"
VALUE "LegalCopyright", "(c) Czarek Tomczak 2012-2014"
VALUE "OriginalFilename", "phpdesktop-chrome.exe"
VALUE "ProductName", "PHP Desktop Chrome"
VALUE "ProductVersion", "31.8.0.0"
VALUE "ProductVersion", "39.0.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit a9b5b68

Please sign in to comment.