Skip to content

Commit

Permalink
Update to Chrome 57 (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
cztomczak committed Mar 22, 2017
1 parent 63b4569 commit 8c775ed
Show file tree
Hide file tree
Showing 249 changed files with 56,656 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
cef_binary*
cef_binary_*/
Release*/
21 changes: 21 additions & 0 deletions phpdesktop-chrome57/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/Release/
/Debug/
ipch/
*.ncb
*.db
*.opendb
*.suo
*.user
*.aps
*.sdf
*.opensdf
*.dll
*.exe
debug.log
*.lib
php/*.bat
php/*.phar
php/*.gif
php/*.txt
php/*.manifest
!php/!README.txt
5 changes: 5 additions & 0 deletions phpdesktop-chrome57/AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Core developers:
Czarek Tomczak <czarek.tomczak@@gmail.com>

Contributors (in order of first commit):
-
7 changes: 7 additions & 0 deletions phpdesktop-chrome57/DeclareDPIAware.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
18 changes: 18 additions & 0 deletions phpdesktop-chrome57/RequireAdministrator.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="IsUserAdmin"
type="win32"/>
<description>Description of your application</description>
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
154 changes: 154 additions & 0 deletions phpdesktop-chrome57/cef/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
Chromium Embedded Framework (CEF) Standard Binary Distribution for Windows
-------------------------------------------------------------------------------

Date: March 17, 2017

CEF Version: 3.2987.1596.gc2b4638
CEF URL: https://bitbucket.org/chromiumembedded/cef.git
@c2b4638063e34456360cc4baec4cf914df41720c

Chromium Verison: 57.0.2987.98
Chromium URL: https://chromium.googlesource.com/chromium/src.git
@a6a06b78087c9fdb4b12fe0ac1b87fdc10179f8b

This distribution contains all components necessary to build and distribute an
application using CEF on the Windows platform. Please see the LICENSING
section of this document for licensing terms and conditions.


CONTENTS
--------

cmake Contains CMake configuration files shared by all targets.

Debug Contains libcef.dll, libcef.lib and other components required to
build and run the debug version of CEF-based applications. By
default these files should be placed in the same directory as the
executable and will be copied there as part of the build process.

include Contains all required CEF header files.

libcef_dll Contains the source code for the libcef_dll_wrapper static library
that all applications using the CEF C++ API must link against.

Release Contains libcef.dll, libcef.lib and other components required to
build and run the release version of CEF-based applications. By
default these files should be placed in the same directory as the
executable and will be copied there as part of the build process.

Resources Contains resources required by libcef.dll. By default these files
should be placed in the same directory as libcef.dll and will be
copied there as part of the build process.

tests/ Directory of tests that demonstrate CEF usage.

cefclient Contains the cefclient sample application configured to build
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.

ceftests Contains unit tests that exercise the CEF APIs.

gtest Contains the Google C++ Testing Framework used by the ceftests
target.

shared Contains source code shared by the cefclient and ceftests targets.


USAGE
-----

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.

Please visit the CEF Website for additional usage information.

https://bitbucket.org/chromiumembedded/cef/


REDISTRIBUTION
--------------

This binary distribution contains the below components.

Required components:

The following components are required. CEF will not function without them.

* CEF core library.
* libcef.dll

* Crash reporting library.
* chrome_elf.dll

* Unicode support data.
* icudtl.dat

* V8 snapshot data.
* natives_blob.bin
* snapshot_blob.bin

Optional components:

The following components are optional. If they are missing CEF will continue to
run but any related functionality may become broken or disabled.

* Localized resources.
Locale file loading can be disabled completely using
CefSettings.pack_loading_disabled. The locales directory path can be
customized using CefSettings.locales_dir_path.

* locales/
Directory containing localized resources used by CEF, Chromium and Blink. A
.pak file is loaded from this directory based on the CefSettings.locale
value. Only configured locales need to be distributed. If no locale is
configured the default locale of "en-US" will be used. Without these files
arbitrary Web components may display incorrectly.

* Other resources.
Pack file loading can be disabled completely using
CefSettings.pack_loading_disabled. The resources directory path can be
customized using CefSettings.resources_dir_path.

* cef.pak
* cef_100_percent.pak
* cef_200_percent.pak
These files contain non-localized resources used by CEF, Chromium and Blink.
Without these files arbitrary Web components may display incorrectly.

* cef_extensions.pak
This file contains non-localized resources required for extension loading.
Pass the `--disable-extensions` command-line flag to disable use of this
file. Without this file components that depend on the extension system,
such as the PDF viewer, will not function.

* devtools_resources.pak
This file contains non-localized resources required for Chrome Developer
Tools. Without this file Chrome Developer Tools will not function.

* Angle and Direct3D support.
* d3dcompiler_43.dll (required for Windows XP)
* d3dcompiler_47.dll (required for Windows Vista and newer)
* libEGL.dll
* libGLESv2.dll
Without these files HTML5 accelerated content like 2D canvas, 3D CSS and WebGL
will not function.

* Widevine CDM support.
* widevinecdmadapter.dll
Without this file playback of Widevine projected content will not function.
See the CefRegisterWidevineCdm() function in cef_web_plugin.h for usage.


LICENSING
---------

The CEF project is BSD licensed. Please read the LICENSE.txt file included with
this binary distribution for licensing terms and conditions. Other software
included in this distribution is provided under other licenses. Please visit
"about:credits" in a CEF-based application for complete Chromium and third-party
licensing information.
179 changes: 179 additions & 0 deletions phpdesktop-chrome57/cef/app.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
// Copyright (c) 2012-2014 The PHP Desktop authors. All rights reserved.
// License: New BSD License.
// Website: http://code.google.com/p/phpdesktop/

#pragma comment(lib, "libcef.lib")
#pragma comment(lib, "libcef_dll_wrapper.lib")

#include "app.h"
#include <string>
#include "util.h"

#include "include/cef_browser.h"
#include "include/cef_command_line.h"
#include "app.h"
#include "../log.h"
#include "client_handler.h"
#include "../settings.h"
#include "javascript_api.h"

// ----------------------------------------------------------------------------
// CefRenderProcessHandler methods
// ----------------------------------------------------------------------------

///
// Called when a new message is received from a different process. Return true
// if the message was handled or false otherwise. Do not keep a reference to
// or attempt to access the message outside of this callback.
///
/*--cef()--*/
bool App::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
CefProcessId source_process,
CefRefPtr<CefProcessMessage> message) {
LOG_DEBUG << "renderer[" << browser->GetIdentifier() << "] "
<< "OnProcessMessageReceived: " << message->GetName().ToString();
if (message->GetName() == "SetIsFullscreen") {
CefRefPtr<CefListValue> args = message->GetArgumentList();
bool isFullscreen = args->GetBool(0);
CefRefPtr<JavascriptApi> javascriptApi = GetJavascriptApi(browser);
if (javascriptApi.get()) {
javascriptApi->SetIsFullscreen(isFullscreen);
}
return true;
}
LOG_ERROR << "Unhandled message in OnProcessMessageReceived";
return false;
}

