Skip to content

Commit 8c775ed

Browse files
committed
Update to Chrome 57 (#200)
1 parent 63b4569 commit 8c775ed

File tree

249 files changed

+56656
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+56656
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
cef_binary*
1+
cef_binary_*/
2+
Release*/

phpdesktop-chrome57/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/Release/
2+
/Debug/
3+
ipch/
4+
*.ncb
5+
*.db
6+
*.opendb
7+
*.suo
8+
*.user
9+
*.aps
10+
*.sdf
11+
*.opensdf
12+
*.dll
13+
*.exe
14+
debug.log
15+
*.lib
16+
php/*.bat
17+
php/*.phar
18+
php/*.gif
19+
php/*.txt
20+
php/*.manifest
21+
!php/!README.txt

phpdesktop-chrome57/AUTHORS.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Core developers:
2+
Czarek Tomczak <czarek.tomczak@@gmail.com>
3+
4+
Contributors (in order of first commit):
5+
-
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
2+
<asmv3:application>
3+
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
4+
<dpiAware>true</dpiAware>
5+
</asmv3:windowsSettings>
6+
</asmv3:application>
7+
</assembly>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3+
<assemblyIdentity version="1.0.0.0"
4+
processorArchitecture="X86"
5+
name="IsUserAdmin"
6+
type="win32"/>
7+
<description>Description of your application</description>
8+
<!-- Identify the application security requirements. -->
9+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
10+
<security>
11+
<requestedPrivileges>
12+
<requestedExecutionLevel
13+
level="requireAdministrator"
14+
uiAccess="false"/>
15+
</requestedPrivileges>
16+
</security>
17+
</trustInfo>
18+
</assembly>

phpdesktop-chrome57/cef/README.txt

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
Chromium Embedded Framework (CEF) Standard Binary Distribution for Windows
2+
-------------------------------------------------------------------------------
3+
4+
Date: March 17, 2017
5+
6+
CEF Version: 3.2987.1596.gc2b4638
7+
CEF URL: https://bitbucket.org/chromiumembedded/cef.git
8+
@c2b4638063e34456360cc4baec4cf914df41720c
9+
10+
Chromium Verison: 57.0.2987.98
11+
Chromium URL: https://chromium.googlesource.com/chromium/src.git
12+
@a6a06b78087c9fdb4b12fe0ac1b87fdc10179f8b
13+
14+
This distribution contains all components necessary to build and distribute an
15+
application using CEF on the Windows platform. Please see the LICENSING
16+
section of this document for licensing terms and conditions.
17+
18+
19+
CONTENTS
20+
--------
21+
22+
cmake Contains CMake configuration files shared by all targets.
23+
24+
Debug Contains libcef.dll, libcef.lib and other components required to
25+
build and run the debug version of CEF-based applications. By
26+
default these files should be placed in the same directory as the
27+
executable and will be copied there as part of the build process.
28+
29+
include Contains all required CEF header files.
30+
31+
libcef_dll Contains the source code for the libcef_dll_wrapper static library
32+
that all applications using the CEF C++ API must link against.
33+
34+
Release Contains libcef.dll, libcef.lib and other components required to
35+
build and run the release version of CEF-based applications. By
36+
default these files should be placed in the same directory as the
37+
executable and will be copied there as part of the build process.
38+
39+
Resources Contains resources required by libcef.dll. By default these files
40+
should be placed in the same directory as libcef.dll and will be
41+
copied there as part of the build process.
42+
43+
tests/ Directory of tests that demonstrate CEF usage.
44+
45+
cefclient Contains the cefclient sample application configured to build
46+
using the files in this distribution. This application demonstrates
47+
a wide range of CEF functionalities.
48+
49+
cefsimple Contains the cefsimple sample application configured to build
50+
using the files in this distribution. This application demonstrates
51+
the minimal functionality required to create a browser window.
52+
53+
ceftests Contains unit tests that exercise the CEF APIs.
54+
55+
gtest Contains the Google C++ Testing Framework used by the ceftests
56+
target.
57+
58+
shared Contains source code shared by the cefclient and ceftests targets.
59+
60+
61+
USAGE
62+
-----
63+
64+
Building using CMake:
65+
CMake can be used to generate project files in many different formats. See
66+
usage instructions at the top of the CMakeLists.txt file.
67+
68+
Please visit the CEF Website for additional usage information.
69+
70+
https://bitbucket.org/chromiumembedded/cef/
71+
72+
73+
REDISTRIBUTION
74+
--------------
75+
76+
This binary distribution contains the below components.
77+
78+
Required components:
79+
80+
The following components are required. CEF will not function without them.
81+
82+
* CEF core library.
83+
* libcef.dll
84+
85+
* Crash reporting library.
86+
* chrome_elf.dll
87+
88+
* Unicode support data.
89+
* icudtl.dat
90+
91+
* V8 snapshot data.
92+
* natives_blob.bin
93+
* snapshot_blob.bin
94+
95+
Optional components:
96+
97+
The following components are optional. If they are missing CEF will continue to
98+
run but any related functionality may become broken or disabled.
99+
100+
* Localized resources.
101+
Locale file loading can be disabled completely using
102+
CefSettings.pack_loading_disabled. The locales directory path can be
103+
customized using CefSettings.locales_dir_path.
104+
105+
* locales/
106+
Directory containing localized resources used by CEF, Chromium and Blink. A
107+
.pak file is loaded from this directory based on the CefSettings.locale
108+
value. Only configured locales need to be distributed. If no locale is
109+
configured the default locale of "en-US" will be used. Without these files
110+
arbitrary Web components may display incorrectly.
111+
112+
* Other resources.
113+
Pack file loading can be disabled completely using
114+
CefSettings.pack_loading_disabled. The resources directory path can be
115+
customized using CefSettings.resources_dir_path.
116+
117+
* cef.pak
118+
* cef_100_percent.pak
119+
* cef_200_percent.pak
120+
These files contain non-localized resources used by CEF, Chromium and Blink.
121+
Without these files arbitrary Web components may display incorrectly.
122+
123+
* cef_extensions.pak
124+
This file contains non-localized resources required for extension loading.
125+
Pass the `--disable-extensions` command-line flag to disable use of this
126+
file. Without this file components that depend on the extension system,
127+
such as the PDF viewer, will not function.
128+
129+
* devtools_resources.pak
130+
This file contains non-localized resources required for Chrome Developer
131+
Tools. Without this file Chrome Developer Tools will not function.
132+
133+
* Angle and Direct3D support.
134+
* d3dcompiler_43.dll (required for Windows XP)
135+
* d3dcompiler_47.dll (required for Windows Vista and newer)
136+
* libEGL.dll
137+
* libGLESv2.dll
138+
Without these files HTML5 accelerated content like 2D canvas, 3D CSS and WebGL
139+
will not function.
140+
141+
* Widevine CDM support.
142+
* widevinecdmadapter.dll
143+
Without this file playback of Widevine projected content will not function.
144+
See the CefRegisterWidevineCdm() function in cef_web_plugin.h for usage.
145+
146+
147+
LICENSING
148+
---------
149+
150+
The CEF project is BSD licensed. Please read the LICENSE.txt file included with
151+
this binary distribution for licensing terms and conditions. Other software
152+
included in this distribution is provided under other licenses. Please visit
153+
"about:credits" in a CEF-based application for complete Chromium and third-party
154+
licensing information.

phpdesktop-chrome57/cef/app.cpp

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
// Copyright (c) 2012-2014 The PHP Desktop authors. All rights reserved.
2+
// License: New BSD License.
3+
// Website: http://code.google.com/p/phpdesktop/
4+
5+
#pragma comment(lib, "libcef.lib")
6+
#pragma comment(lib, "libcef_dll_wrapper.lib")
7+
8+
#include "app.h"
9+
#include <string>
10+
#include "util.h"
11+
12+
#include "include/cef_browser.h"
13+
#include "include/cef_command_line.h"
14+
#include "app.h"
15+
#include "../log.h"
16+
#include "client_handler.h"
17+
#include "../settings.h"
18+
#include "javascript_api.h"
19+
20+
// ----------------------------------------------------------------------------
21+
// CefRenderProcessHandler methods
22+
// ----------------------------------------------------------------------------
23+
24+
///
25+
// Called when a new message is received from a different process. Return true
26+
// if the message was handled or false otherwise. Do not keep a reference to
27+
// or attempt to access the message outside of this callback.
28+
///
29+
/*--cef()--*/
30+
bool App::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
31+
CefProcessId source_process,
32+
CefRefPtr<CefProcessMessage> message) {
33+
LOG_DEBUG << "renderer[" << browser->GetIdentifier() << "] "
34+
<< "OnProcessMessageReceived: " << message->GetName().ToString();
35+
if (message->GetName() == "SetIsFullscreen") {
36+
CefRefPtr<CefListValue> args = message->GetArgumentList();
37+
bool isFullscreen = args->GetBool(0);
38+
CefRefPtr<JavascriptApi> javascriptApi = GetJavascriptApi(browser);
39+
if (javascriptApi.get()) {
40+
javascriptApi->SetIsFullscreen(isFullscreen);
41+
}
42+
return true;
43+
}
44+
LOG_ERROR << "Unhandled message in OnProcessMessageReceived";
45+
return false;
46+
}
47+
48+
///
49+
// Called immediately after the V8 context for a frame has been created. To
50+
// retrieve the JavaScript 'window' object use the CefV8Context::GetGlobal()
51+
// method. V8 handles can only be accessed from the thread on which they are
52+
// created. A task runner for posting tasks on the associated thread can be
53+
// retrieved via the CefV8Context::GetTaskRunner() method.
54+
///
55+
/*--cef()--*/
56+
void App::OnContextCreated(CefRefPtr<CefBrowser> browser,
57+
CefRefPtr<CefFrame> frame,
58+
CefRefPtr<CefV8Context> context) {
59+
// RENDERER PROCESS.
60+
LOG_DEBUG << "OnContextCreated()";
61+
CefRefPtr<CefV8Value> window = context->GetGlobal();
62+
CefRefPtr<CefV8Handler> handler = GetJavascriptApi(browser);
63+
if (!handler.get()) {
64+
LOG_ERROR << "GetJavascriptApi() failed in OnContextCreated()";
65+
return;
66+
}
67+
// Javascipt bindings.
68+
// The phpdesktop object.
69+
CefRefPtr<CefV8Value> phpdesktop = CefV8Value::CreateObject(NULL, NULL);
70+
window->SetValue("phpdesktop", phpdesktop, V8_PROPERTY_ATTRIBUTE_READONLY);
71+
// Methods.
72+
const char* methods[] = {
73+
"GetVersion",
74+
"ToggleFullscreen",
75+
"IsFullscreen",
76+
NULL
77+
};
78+
for (int i = 0; methods[i] != NULL; i++) {
79+
CefRefPtr<CefV8Value> method = CefV8Value::CreateFunction(
80+
methods[i], handler);
81+
phpdesktop->SetValue(method->GetFunctionName(), method,
82+
V8_PROPERTY_ATTRIBUTE_READONLY);
83+
}
84+
}
85+
86+
///
87+
// Called after a browser has been created. When browsing cross-origin a new
88+
// browser will be created before the old browser with the same identifier is
89+
// destroyed.
90+
///
91+
/*--cef()--*/
92+
void App::OnBrowserCreated(CefRefPtr<CefBrowser> browser) {
93+
LOG_DEBUG << "OnBrowserCreated()";
94+
StoreJavascriptApi(browser, new JavascriptApi(browser));
95+
}
96+
97+
///
98+
// Called before a browser is destroyed.
99+
///
100+
/*--cef()--*/
101+
void App::OnBrowserDestroyed(CefRefPtr<CefBrowser> browser) {
102+
LOG_DEBUG << "OnBrowserDestroyed()";
103+
RemoveJavascriptApi(browser);
104+
}
105+
106+
// ----------------------------------------------------------------------------
107+
// CefApp methods
108+
// ----------------------------------------------------------------------------
109+
110+
///
111+
// Provides an opportunity to view and/or modify command-line arguments before
112+
// processing by CEF and Chromium. The |process_type| value will be empty for
113+
// the browser process. Do not keep a reference to the CefCommandLine object
114+
// passed to this method. The CefSettings.command_line_args_disabled value
115+
// can be used to start with an empty command-line object. Any values
116+
// specified in CefSettings that equate to command-line arguments will be set
117+
// before this method is called. Be cautious when using this method to modify
118+
// command-line arguments for non-browser processes as this may result in
119+
// undefined behavior including crashes.
120+
///
121+
/*--cef(optional_param=process_type)--*/
122+
void App::OnBeforeCommandLineProcessing(
123+
const CefString& process_type,
124+
CefRefPtr<CefCommandLine> command_line) {
125+
// May be called on any thread?
126+
if (process_type.empty()) {
127+
// Browser process.
128+
json_value* appSettings = GetApplicationSettings();
129+
json_value switches = (*appSettings)["chrome"]["command_line_switches"];
130+
if (switches.type == json_object) {
131+
int length = switches.u.object.length;
132+
for (int i = 0; i < length; i++) {
133+
std::string name = switches.u.object.values[i].name;
134+
std::string value = static_cast<const char*>(*switches.u.object.values[i].value);
135+
if (name.find("-") == 0) {
136+
LOG_WARNING << "Invalid command line switch: " << name;
137+
continue;
138+
}
139+
if (command_line->HasSwitch(name)) {
140+
if (value.empty()) {
141+
// Switch already set, do nothing.
142+
} else {
143+
std::string oldValue = command_line->GetSwitchValue(name);
144+
if (oldValue != value) {
145+
// Overwrite the switch with a new value.
146+
command_line->AppendSwitchWithValue(name, value);
147+
}
148+
}
149+
} else {
150+
if (value.empty()) {
151+
command_line->AppendSwitch(name);
152+
} else {
153+
command_line->AppendSwitchWithValue(name, value);
154+
}
155+
}
156+
}
157+
}
158+
}
159+
std::string process_name = "browser";
160+
if (!process_type.empty()) {
161+
process_name = process_type;
162+
}
163+
LOG_DEBUG << "Command line string for the " << process_name << " process: "
164+
<< command_line->GetCommandLineString().ToString();
165+
}
166+
167+
// ----------------------------------------------------------------------------
168+
// CefBrowserProcessHandler methods
169+
// ----------------------------------------------------------------------------
170+
171+
///
172+
// Called on the browser process UI thread immediately after the CEF context
173+
// has been initialized.
174+
///
175+
void App::OnContextInitialized() {
176+
REQUIRE_UI_THREAD();
177+
LOG_DEBUG << "App::OnContextInitialized()";
178+
}
179+

0 commit comments

Comments
 (0)