///
// Called immediately after the V8 context for a frame has been created. To
// retrieve the JavaScript 'window' object use the CefV8Context::GetGlobal()
// method. V8 handles can only be accessed from the thread on which they are
// created. A task runner for posting tasks on the associated thread can be
// retrieved via the CefV8Context::GetTaskRunner() method.
///
/*--cef()--*/
void App::OnContextCreated(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Context> context) {
// RENDERER PROCESS.
LOG_DEBUG << "OnContextCreated()";
CefRefPtr<CefV8Value> window = context->GetGlobal();
CefRefPtr<CefV8Handler> handler = GetJavascriptApi(browser);
if (!handler.get()) {
LOG_ERROR << "GetJavascriptApi() failed in OnContextCreated()";
return;
}
// Javascipt bindings.
// The phpdesktop object.
CefRefPtr<CefV8Value> phpdesktop = CefV8Value::CreateObject(NULL, NULL);
window->SetValue("phpdesktop", phpdesktop, V8_PROPERTY_ATTRIBUTE_READONLY);
// Methods.
const char* methods[] = {
"GetVersion",
"ToggleFullscreen",
"IsFullscreen",
NULL
};
for (int i = 0; methods[i] != NULL; i++) {
CefRefPtr<CefV8Value> method = CefV8Value::CreateFunction(
methods[i], handler);
phpdesktop->SetValue(method->GetFunctionName(), method,
V8_PROPERTY_ATTRIBUTE_READONLY);
}
}

///
// Called after a browser has been created. When browsing cross-origin a new
// browser will be created before the old browser with the same identifier is
// destroyed.
///
/*--cef()--*/
void App::OnBrowserCreated(CefRefPtr<CefBrowser> browser) {
LOG_DEBUG << "OnBrowserCreated()";
StoreJavascriptApi(browser, new JavascriptApi(browser));
}

///
// Called before a browser is destroyed.
///
/*--cef()--*/
void App::OnBrowserDestroyed(CefRefPtr<CefBrowser> browser) {
LOG_DEBUG << "OnBrowserDestroyed()";
RemoveJavascriptApi(browser);
}

// ----------------------------------------------------------------------------
// CefApp methods
// ----------------------------------------------------------------------------

///
// Provides an opportunity to view and/or modify command-line arguments before
// processing by CEF and Chromium. The |process_type| value will be empty for
// the browser process. Do not keep a reference to the CefCommandLine object
// passed to this method. The CefSettings.command_line_args_disabled value
// can be used to start with an empty command-line object. Any values
// specified in CefSettings that equate to command-line arguments will be set
// before this method is called. Be cautious when using this method to modify
// command-line arguments for non-browser processes as this may result in
// undefined behavior including crashes.
///
/*--cef(optional_param=process_type)--*/
void App::OnBeforeCommandLineProcessing(
const CefString& process_type,
CefRefPtr<CefCommandLine> command_line) {
// May be called on any thread?
if (process_type.empty()) {
// Browser process.
json_value* appSettings = GetApplicationSettings();
json_value switches = (*appSettings)["chrome"]["command_line_switches"];
if (switches.type == json_object) {
int length = switches.u.object.length;
for (int i = 0; i < length; i++) {
std::string name = switches.u.object.values[i].name;
std::string value = static_cast<const char*>(*switches.u.object.values[i].value);
if (name.find("-") == 0) {
LOG_WARNING << "Invalid command line switch: " << name;
continue;
}
if (command_line->HasSwitch(name)) {
if (value.empty()) {
// Switch already set, do nothing.
} else {
std::string oldValue = command_line->GetSwitchValue(name);
if (oldValue != value) {
// Overwrite the switch with a new value.
command_line->AppendSwitchWithValue(name, value);
}
}
} else {
if (value.empty()) {
command_line->AppendSwitch(name);
} else {
command_line->AppendSwitchWithValue(name, value);
}
}
}
}
}
std::string process_name = "browser";
if (!process_type.empty()) {
process_name = process_type;
}
LOG_DEBUG << "Command line string for the " << process_name << " process: "
<< command_line->GetCommandLineString().ToString();
}

// ----------------------------------------------------------------------------
// CefBrowserProcessHandler methods
// ----------------------------------------------------------------------------

///
// Called on the browser process UI thread immediately after the CEF context
// has been initialized.
///
void App::OnContextInitialized() {
REQUIRE_UI_THREAD();
LOG_DEBUG << "App::OnContextInitialized()";
}

Loading

0 comments on commit 8c775ed

Please sign in to comment.