mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-02 12:17:15 +01:00
Update to Chromium revision 47fb4821 (#318735).
- Remove the in-process PDF plugin implementation. A new implementation is now required (issue #1565). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2043 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
a9191b26d2
commit
ac4f451c94
@ -7,5 +7,5 @@
|
||||
# https://code.google.com/p/chromiumembedded/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': 'beafd8cb70f31a44502a9040af396b8cd61dcdb1',
|
||||
'chromium_checkout': '47fb4821713cf85fce53c5bae575343e97041681',
|
||||
}
|
||||
|
15
cef.gyp
15
cef.gyp
@ -863,9 +863,6 @@
|
||||
'<(DEPTH)/components/components.gyp:keyed_service_content',
|
||||
'<(DEPTH)/components/components.gyp:keyed_service_core',
|
||||
'<(DEPTH)/components/components.gyp:navigation_interception',
|
||||
'<(DEPTH)/components/components.gyp:pdf_browser',
|
||||
'<(DEPTH)/components/components.gyp:pdf_common',
|
||||
'<(DEPTH)/components/components.gyp:pdf_renderer',
|
||||
'<(DEPTH)/components/components.gyp:pref_registry',
|
||||
'<(DEPTH)/components/components.gyp:printing_common',
|
||||
'<(DEPTH)/components/components.gyp:printing_renderer',
|
||||
@ -886,17 +883,16 @@
|
||||
'<(DEPTH)/media/media.gyp:media',
|
||||
'<(DEPTH)/net/net.gyp:net',
|
||||
'<(DEPTH)/net/net.gyp:net_with_v8',
|
||||
'<(DEPTH)/pdf/pdf.gyp:pdf',
|
||||
'<(DEPTH)/skia/skia.gyp:skia',
|
||||
'<(DEPTH)/storage/storage_browser.gyp:storage',
|
||||
'<(DEPTH)/sync/sync.gyp:sync',
|
||||
'<(DEPTH)/third_party/hunspell/hunspell.gyp:hunspell',
|
||||
'<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
|
||||
'<(DEPTH)/third_party/re2/re2.gyp:re2',
|
||||
'<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
|
||||
'<(DEPTH)/third_party/WebKit/Source/core/core.gyp:webcore',
|
||||
'<(DEPTH)/third_party/zlib/zlib.gyp:minizip',
|
||||
'<(DEPTH)/ui/gl/gl.gyp:gl',
|
||||
'<(DEPTH)/ui/base/ime/ui_base_ime.gyp:ui_base_ime',
|
||||
'<(DEPTH)/ui/base/ui_base.gyp:ui_base',
|
||||
'<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
|
||||
# Necessary to generate the grit include files.
|
||||
@ -1152,8 +1148,6 @@
|
||||
'<(DEPTH)/chrome/browser/printing/printer_query.h',
|
||||
'<(DEPTH)/chrome/common/extensions/extension_constants.cc',
|
||||
'<(DEPTH)/chrome/common/extensions/extension_constants.h',
|
||||
'<(DEPTH)/chrome/renderer/pepper/chrome_pdf_print_client.cc',
|
||||
'<(DEPTH)/chrome/renderer/pepper/chrome_pdf_print_client.h',
|
||||
'<(DEPTH)/extensions/common/constants.cc',
|
||||
'<(DEPTH)/extensions/common/constants.h',
|
||||
# Include header for stub creation (BrowserProcess) so print_job_worker can
|
||||
@ -1199,6 +1193,10 @@
|
||||
],
|
||||
'conditions': [
|
||||
['OS=="win"', {
|
||||
'dependencies': [
|
||||
# For printing using PDF.
|
||||
'<(DEPTH)/pdf/pdf.gyp:pdf',
|
||||
],
|
||||
'sources': [
|
||||
'<@(includes_win)',
|
||||
'libcef/browser/browser_host_impl_win.cc',
|
||||
@ -1351,11 +1349,10 @@
|
||||
],
|
||||
'copies': [
|
||||
{
|
||||
# Copy binaries for HTML5 audio/video and PDF support.
|
||||
# Copy binaries for HTML5 audio/video support.
|
||||
'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
|
||||
'files': [
|
||||
'<(PRODUCT_DIR)/ffmpegsumo.so',
|
||||
'<(PRODUCT_DIR)/PDF.plugin',
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@ -36,10 +36,8 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/bind_helpers.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/spellchecker/spellcheck_factory.h"
|
||||
#include "chrome/browser/spellchecker/spellcheck_service.h"
|
||||
#include "components/pdf/common/pdf_messages.h"
|
||||
#include "content/browser/gpu/compositor_util.h"
|
||||
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
||||
#include "content/common/view_messages.h"
|
||||
@ -2558,13 +2556,6 @@ bool CefBrowserHostImpl::OnMessageReceived(const IPC::Message& message) {
|
||||
IPC_MESSAGE_HANDLER(CefHostMsg_Request, OnRequest)
|
||||
IPC_MESSAGE_HANDLER(CefHostMsg_Response, OnResponse)
|
||||
IPC_MESSAGE_HANDLER(CefHostMsg_ResponseAck, OnResponseAck)
|
||||
IPC_MESSAGE_HANDLER(PDFHostMsg_PDFHasUnsupportedFeature,
|
||||
OnPDFHasUnsupportedFeature)
|
||||
IPC_MESSAGE_HANDLER(PDFHostMsg_PDFSaveURLAs, OnPDFSaveURLAs)
|
||||
IPC_MESSAGE_HANDLER(PDFHostMsg_PDFUpdateContentRestrictions,
|
||||
OnPDFUpdateContentRestrictions)
|
||||
IPC_MESSAGE_HANDLER_DELAY_REPLY(PDFHostMsg_PDFModalPromptForPassword,
|
||||
OnPDFModalPromptForPassword)
|
||||
IPC_MESSAGE_UNHANDLED(handled = false)
|
||||
IPC_END_MESSAGE_MAP()
|
||||
return handled;
|
||||
@ -2659,38 +2650,6 @@ void CefBrowserHostImpl::OnResponseAck(int request_id) {
|
||||
response_manager_->RunAckHandler(request_id);
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::OnPDFHasUnsupportedFeature() {
|
||||
// TODO(cef): Use Adobe PDF plugin instead. See PDFHasUnsupportedFeature in
|
||||
// chrome/browser/ui/pdf/pdf_unsupported_feature.cc.
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::OnPDFSaveURLAs(
|
||||
const GURL& url,
|
||||
const content::Referrer& referrer) {
|
||||
web_contents()->SaveFrame(url, referrer);
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::OnPDFUpdateContentRestrictions(
|
||||
int content_restrictions) {
|
||||
// TODO(cef): Add support for communicating PDF content restrictions.
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::OnPDFModalPromptForPassword(
|
||||
const std::string& prompt,
|
||||
IPC::Message* reply_message) {
|
||||
// TODO(cef): Add support for PDF password prompt.
|
||||
OnPDFModalPromptForPasswordClosed(reply_message, false, base::string16());
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::OnPDFModalPromptForPasswordClosed(
|
||||
IPC::Message* reply_message,
|
||||
bool success,
|
||||
const base::string16& actual_value) {
|
||||
PDFHostMsg_PDFModalPromptForPassword::WriteReplyParams(
|
||||
reply_message, base::UTF16ToUTF8(actual_value));
|
||||
Send(reply_message);
|
||||
}
|
||||
|
||||
|
||||
// content::NotificationObserver methods.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -478,16 +478,6 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
void OnRequest(const Cef_Request_Params& params);
|
||||
void OnResponse(const Cef_Response_Params& params);
|
||||
void OnResponseAck(int request_id);
|
||||
void OnPDFHasUnsupportedFeature();
|
||||
void OnPDFSaveURLAs(const GURL& url,
|
||||
const content::Referrer& referrer);
|
||||
void OnPDFUpdateContentRestrictions(int content_restrictions);
|
||||
void OnPDFModalPromptForPassword(const std::string& prompt,
|
||||
IPC::Message* reply_message);
|
||||
|
||||
void OnPDFModalPromptForPasswordClosed(IPC::Message* reply_message,
|
||||
bool success,
|
||||
const base::string16& actual_value);
|
||||
|
||||
// content::NotificationObserver methods.
|
||||
void Observe(int type,
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "content/public/browser/web_ui_controller_factory.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "net/base/net_module.h"
|
||||
#include "net/proxy/proxy_resolver_v8.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
|
||||
#if defined(USE_AURA)
|
||||
@ -115,9 +114,6 @@ int CefBrowserMainParts::PreCreateThreads() {
|
||||
pref_store_->SetInitializationCompleted();
|
||||
pref_service_ = pref_store_->CreateService().Pass();
|
||||
|
||||
// Initialize the V8 proxy integration.
|
||||
net::ProxyResolverV8::EnsureIsolateCreated();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -239,6 +239,12 @@ component_updater::PnaclComponentInstaller*
|
||||
return NULL;
|
||||
}
|
||||
|
||||
component_updater::SupervisedUserWhitelistInstaller*
|
||||
ChromeBrowserProcessStub::supervised_user_whitelist_installer() {
|
||||
NOTIMPLEMENTED();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MediaFileSystemRegistry*
|
||||
ChromeBrowserProcessStub::media_file_system_registry() {
|
||||
NOTIMPLEMENTED();
|
||||
|
@ -86,6 +86,8 @@ class ChromeBrowserProcessStub : public BrowserProcess {
|
||||
CRLSetFetcher* crl_set_fetcher() override;
|
||||
component_updater::PnaclComponentInstaller*
|
||||
pnacl_component_installer() override;
|
||||
component_updater::SupervisedUserWhitelistInstaller*
|
||||
supervised_user_whitelist_installer() override;
|
||||
MediaFileSystemRegistry*
|
||||
media_file_system_registry() override;
|
||||
bool created_local_state() const override;
|
||||
|
@ -932,7 +932,6 @@ void CefContentBrowserClient::ResourceDispatcherHostCreated() {
|
||||
|
||||
void CefContentBrowserClient::OverrideWebkitPrefs(
|
||||
content::RenderViewHost* rvh,
|
||||
const GURL& url,
|
||||
content::WebPreferences* prefs) {
|
||||
const base::CommandLine* command_line =
|
||||
base::CommandLine::ForCurrentProcess();
|
||||
|
@ -132,7 +132,6 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
||||
bool* no_javascript_access) override;
|
||||
void ResourceDispatcherHostCreated() override;
|
||||
void OverrideWebkitPrefs(content::RenderViewHost* rvh,
|
||||
const GURL& url,
|
||||
content::WebPreferences* prefs) override;
|
||||
SkColor GetBaseBackgroundColor(content::RenderViewHost* rvh) override;
|
||||
void BrowserURLHandlerCreated(
|
||||
|
@ -545,6 +545,7 @@ void CefCookieManagerImpl::SetCookieInternal(
|
||||
expiration_time,
|
||||
cookie.secure ? true : false,
|
||||
cookie.httponly ? true : false,
|
||||
false, // First-party only.
|
||||
net::COOKIE_PRIORITY_DEFAULT,
|
||||
base::Bind(SetCookieCallbackImpl, callback));
|
||||
}
|
||||
|
@ -12,19 +12,80 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/json/json_writer.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/devtools_http_handler.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/common/content_client.h"
|
||||
#include "net/base/net_util.h"
|
||||
#include "third_party/skia/include/core/SkColor.h"
|
||||
#include "net/base/io_buffer.h"
|
||||
#include "net/base/net_errors.h"
|
||||
#include "net/http/http_response_headers.h"
|
||||
#include "net/url_request/url_fetcher.h"
|
||||
#include "net/url_request/url_fetcher_response_writer.h"
|
||||
|
||||
namespace {
|
||||
|
||||
|
||||
// ResponseWriter -------------------------------------------------------------
|
||||
|
||||
class ResponseWriter : public net::URLFetcherResponseWriter {
|
||||
public:
|
||||
ResponseWriter(base::WeakPtr<CefDevToolsFrontend> devtools_,
|
||||
int stream_id);
|
||||
~ResponseWriter() override;
|
||||
|
||||
// URLFetcherResponseWriter overrides:
|
||||
int Initialize(const net::CompletionCallback& callback) override;
|
||||
int Write(net::IOBuffer* buffer,
|
||||
int num_bytes,
|
||||
const net::CompletionCallback& callback) override;
|
||||
int Finish(const net::CompletionCallback& callback) override;
|
||||
|
||||
private:
|
||||
base::WeakPtr<CefDevToolsFrontend> devtools_;
|
||||
int stream_id_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ResponseWriter);
|
||||
};
|
||||
|
||||
ResponseWriter::ResponseWriter(
|
||||
base::WeakPtr<CefDevToolsFrontend> devtools,
|
||||
int stream_id)
|
||||
: devtools_(devtools),
|
||||
stream_id_(stream_id) {
|
||||
}
|
||||
|
||||
ResponseWriter::~ResponseWriter() {
|
||||
}
|
||||
|
||||
int ResponseWriter::Initialize(const net::CompletionCallback& callback) {
|
||||
return net::OK;
|
||||
}
|
||||
|
||||
int ResponseWriter::Write(net::IOBuffer* buffer,
|
||||
int num_bytes,
|
||||
const net::CompletionCallback& callback) {
|
||||
base::FundamentalValue* id = new base::FundamentalValue(stream_id_);
|
||||
base::StringValue* chunk =
|
||||
new base::StringValue(std::string(buffer->data(), num_bytes));
|
||||
|
||||
content::BrowserThread::PostTask(
|
||||
content::BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(&CefDevToolsFrontend::CallClientFunction,
|
||||
devtools_, "DevToolsAPI.streamWrite",
|
||||
base::Owned(id), base::Owned(chunk), nullptr));
|
||||
return num_bytes;
|
||||
}
|
||||
|
||||
int ResponseWriter::Finish(const net::CompletionCallback& callback) {
|
||||
return net::OK;
|
||||
}
|
||||
|
||||
// This constant should be in sync with
|
||||
// the constant at devtools_ui_bindings.cc.
|
||||
const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4;
|
||||
@ -82,21 +143,36 @@ void CefDevToolsFrontend::Focus() {
|
||||
web_contents()->Focus();
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::InspectElementAt(int x, int y) {
|
||||
if (agent_host_)
|
||||
agent_host_->InspectElement(x, y);
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::Close() {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(&CefBrowserHostImpl::CloseBrowser, frontend_browser_.get(),
|
||||
true));
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::DisconnectFromTarget() {
|
||||
if (!agent_host_)
|
||||
return;
|
||||
agent_host_->DetachClient();
|
||||
agent_host_ = NULL;
|
||||
}
|
||||
|
||||
CefDevToolsFrontend::CefDevToolsFrontend(
|
||||
CefRefPtr<CefBrowserHostImpl> frontend_browser,
|
||||
content::DevToolsAgentHost* agent_host)
|
||||
: WebContentsObserver(frontend_browser->GetWebContents()),
|
||||
frontend_browser_(frontend_browser),
|
||||
agent_host_(agent_host) {
|
||||
agent_host_(agent_host),
|
||||
weak_factory_(this) {
|
||||
}
|
||||
|
||||
CefDevToolsFrontend::~CefDevToolsFrontend() {
|
||||
for (const auto& pair : pending_requests_)
|
||||
delete pair.first;
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::RenderViewCreated(
|
||||
@ -105,19 +181,27 @@ void CefDevToolsFrontend::RenderViewCreated(
|
||||
frontend_host_.reset(
|
||||
content::DevToolsFrontendHost::Create(
|
||||
web_contents()->GetMainFrame(), this));
|
||||
agent_host_->AttachClient(this);
|
||||
}
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::DidNavigateMainFrame(
|
||||
const content::LoadCommittedDetails& details,
|
||||
const content::FrameNavigateParams& params) {
|
||||
if (agent_host_)
|
||||
agent_host_->AttachClient(this);
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::WebContentsDestroyed() {
|
||||
agent_host_->DetachClient();
|
||||
if (agent_host_)
|
||||
agent_host_->DetachClient();
|
||||
delete this;
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
||||
const std::string& message) {
|
||||
if (!agent_host_)
|
||||
return;
|
||||
std::string method;
|
||||
int id = 0;
|
||||
base::ListValue* params = NULL;
|
||||
base::DictionaryValue* dict = NULL;
|
||||
scoped_ptr<base::Value> parsed_message(base::JSONReader::Read(message));
|
||||
@ -126,6 +210,8 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
||||
!dict->GetString("method", &method)) {
|
||||
return;
|
||||
}
|
||||
int request_id = 0;
|
||||
dict->GetInteger("id", &request_id);
|
||||
dict->GetList("params", ¶ms);
|
||||
|
||||
std::string browser_message;
|
||||
@ -135,22 +221,47 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
|
||||
} else if (method == "loadCompleted") {
|
||||
web_contents()->GetMainFrame()->ExecuteJavaScript(
|
||||
base::ASCIIToUTF16("DevToolsAPI.setUseSoftMenu(true);"));
|
||||
} else if (method == "loadNetworkResource" && params->GetSize() == 3) {
|
||||
// TODO(pfeldman): handle some of the embedder messages in content.
|
||||
std::string url;
|
||||
std::string headers;
|
||||
int stream_id;
|
||||
if (!params->GetString(0, &url) ||
|
||||
!params->GetString(1, &headers) ||
|
||||
!params->GetInteger(2, &stream_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GURL gurl(url);
|
||||
if (!gurl.is_valid()) {
|
||||
base::DictionaryValue response;
|
||||
response.SetInteger("statusCode", 404);
|
||||
SendMessageAck(request_id, &response);
|
||||
return;
|
||||
}
|
||||
|
||||
net::URLFetcher* fetcher =
|
||||
net::URLFetcher::Create(gurl, net::URLFetcher::GET, this);
|
||||
pending_requests_[fetcher] = request_id;
|
||||
fetcher->SetRequestContext(web_contents()->GetBrowserContext()->
|
||||
GetRequestContext());
|
||||
fetcher->SetExtraRequestHeaders(headers);
|
||||
fetcher->SaveResponseWithWriter(scoped_ptr<net::URLFetcherResponseWriter>(
|
||||
new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id)));
|
||||
fetcher->Start();
|
||||
return;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
dict->GetInteger("id", &id);
|
||||
if (id) {
|
||||
std::string code = "DevToolsAPI.embedderMessageAck(" +
|
||||
base::IntToString(id) + ",\"\");";
|
||||
base::string16 javascript = base::UTF8ToUTF16(code);
|
||||
web_contents()->GetMainFrame()->ExecuteJavaScript(javascript);
|
||||
}
|
||||
if (request_id)
|
||||
SendMessageAck(request_id, nullptr);
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::HandleMessageFromDevToolsFrontendToBackend(
|
||||
const std::string& message) {
|
||||
agent_host_->DispatchProtocolMessage(message);
|
||||
if (agent_host_)
|
||||
agent_host_->DispatchProtocolMessage(message);
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::DispatchProtocolMessage(
|
||||
@ -174,6 +285,66 @@ void CefDevToolsFrontend::DispatchProtocolMessage(
|
||||
}
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::OnURLFetchComplete(const net::URLFetcher* source) {
|
||||
// TODO(pfeldman): this is a copy of chrome's devtools_ui_bindings.cc.
|
||||
// We should handle some of the commands including this one in content.
|
||||
DCHECK(source);
|
||||
PendingRequestsMap::iterator it = pending_requests_.find(source);
|
||||
DCHECK(it != pending_requests_.end());
|
||||
|
||||
base::DictionaryValue response;
|
||||
base::DictionaryValue* headers = new base::DictionaryValue();
|
||||
net::HttpResponseHeaders* rh = source->GetResponseHeaders();
|
||||
response.SetInteger("statusCode", rh ? rh->response_code() : 200);
|
||||
response.Set("headers", headers);
|
||||
|
||||
void* iterator = NULL;
|
||||
std::string name;
|
||||
std::string value;
|
||||
while (rh && rh->EnumerateHeaderLines(&iterator, &name, &value))
|
||||
headers->SetString(name, value);
|
||||
|
||||
SendMessageAck(it->second, &response);
|
||||
pending_requests_.erase(it);
|
||||
delete source;
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::CallClientFunction(
|
||||
const std::string& function_name,
|
||||
const base::Value* arg1,
|
||||
const base::Value* arg2,
|
||||
const base::Value* arg3) {
|
||||
std::string javascript = function_name + "(";
|
||||
if (arg1) {
|
||||
std::string json;
|
||||
base::JSONWriter::Write(arg1, &json);
|
||||
javascript.append(json);
|
||||
if (arg2) {
|
||||
base::JSONWriter::Write(arg2, &json);
|
||||
javascript.append(", ").append(json);
|
||||
if (arg3) {
|
||||
base::JSONWriter::Write(arg3, &json);
|
||||
javascript.append(", ").append(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
javascript.append(");");
|
||||
web_contents()->GetMainFrame()->ExecuteJavaScript(
|
||||
base::UTF8ToUTF16(javascript));
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::SendMessageAck(int request_id,
|
||||
const base::Value* arg) {
|
||||
base::FundamentalValue id_value(request_id);
|
||||
CallClientFunction("DevToolsAPI.embedderMessageAck",
|
||||
&id_value, arg, nullptr);
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::AttachTo(content::WebContents* inspected_contents) {
|
||||
DisconnectFromTarget();
|
||||
agent_host_ = content::DevToolsAgentHost::GetOrCreateFor(inspected_contents);
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::AgentHostClosed(
|
||||
content::DevToolsAgentHost* agent_host,
|
||||
bool replaced) {
|
||||
|
@ -11,9 +11,15 @@
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "content/public/browser/devtools_agent_host.h"
|
||||
#include "content/public/browser/devtools_frontend_host.h"
|
||||
#include "content/public/browser/web_contents_observer.h"
|
||||
#include "net/url_request/url_fetcher_delegate.h"
|
||||
|
||||
namespace base {
|
||||
class Value;
|
||||
}
|
||||
|
||||
namespace content {
|
||||
class RenderViewHost;
|
||||
@ -22,7 +28,8 @@ class WebContents;
|
||||
|
||||
class CefDevToolsFrontend : public content::WebContentsObserver,
|
||||
public content::DevToolsFrontendHost::Delegate,
|
||||
public content::DevToolsAgentHostClient {
|
||||
public content::DevToolsAgentHostClient,
|
||||
public net::URLFetcherDelegate {
|
||||
public:
|
||||
static CefDevToolsFrontend* Show(
|
||||
CefRefPtr<CefBrowserHostImpl> inspected_browser,
|
||||
@ -33,39 +40,56 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
|
||||
|
||||
void Activate();
|
||||
void Focus();
|
||||
void InspectElementAt(int x, int y);
|
||||
void Close();
|
||||
|
||||
void DisconnectFromTarget();
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> frontend_browser() const {
|
||||
return frontend_browser_;
|
||||
}
|
||||
|
||||
void CallClientFunction(const std::string& function_name,
|
||||
const base::Value* arg1,
|
||||
const base::Value* arg2,
|
||||
const base::Value* arg3);
|
||||
|
||||
private:
|
||||
CefDevToolsFrontend(CefRefPtr<CefBrowserHostImpl> frontend_browser,
|
||||
content::DevToolsAgentHost* agent_host);
|
||||
~CefDevToolsFrontend() override;
|
||||
|
||||
// WebContentsObserver overrides.
|
||||
void RenderViewCreated(
|
||||
content::RenderViewHost* render_view_host) override;
|
||||
// content::DevToolsAgentHostClient implementation.
|
||||
void AgentHostClosed(content::DevToolsAgentHost* agent_host,
|
||||
bool replaced) override;
|
||||
void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host,
|
||||
const std::string& message) override;
|
||||
void AttachTo(content::WebContents* inspected_contents);
|
||||
|
||||
// WebContentsObserver overrides
|
||||
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
|
||||
void DidNavigateMainFrame(
|
||||
const content::LoadCommittedDetails& details,
|
||||
const content::FrameNavigateParams& params) override;
|
||||
void WebContentsDestroyed() override;
|
||||
|
||||
// content::DevToolsFrontendHost::Delegate implementation.
|
||||
void HandleMessageFromDevToolsFrontend(
|
||||
const std::string& message) override;
|
||||
void HandleMessageFromDevToolsFrontend(const std::string& message) override;
|
||||
void HandleMessageFromDevToolsFrontendToBackend(
|
||||
const std::string& message) override;
|
||||
|
||||
// content::DevToolsAgentHostClient implementation.
|
||||
void DispatchProtocolMessage(
|
||||
content::DevToolsAgentHost* agent_host,
|
||||
const std::string& message) override;
|
||||
void AgentHostClosed(
|
||||
content::DevToolsAgentHost* agent_host,
|
||||
bool replaced) override;
|
||||
// net::URLFetcherDelegate overrides.
|
||||
void OnURLFetchComplete(const net::URLFetcher* source) override;
|
||||
|
||||
void SendMessageAck(int request_id,
|
||||
const base::Value* arg1);
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> frontend_browser_;
|
||||
scoped_refptr<content::DevToolsAgentHost> agent_host_;
|
||||
scoped_ptr<content::DevToolsFrontendHost> frontend_host_;
|
||||
using PendingRequestsMap = std::map<const net::URLFetcher*, int>;
|
||||
PendingRequestsMap pending_requests_;
|
||||
base::WeakPtrFactory<CefDevToolsFrontend> weak_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefDevToolsFrontend);
|
||||
};
|
||||
|
@ -6,8 +6,8 @@
|
||||
#include "include/cef_trace.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
|
||||
#include "base/debug/trace_event.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "content/public/browser/tracing_controller.h"
|
||||
|
||||
namespace {
|
||||
@ -57,8 +57,8 @@ bool CefTraceSubscriber::BeginTracing(
|
||||
}
|
||||
|
||||
TracingController::GetInstance()->EnableRecording(
|
||||
base::debug::CategoryFilter(categories),
|
||||
base::debug::TraceOptions(),
|
||||
base::trace_event::CategoryFilter(categories),
|
||||
base::trace_event::TraceOptions(),
|
||||
done_callback);
|
||||
return true;
|
||||
}
|
||||
|
@ -6,9 +6,9 @@
|
||||
#include "include/internal/cef_logging_internal.h"
|
||||
#include "include/internal/cef_thread_internal.h"
|
||||
|
||||
#include "base/debug/trace_event.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/threading/platform_thread.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
|
||||
// The contents of this file are a compilation unit that is not called by other
|
||||
// functions in the the library. Consiquently MSVS will exclude it during the
|
||||
|
@ -10,60 +10,18 @@
|
||||
#include "libcef/common/scheme_registration.h"
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "content/public/common/pepper_plugin_info.h"
|
||||
#include "content/public/common/user_agent.h"
|
||||
#include "ppapi/shared_impl/ppapi_permissions.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
|
||||
namespace {
|
||||
|
||||
CefContentClient* g_content_client = NULL;
|
||||
|
||||
const char kPDFPluginName[] = "Chrome PDF Viewer";
|
||||
const char kPDFPluginMimeType[] = "application/pdf";
|
||||
const char kPDFPluginExtension[] = "pdf";
|
||||
const char kPDFPluginDescription[] = "Portable Document Format";
|
||||
const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE |
|
||||
ppapi::PERMISSION_DEV;
|
||||
|
||||
// Appends the known built-in plugins to the given vector.
|
||||
// Based on chrome/common/chrome_content_client.cc.
|
||||
void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
|
||||
// PDF.
|
||||
//
|
||||
// Once we're sandboxed, we can't know if the PDF plugin is available or not;
|
||||
// but (on Linux) this function is always called once before we're sandboxed.
|
||||
// So the first time through test if the file is available and then skip the
|
||||
// check on subsequent calls if yes.
|
||||
static bool skip_pdf_file_check = false;
|
||||
base::FilePath path;
|
||||
if (PathService::Get(chrome::FILE_PDF_PLUGIN, &path)) {
|
||||
if (skip_pdf_file_check || base::PathExists(path)) {
|
||||
content::PepperPluginInfo pdf;
|
||||
pdf.path = path;
|
||||
pdf.name = kPDFPluginName;
|
||||
// Only in-process loading is currently supported. See issue #1331.
|
||||
pdf.is_out_of_process = false;
|
||||
content::WebPluginMimeType pdf_mime_type(kPDFPluginMimeType,
|
||||
kPDFPluginExtension,
|
||||
kPDFPluginDescription);
|
||||
pdf.mime_types.push_back(pdf_mime_type);
|
||||
pdf.permissions = kPDFPluginPermissions;
|
||||
plugins->push_back(pdf);
|
||||
|
||||
skip_pdf_file_check = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
CefContentClient::CefContentClient(CefRefPtr<CefApp> application)
|
||||
@ -84,11 +42,6 @@ CefContentClient* CefContentClient::Get() {
|
||||
return g_content_client;
|
||||
}
|
||||
|
||||
void CefContentClient::AddPepperPlugins(
|
||||
std::vector<content::PepperPluginInfo>* plugins) {
|
||||
ComputeBuiltInPlugins(plugins);
|
||||
}
|
||||
|
||||
void CefContentClient::AddAdditionalSchemes(
|
||||
std::vector<std::string>* standard_schemes,
|
||||
std::vector<std::string>* savable_schemes) {
|
||||
|
@ -26,8 +26,6 @@ class CefContentClient : public content::ContentClient,
|
||||
static CefContentClient* Get();
|
||||
|
||||
// content::ContentClient methods.
|
||||
void AddPepperPlugins(
|
||||
std::vector<content::PepperPluginInfo>* plugins) override;
|
||||
void AddAdditionalSchemes(
|
||||
std::vector<std::string>* standard_schemes,
|
||||
std::vector<std::string>* savable_schemes) override;
|
||||
|
@ -84,10 +84,6 @@ base::FilePath GetResourcesFilePath() {
|
||||
return GetFrameworkBundlePath().Append(FILE_PATH_LITERAL("Resources"));
|
||||
}
|
||||
|
||||
base::FilePath GetLibrariesFilePath() {
|
||||
return GetFrameworkBundlePath().Append(FILE_PATH_LITERAL("Libraries"));
|
||||
}
|
||||
|
||||
void OverrideFrameworkBundlePath() {
|
||||
base::mac::SetOverrideFrameworkBundlePath(GetFrameworkBundlePath());
|
||||
}
|
||||
@ -116,10 +112,6 @@ base::FilePath GetResourcesFilePath() {
|
||||
return pak_dir;
|
||||
}
|
||||
|
||||
base::FilePath GetLibrariesFilePath() {
|
||||
return GetResourcesFilePath();
|
||||
}
|
||||
|
||||
#endif // !defined(OS_MACOSX)
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
@ -180,22 +172,6 @@ base::FilePath GetUserDataPath() {
|
||||
return result;
|
||||
}
|
||||
|
||||
// File name of the internal PDF plugin on different platforms.
|
||||
const base::FilePath::CharType kInternalPDFPluginFileName[] =
|
||||
#if defined(OS_WIN)
|
||||
FILE_PATH_LITERAL("pdf.dll");
|
||||
#elif defined(OS_MACOSX)
|
||||
FILE_PATH_LITERAL("PDF.plugin");
|
||||
#else // Linux and Chrome OS
|
||||
FILE_PATH_LITERAL("libpdf.so");
|
||||
#endif
|
||||
|
||||
void OverridePdfPluginPath() {
|
||||
base::FilePath plugin_path = GetLibrariesFilePath();
|
||||
plugin_path = plugin_path.Append(kInternalPDFPluginFileName);
|
||||
PathService::Override(chrome::FILE_PDF_PLUGIN, plugin_path);
|
||||
}
|
||||
|
||||
// Returns true if |scale_factor| is supported by this platform.
|
||||
// Same as ResourceBundle::IsScaleFactorSupported.
|
||||
bool IsScaleFactorSupported(ui::ScaleFactor scale_factor) {
|
||||
@ -489,17 +465,10 @@ void CefMainDelegate::PreSandboxStartup() {
|
||||
true); // Create if necessary.
|
||||
}
|
||||
|
||||
OverridePdfPluginPath();
|
||||
|
||||
if (command_line->HasSwitch(switches::kDisablePackLoading))
|
||||
content_client_.set_pack_loading_disabled(true);
|
||||
|
||||
InitializeResourceBundle();
|
||||
|
||||
if (process_type == switches::kUtilityProcess ||
|
||||
process_type == switches::kZygoteProcess) {
|
||||
CefContentUtilityClient::PreSandboxStartup();
|
||||
}
|
||||
}
|
||||
|
||||
int CefMainDelegate::RunProcess(
|
||||
|
@ -31,23 +31,19 @@ MSVC_POP_WARNING();
|
||||
#include "libcef/renderer/webkit_glue.h"
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "chrome/renderer/loadtimes_extension_bindings.h"
|
||||
#include "chrome/renderer/pepper/chrome_pdf_print_client.h"
|
||||
#include "chrome/renderer/spellchecker/spellcheck.h"
|
||||
#include "chrome/renderer/spellchecker/spellcheck_provider.h"
|
||||
#include "components/pdf/renderer/ppb_pdf_impl.h"
|
||||
#include "components/printing/renderer/print_web_view_helper.h"
|
||||
#include "components/web_cache/renderer/web_cache_render_process_observer.h"
|
||||
#include "content/child/child_thread.h"
|
||||
#include "content/child/worker_task_runner.h"
|
||||
#include "content/common/frame_messages.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/child/child_thread.h"
|
||||
#include "content/public/common/content_constants.h"
|
||||
#include "content/public/common/content_paths.h"
|
||||
#include "content/public/renderer/plugin_instance_throttler.h"
|
||||
@ -57,11 +53,9 @@ MSVC_POP_WARNING();
|
||||
#include "content/renderer/render_frame_impl.h"
|
||||
#include "ipc/ipc_sync_channel.h"
|
||||
#include "media/base/media.h"
|
||||
#include "ppapi/c/private/ppb_pdf.h"
|
||||
#include "third_party/WebKit/public/platform/WebPrerenderingSupport.h"
|
||||
#include "third_party/WebKit/public/platform/WebString.h"
|
||||
#include "third_party/WebKit/public/platform/WebURL.h"
|
||||
#include "third_party/WebKit/public/platform/WebWorkerRunLoop.h"
|
||||
#include "third_party/WebKit/public/web/WebDocument.h"
|
||||
#include "third_party/WebKit/public/web/WebElement.h"
|
||||
#include "third_party/WebKit/public/web/WebFrame.h"
|
||||
@ -74,10 +68,6 @@ MSVC_POP_WARNING();
|
||||
#include "third_party/WebKit/public/web/WebView.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "base/win/iat_patch_function.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
// Stub implementation of blink::WebPrerenderingSupport.
|
||||
@ -182,43 +172,6 @@ class CefPrintWebViewHelperDelegate :
|
||||
DISALLOW_COPY_AND_ASSIGN(CefPrintWebViewHelperDelegate);
|
||||
};
|
||||
|
||||
#if defined(OS_WIN)
|
||||
static base::win::IATPatchFunction g_iat_patch_createdca;
|
||||
HDC WINAPI CreateDCAPatch(LPCSTR driver_name,
|
||||
LPCSTR device_name,
|
||||
LPCSTR output,
|
||||
const void* init_data) {
|
||||
DCHECK(std::string("DISPLAY") == std::string(driver_name));
|
||||
DCHECK(!device_name);
|
||||
DCHECK(!output);
|
||||
DCHECK(!init_data);
|
||||
|
||||
// CreateDC fails behind the sandbox, but not CreateCompatibleDC.
|
||||
return CreateCompatibleDC(NULL);
|
||||
}
|
||||
|
||||
static base::win::IATPatchFunction g_iat_patch_get_font_data;
|
||||
DWORD WINAPI GetFontDataPatch(HDC hdc,
|
||||
DWORD table,
|
||||
DWORD offset,
|
||||
LPVOID buffer,
|
||||
DWORD length) {
|
||||
int rv = GetFontData(hdc, table, offset, buffer, length);
|
||||
if (rv == GDI_ERROR && hdc) {
|
||||
HFONT font = static_cast<HFONT>(GetCurrentObject(hdc, OBJ_FONT));
|
||||
|
||||
LOGFONT logfont;
|
||||
if (GetObject(font, sizeof(LOGFONT), &logfont)) {
|
||||
std::vector<char> font_data;
|
||||
content::RenderThread::Get()->PreCacheFont(logfont);
|
||||
rv = GetFontData(hdc, table, offset, buffer, length);
|
||||
content::RenderThread::Get()->ReleaseCachedFonts();
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
#endif // OS_WIN
|
||||
|
||||
} // namespace
|
||||
|
||||
CefContentRendererClient::CefContentRendererClient()
|
||||
@ -288,18 +241,9 @@ void CefContentRendererClient::WebKitInitialized() {
|
||||
// TODO(cef): Enable these once the implementation supports it.
|
||||
blink::WebRuntimeFeatures::enableNotifications(false);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Need to patch a few functions for font loading to work correctly.
|
||||
// From chrome/renderer/chrome_render_process_observer.cc.
|
||||
base::FilePath pdf;
|
||||
if (PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf) &&
|
||||
base::PathExists(pdf)) {
|
||||
g_iat_patch_createdca.Patch(
|
||||
pdf.value().c_str(), "gdi32.dll", "CreateDCA", CreateDCAPatch);
|
||||
g_iat_patch_get_font_data.Patch(
|
||||
pdf.value().c_str(), "gdi32.dll", "GetFontData", GetFontDataPatch);
|
||||
}
|
||||
#endif // defined(OS_WIN)
|
||||
// TODO(cef): Remove this line once off-screen rendering is fixed to work
|
||||
// with the new popup menu implementation (issue #1566).
|
||||
blink::WebRuntimeFeatures::enableFeatureFromString("HTMLPopupMenu", false);
|
||||
|
||||
const CefContentClient::SchemeInfoList* schemes =
|
||||
CefContentClient::Get()->GetCustomSchemes();
|
||||
@ -510,9 +454,6 @@ void CefContentRendererClient::RenderThreadStarted() {
|
||||
// Cross-origin entries need to be added after WebKit is initialized.
|
||||
cross_origin_whitelist_entries_ = params.cross_origin_whitelist_entries;
|
||||
|
||||
pdf_print_client_.reset(new ChromePDFPrintClient());
|
||||
pdf::PPB_PDF_Impl::SetPrintClient(pdf_print_client_.get());
|
||||
|
||||
// Notify the render process handler.
|
||||
CefRefPtr<CefApp> application = CefContentClient::Get()->application();
|
||||
if (application.get()) {
|
||||
@ -710,16 +651,6 @@ void CefContentRendererClient::DidCreateScriptContext(
|
||||
}
|
||||
}
|
||||
|
||||
const void* CefContentRendererClient::CreatePPAPIInterface(
|
||||
const std::string& interface_name) {
|
||||
#if defined(ENABLE_PLUGINS)
|
||||
// Used for in-process PDF plugin.
|
||||
if (interface_name == PPB_PDF_INTERFACE)
|
||||
return pdf::PPB_PDF_Impl::GetInterface();
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CefContentRendererClient::WillReleaseScriptContext(
|
||||
blink::WebLocalFrame* frame,
|
||||
v8::Handle<v8::Context> context,
|
||||
|
@ -26,7 +26,6 @@ class WebCacheRenderProcessObserver;
|
||||
|
||||
class CefRenderProcessObserver;
|
||||
struct Cef_CrossOriginWhiteListEntry_Params;
|
||||
class ChromePDFPrintClient;
|
||||
class SpellCheck;
|
||||
|
||||
class CefContentRendererClient : public content::ContentRendererClient,
|
||||
@ -99,8 +98,6 @@ class CefContentRendererClient : public content::ContentRendererClient,
|
||||
v8::Handle<v8::Context> context,
|
||||
int extension_group,
|
||||
int world_id) override;
|
||||
const void* CreatePPAPIInterface(
|
||||
const std::string& interface_name) override;
|
||||
|
||||
void WillReleaseScriptContext(blink::WebLocalFrame* frame,
|
||||
v8::Handle<v8::Context> context,
|
||||
@ -129,8 +126,6 @@ class CefContentRendererClient : public content::ContentRendererClient,
|
||||
typedef std::vector<Cef_CrossOriginWhiteListEntry_Params> CrossOriginList;
|
||||
CrossOriginList cross_origin_whitelist_entries_;
|
||||
|
||||
scoped_ptr<ChromePDFPrintClient> pdf_print_client_;
|
||||
|
||||
int devtools_agent_count_;
|
||||
int uncaught_exception_stack_size_;
|
||||
|
||||
|
@ -47,13 +47,6 @@ bool CefContentUtilityClient::OnMessageReceived(
|
||||
return handled;
|
||||
}
|
||||
|
||||
// static
|
||||
void CefContentUtilityClient::PreSandboxStartup() {
|
||||
#if defined(OS_WIN)
|
||||
PrintingHandler::PreSandboxStartup();
|
||||
#endif
|
||||
}
|
||||
|
||||
void CefContentUtilityClient::OnStartupPing() {
|
||||
Send(new ChromeUtilityHostMsg_ProcessStarted);
|
||||
// Don't release the process, we assume further messages are on the way.
|
||||
|
@ -18,8 +18,6 @@ class CefContentUtilityClient : public content::ContentUtilityClient {
|
||||
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
static void PreSandboxStartup();
|
||||
|
||||
private:
|
||||
// IPC message handlers.
|
||||
void OnStartupPing();
|
||||
|
@ -30,225 +30,12 @@ void ReleaseProcessIfNeeded() {
|
||||
content::UtilityThread::Get()->ReleaseProcessIfNeeded();
|
||||
}
|
||||
|
||||
class PdfFunctionsBase {
|
||||
public:
|
||||
PdfFunctionsBase() : render_pdf_to_bitmap_func_(NULL),
|
||||
get_pdf_doc_info_func_(NULL) {}
|
||||
|
||||
bool Init() {
|
||||
base::FilePath pdf_module_path;
|
||||
if (!PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_module_path) ||
|
||||
!base::PathExists(pdf_module_path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
pdf_lib_.Reset(base::LoadNativeLibrary(pdf_module_path, NULL));
|
||||
if (!pdf_lib_.is_valid()) {
|
||||
LOG(WARNING) << "Couldn't load PDF plugin";
|
||||
return false;
|
||||
}
|
||||
|
||||
render_pdf_to_bitmap_func_ =
|
||||
reinterpret_cast<RenderPDFPageToBitmapProc>(
|
||||
pdf_lib_.GetFunctionPointer("RenderPDFPageToBitmap"));
|
||||
LOG_IF(WARNING, !render_pdf_to_bitmap_func_) <<
|
||||
"Missing RenderPDFPageToBitmap";
|
||||
|
||||
get_pdf_doc_info_func_ =
|
||||
reinterpret_cast<GetPDFDocInfoProc>(
|
||||
pdf_lib_.GetFunctionPointer("GetPDFDocInfo"));
|
||||
LOG_IF(WARNING, !get_pdf_doc_info_func_) << "Missing GetPDFDocInfo";
|
||||
|
||||
if (!render_pdf_to_bitmap_func_ || !get_pdf_doc_info_func_ ||
|
||||
!PlatformInit(pdf_module_path, pdf_lib_)) {
|
||||
Reset();
|
||||
}
|
||||
|
||||
return IsValid();
|
||||
}
|
||||
|
||||
bool IsValid() const {
|
||||
return pdf_lib_.is_valid();
|
||||
}
|
||||
|
||||
void Reset() {
|
||||
pdf_lib_.Reset(NULL);
|
||||
}
|
||||
|
||||
bool RenderPDFPageToBitmap(const void* pdf_buffer,
|
||||
int pdf_buffer_size,
|
||||
int page_number,
|
||||
void* bitmap_buffer,
|
||||
int bitmap_width,
|
||||
int bitmap_height,
|
||||
int dpi_x,
|
||||
int dpi_y,
|
||||
bool autorotate) {
|
||||
if (!render_pdf_to_bitmap_func_)
|
||||
return false;
|
||||
return render_pdf_to_bitmap_func_(pdf_buffer, pdf_buffer_size, page_number,
|
||||
bitmap_buffer, bitmap_width,
|
||||
bitmap_height, dpi_x, dpi_y, autorotate);
|
||||
}
|
||||
|
||||
bool GetPDFDocInfo(const void* pdf_buffer,
|
||||
int buffer_size,
|
||||
int* page_count,
|
||||
double* max_page_width) {
|
||||
if (!get_pdf_doc_info_func_)
|
||||
return false;
|
||||
return get_pdf_doc_info_func_(pdf_buffer, buffer_size, page_count,
|
||||
max_page_width);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual bool PlatformInit(
|
||||
const base::FilePath& pdf_module_path,
|
||||
const base::ScopedNativeLibrary& pdf_lib) {
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
// Exported by PDF plugin.
|
||||
typedef bool (*RenderPDFPageToBitmapProc)(const void* pdf_buffer,
|
||||
int pdf_buffer_size,
|
||||
int page_number,
|
||||
void* bitmap_buffer,
|
||||
int bitmap_width,
|
||||
int bitmap_height,
|
||||
int dpi_x,
|
||||
int dpi_y,
|
||||
bool autorotate);
|
||||
typedef bool (*GetPDFDocInfoProc)(const void* pdf_buffer,
|
||||
int buffer_size, int* page_count,
|
||||
double* max_page_width);
|
||||
|
||||
RenderPDFPageToBitmapProc render_pdf_to_bitmap_func_;
|
||||
GetPDFDocInfoProc get_pdf_doc_info_func_;
|
||||
|
||||
base::ScopedNativeLibrary pdf_lib_;
|
||||
DISALLOW_COPY_AND_ASSIGN(PdfFunctionsBase);
|
||||
};
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// The 2 below IAT patch functions are almost identical to the code in
|
||||
// render_process_impl.cc. This is needed to work around specific Windows APIs
|
||||
// used by the Chrome PDF plugin that will fail in the sandbox.
|
||||
static base::win::IATPatchFunction g_iat_patch_createdca;
|
||||
HDC WINAPI UtilityProcess_CreateDCAPatch(LPCSTR driver_name,
|
||||
LPCSTR device_name,
|
||||
LPCSTR output,
|
||||
const DEVMODEA* init_data) {
|
||||
if (driver_name && (std::string("DISPLAY") == driver_name)) {
|
||||
// CreateDC fails behind the sandbox, but not CreateCompatibleDC.
|
||||
return CreateCompatibleDC(NULL);
|
||||
}
|
||||
|
||||
NOTREACHED();
|
||||
return CreateDCA(driver_name, device_name, output, init_data);
|
||||
}
|
||||
|
||||
static base::win::IATPatchFunction g_iat_patch_get_font_data;
|
||||
DWORD WINAPI UtilityProcess_GetFontDataPatch(
|
||||
HDC hdc, DWORD table, DWORD offset, LPVOID buffer, DWORD length) {
|
||||
int rv = GetFontData(hdc, table, offset, buffer, length);
|
||||
if (rv == GDI_ERROR && hdc) {
|
||||
HFONT font = static_cast<HFONT>(GetCurrentObject(hdc, OBJ_FONT));
|
||||
|
||||
LOGFONT logfont;
|
||||
if (GetObject(font, sizeof(LOGFONT), &logfont)) {
|
||||
content::UtilityThread::Get()->PreCacheFont(logfont);
|
||||
rv = GetFontData(hdc, table, offset, buffer, length);
|
||||
content::UtilityThread::Get()->ReleaseCachedFonts();
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
class PdfFunctionsWin : public PdfFunctionsBase {
|
||||
public:
|
||||
PdfFunctionsWin() : render_pdf_to_dc_func_(NULL) {
|
||||
}
|
||||
|
||||
bool PlatformInit(
|
||||
const base::FilePath& pdf_module_path,
|
||||
const base::ScopedNativeLibrary& pdf_lib) override {
|
||||
// Patch the IAT for handling specific APIs known to fail in the sandbox.
|
||||
if (!g_iat_patch_createdca.is_patched()) {
|
||||
g_iat_patch_createdca.Patch(pdf_module_path.value().c_str(),
|
||||
"gdi32.dll", "CreateDCA",
|
||||
UtilityProcess_CreateDCAPatch);
|
||||
}
|
||||
|
||||
if (!g_iat_patch_get_font_data.is_patched()) {
|
||||
g_iat_patch_get_font_data.Patch(pdf_module_path.value().c_str(),
|
||||
"gdi32.dll", "GetFontData",
|
||||
UtilityProcess_GetFontDataPatch);
|
||||
}
|
||||
render_pdf_to_dc_func_ =
|
||||
reinterpret_cast<RenderPDFPageToDCProc>(
|
||||
pdf_lib.GetFunctionPointer("RenderPDFPageToDC"));
|
||||
LOG_IF(WARNING, !render_pdf_to_dc_func_) << "Missing RenderPDFPageToDC";
|
||||
|
||||
return render_pdf_to_dc_func_ != NULL;
|
||||
}
|
||||
|
||||
bool RenderPDFPageToDC(const void* pdf_buffer,
|
||||
int buffer_size,
|
||||
int page_number,
|
||||
HDC dc,
|
||||
int dpi_x,
|
||||
int dpi_y,
|
||||
int bounds_origin_x,
|
||||
int bounds_origin_y,
|
||||
int bounds_width,
|
||||
int bounds_height,
|
||||
bool fit_to_bounds,
|
||||
bool stretch_to_bounds,
|
||||
bool keep_aspect_ratio,
|
||||
bool center_in_bounds,
|
||||
bool autorotate) {
|
||||
if (!render_pdf_to_dc_func_)
|
||||
return false;
|
||||
return render_pdf_to_dc_func_(pdf_buffer, buffer_size, page_number,
|
||||
dc, dpi_x, dpi_y, bounds_origin_x,
|
||||
bounds_origin_y, bounds_width, bounds_height,
|
||||
fit_to_bounds, stretch_to_bounds,
|
||||
keep_aspect_ratio, center_in_bounds,
|
||||
autorotate);
|
||||
}
|
||||
|
||||
private:
|
||||
// Exported by PDF plugin.
|
||||
typedef bool (*RenderPDFPageToDCProc)(
|
||||
const void* pdf_buffer, int buffer_size, int page_number, HDC dc,
|
||||
int dpi_x, int dpi_y, int bounds_origin_x, int bounds_origin_y,
|
||||
int bounds_width, int bounds_height, bool fit_to_bounds,
|
||||
bool stretch_to_bounds, bool keep_aspect_ratio, bool center_in_bounds,
|
||||
bool autorotate);
|
||||
RenderPDFPageToDCProc render_pdf_to_dc_func_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(PdfFunctionsWin);
|
||||
};
|
||||
|
||||
typedef PdfFunctionsWin PdfFunctions;
|
||||
#else // OS_WIN
|
||||
typedef PdfFunctionsBase PdfFunctions;
|
||||
#endif // OS_WIN
|
||||
|
||||
base::LazyInstance<PdfFunctions> g_pdf_lib = LAZY_INSTANCE_INITIALIZER;
|
||||
|
||||
} // namespace
|
||||
|
||||
PrintingHandler::PrintingHandler() {}
|
||||
|
||||
PrintingHandler::~PrintingHandler() {}
|
||||
|
||||
// static
|
||||
void PrintingHandler::PreSandboxStartup() {
|
||||
g_pdf_lib.Get().Init();
|
||||
}
|
||||
|
||||
bool PrintingHandler::OnMessageReceived(const IPC::Message& message) {
|
||||
bool handled = true;
|
||||
IPC_BEGIN_MESSAGE_MAP(PrintingHandler, message)
|
||||
@ -292,9 +79,6 @@ void PrintingHandler::OnRenderPDFPagesToMetafileStop() {
|
||||
}
|
||||
|
||||
int PrintingHandler::LoadPDF(base::File pdf_file) {
|
||||
if (!g_pdf_lib.Get().IsValid())
|
||||
return 0;
|
||||
|
||||
int64 length = pdf_file.GetLength();
|
||||
if (length < 0)
|
||||
return 0;
|
||||
@ -304,7 +88,7 @@ int PrintingHandler::LoadPDF(base::File pdf_file) {
|
||||
return 0;
|
||||
|
||||
int total_page_count = 0;
|
||||
if (!g_pdf_lib.Get().GetPDFDocInfo(
|
||||
if (!chrome_pdf::GetPDFDocInfo(
|
||||
&pdf_data_.front(), pdf_data_.size(), &total_page_count, NULL)) {
|
||||
return 0;
|
||||
}
|
||||
@ -333,13 +117,12 @@ bool PrintingHandler::RenderPdfPageToMetafile(int page_number,
|
||||
// The underlying metafile is of type Emf and ignores the arguments passed
|
||||
// to StartPage.
|
||||
metafile.StartPage(gfx::Size(), gfx::Rect(), 1);
|
||||
if (!g_pdf_lib.Get().RenderPDFPageToDC(
|
||||
if (!chrome_pdf::RenderPDFPageToDC(
|
||||
&pdf_data_.front(),
|
||||
pdf_data_.size(),
|
||||
page_number,
|
||||
metafile.context(),
|
||||
pdf_rendering_settings_.dpi(),
|
||||
pdf_rendering_settings_.dpi(),
|
||||
pdf_rendering_settings_.area().x(),
|
||||
pdf_rendering_settings_.area().y(),
|
||||
pdf_rendering_settings_.area().width(),
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "chrome/utility/utility_message_handler.h"
|
||||
#include "ipc/ipc_platform_file.h"
|
||||
#include "pdf/pdf.h"
|
||||
#include "printing/pdf_render_settings.h"
|
||||
|
||||
#if !defined(OS_WIN)
|
||||
@ -27,8 +28,6 @@ class PrintingHandler : public UtilityMessageHandler {
|
||||
PrintingHandler();
|
||||
~PrintingHandler() override;
|
||||
|
||||
static void PreSandboxStartup();
|
||||
|
||||
// IPC::Listener:
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
diff --git allocator.gyp allocator.gyp
|
||||
index c20325d..0e34390 100644
|
||||
index d426c9c..f593048 100644
|
||||
--- allocator.gyp
|
||||
+++ allocator.gyp
|
||||
@@ -238,6 +238,7 @@
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git web_contents_impl.cc web_contents_impl.cc
|
||||
index 507ebbe..1ef87a2 100644
|
||||
index ede1642..9a7d93b 100644
|
||||
--- web_contents_impl.cc
|
||||
+++ web_contents_impl.cc
|
||||
@@ -1191,22 +1191,29 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
@@ -1212,22 +1212,29 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
params.browser_context, params.site_instance, params.routing_id,
|
||||
params.main_frame_routing_id);
|
||||
|
||||
@ -48,7 +48,7 @@ index 507ebbe..1ef87a2 100644
|
||||
}
|
||||
CHECK(render_view_host_delegate_view_);
|
||||
CHECK(view_.get());
|
||||
@@ -1571,6 +1578,9 @@ void WebContentsImpl::CreateNewWindow(
|
||||
@@ -1576,6 +1583,9 @@ void WebContentsImpl::CreateNewWindow(
|
||||
static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
|
||||
CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));
|
||||
|
||||
@ -58,7 +58,7 @@ index 507ebbe..1ef87a2 100644
|
||||
if (delegate_ &&
|
||||
!delegate_->ShouldCreateWebContents(this,
|
||||
route_id,
|
||||
@@ -1579,7 +1589,9 @@ void WebContentsImpl::CreateNewWindow(
|
||||
@@ -1584,7 +1594,9 @@ void WebContentsImpl::CreateNewWindow(
|
||||
params.frame_name,
|
||||
params.target_url,
|
||||
partition_id,
|
||||
@ -69,7 +69,7 @@ index 507ebbe..1ef87a2 100644
|
||||
if (route_id != MSG_ROUTING_NONE &&
|
||||
!RenderViewHost::FromID(render_process_id, route_id)) {
|
||||
// If the embedder didn't create a WebContents for this route, we need to
|
||||
@@ -1599,6 +1611,8 @@ void WebContentsImpl::CreateNewWindow(
|
||||
@@ -1604,6 +1616,8 @@ void WebContentsImpl::CreateNewWindow(
|
||||
create_params.main_frame_routing_id = main_frame_route_id;
|
||||
create_params.opener = this;
|
||||
create_params.opener_suppressed = params.opener_suppressed;
|
||||
@ -77,4 +77,4 @@ index 507ebbe..1ef87a2 100644
|
||||
+ create_params.delegate_view = delegate_view;
|
||||
if (params.disposition == NEW_BACKGROUND_TAB)
|
||||
create_params.initially_hidden = true;
|
||||
|
||||
create_params.renderer_initiated_creation = true;
|
||||
|
@ -1,5 +1,5 @@
|
||||
diff --git common.gypi common.gypi
|
||||
index 948dcec..243b262 100644
|
||||
index 4fcd211..9bfa165 100644
|
||||
--- common.gypi
|
||||
+++ common.gypi
|
||||
@@ -9,6 +9,9 @@
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git ui/browser.cc ui/browser.cc
|
||||
index 436a15e..3985b27 100644
|
||||
index 53dfccd..771bd25 100644
|
||||
--- ui/browser.cc
|
||||
+++ ui/browser.cc
|
||||
@@ -1563,7 +1563,9 @@ bool Browser::ShouldCreateWebContents(
|
||||
@@ -1578,7 +1578,9 @@ bool Browser::ShouldCreateWebContents(
|
||||
const base::string16& frame_name,
|
||||
const GURL& target_url,
|
||||
const std::string& partition_id,
|
||||
@ -14,10 +14,10 @@ index 436a15e..3985b27 100644
|
||||
// If a BackgroundContents is created, suppress the normal WebContents.
|
||||
return !MaybeCreateBackgroundContents(route_id,
|
||||
diff --git ui/browser.h ui/browser.h
|
||||
index 8478d97..d1a3f4e 100644
|
||||
index fcb711c..5a59434 100644
|
||||
--- ui/browser.h
|
||||
+++ ui/browser.h
|
||||
@@ -587,7 +587,9 @@ class Browser : public TabStripModelObserver,
|
||||
@@ -588,7 +588,9 @@ class Browser : public TabStripModelObserver,
|
||||
const base::string16& frame_name,
|
||||
const GURL& target_url,
|
||||
const std::string& partition_id,
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
|
||||
index cc42565..c671a8d 100644
|
||||
index 3658c25..74acc61 100644
|
||||
--- content/browser/compositor/gpu_process_transport_factory.cc
|
||||
+++ content/browser/compositor/gpu_process_transport_factory.cc
|
||||
@@ -106,6 +106,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() {
|
||||
@@ -98,6 +98,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() {
|
||||
|
||||
scoped_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
|
||||
ui::Compositor* compositor) {
|
||||
@ -17,7 +17,7 @@ index cc42565..c671a8d 100644
|
||||
return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceWin(
|
||||
compositor));
|
||||
diff --git ui/compositor/compositor.h ui/compositor/compositor.h
|
||||
index ded2992..0b000c6 100644
|
||||
index 47d4cd0..793bbe3 100644
|
||||
--- ui/compositor/compositor.h
|
||||
+++ ui/compositor/compositor.h
|
||||
@@ -13,6 +13,7 @@
|
||||
@ -28,7 +28,7 @@ index ded2992..0b000c6 100644
|
||||
#include "cc/surfaces/surface_sequence.h"
|
||||
#include "cc/trees/layer_tree_host_client.h"
|
||||
#include "cc/trees/layer_tree_host_single_thread_client.h"
|
||||
@@ -134,6 +135,17 @@ class COMPOSITOR_EXPORT CompositorLock
|
||||
@@ -131,6 +132,17 @@ class COMPOSITOR_EXPORT CompositorLock
|
||||
DISALLOW_COPY_AND_ASSIGN(CompositorLock);
|
||||
};
|
||||
|
||||
@ -46,7 +46,7 @@ index ded2992..0b000c6 100644
|
||||
// Compositor object to take care of GPU painting.
|
||||
// A Browser compositor object is responsible for generating the final
|
||||
// displayable form of pixels comprising a single widget's contents. It draws an
|
||||
@@ -155,6 +167,9 @@ class COMPOSITOR_EXPORT Compositor
|
||||
@@ -152,6 +164,9 @@ class COMPOSITOR_EXPORT Compositor
|
||||
// Schedules a redraw of the layer tree associated with this compositor.
|
||||
void ScheduleDraw();
|
||||
|
||||
@ -56,7 +56,7 @@ index ded2992..0b000c6 100644
|
||||
// Sets the root of the layer tree drawn by this Compositor. The root layer
|
||||
// must have no parent. The compositor's root layer is reset if the root layer
|
||||
// is destroyed. NULL can be passed to reset the root layer, in which case the
|
||||
@@ -298,6 +313,8 @@ class COMPOSITOR_EXPORT Compositor
|
||||
@@ -297,6 +312,8 @@ class COMPOSITOR_EXPORT Compositor
|
||||
|
||||
ui::ContextFactory* context_factory_;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc
|
||||
index 79b40ac..4babaa9 100644
|
||||
index b56613e..b384eac 100644
|
||||
--- public/renderer/content_renderer_client.cc
|
||||
+++ public/renderer/content_renderer_client.cc
|
||||
@@ -99,7 +99,6 @@ bool ContentRendererClient::AllowPopup() {
|
||||
@ -19,10 +19,10 @@ index 79b40ac..4babaa9 100644
|
||||
bool ContentRendererClient::ShouldFork(blink::WebFrame* frame,
|
||||
const GURL& url,
|
||||
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h
|
||||
index a7c7271..05fc084 100644
|
||||
index 7889016..21307b6 100644
|
||||
--- public/renderer/content_renderer_client.h
|
||||
+++ public/renderer/content_renderer_client.h
|
||||
@@ -192,7 +192,6 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
@@ -193,7 +193,6 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
// Returns true if a popup window should be allowed.
|
||||
virtual bool AllowPopup();
|
||||
|
||||
@ -30,7 +30,7 @@ index a7c7271..05fc084 100644
|
||||
// TODO(sgurun) This callback is deprecated and will be removed as soon
|
||||
// as android webview completes implementation of a resource throttle based
|
||||
// shouldoverrideurl implementation. See crbug.com/325351
|
||||
@@ -207,7 +206,6 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
@@ -208,7 +207,6 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
blink::WebNavigationType type,
|
||||
blink::WebNavigationPolicy default_policy,
|
||||
bool is_redirect);
|
||||
@ -39,10 +39,10 @@ index a7c7271..05fc084 100644
|
||||
// Returns true if we should fork a new process for the given navigation.
|
||||
// If |send_referrer| is set to false (which is the default), no referrer
|
||||
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
|
||||
index 876e8ae..a5064a1 100644
|
||||
index 1e3667f..87b2ec4 100644
|
||||
--- renderer/render_frame_impl.cc
|
||||
+++ renderer/render_frame_impl.cc
|
||||
@@ -3954,7 +3954,6 @@ void RenderFrameImpl::OnCommitNavigation(
|
||||
@@ -3906,7 +3906,6 @@ void RenderFrameImpl::OnCommitNavigation(
|
||||
WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
|
||||
RenderFrame* render_frame,
|
||||
const NavigationPolicyInfo& info) {
|
||||
@ -50,7 +50,7 @@ index 876e8ae..a5064a1 100644
|
||||
// The handlenavigation API is deprecated and will be removed once
|
||||
// crbug.com/325351 is resolved.
|
||||
if (info.urlRequest.url() != GURL(kSwappedOutURL) &&
|
||||
@@ -3969,7 +3968,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
|
||||
@@ -3921,7 +3920,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
|
||||
info.isRedirect)) {
|
||||
return blink::WebNavigationPolicyIgnore;
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git gyp/generator/ninja.py gyp/generator/ninja.py
|
||||
index 5407795..580aa54 100644
|
||||
index 587bf32..c9868db 100644
|
||||
--- gyp/generator/ninja.py
|
||||
+++ gyp/generator/ninja.py
|
||||
@@ -747,7 +747,16 @@ class NinjaWriter(object):
|
||||
@@ -748,7 +748,16 @@ class NinjaWriter(object):
|
||||
for path in copy['files']:
|
||||
# Normalize the path so trailing slashes don't confuse us.
|
||||
path = os.path.normpath(path)
|
||||
|
@ -1,12 +1,17 @@
|
||||
diff --git message_loop.cc message_loop.cc
|
||||
index 24db543..d57673d 100644
|
||||
index daa7782..6fea3c2 100644
|
||||
--- message_loop.cc
|
||||
+++ message_loop.cc
|
||||
@@ -159,7 +159,6 @@ MessageLoop::MessageLoop(scoped_ptr<MessagePump> pump)
|
||||
@@ -152,12 +152,6 @@ MessageLoop::MessageLoop(scoped_ptr<MessagePump> pump)
|
||||
MessageLoop::~MessageLoop() {
|
||||
DCHECK_EQ(this, current());
|
||||
|
||||
- // iOS just attaches to the loop, it doesn't Run it.
|
||||
- // TODO(stuartmorgan): Consider wiring up a Detach().
|
||||
-#if !defined(OS_IOS)
|
||||
- DCHECK(!run_loop_);
|
||||
-#endif
|
||||
-
|
||||
#if defined(OS_WIN)
|
||||
if (in_high_res_mode_)
|
||||
Time::ActivateHighResolutionTimer(false);
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h
|
||||
index 4f59c26..69a7b34 100644
|
||||
index df89031..82d9293 100644
|
||||
--- public/common/common_param_traits_macros.h
|
||||
+++ public/common/common_param_traits_macros.h
|
||||
@@ -190,6 +190,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
|
||||
@@ -194,6 +194,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
|
||||
IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes)
|
||||
IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale)
|
||||
IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled)
|
||||
@ -11,34 +11,34 @@ index 4f59c26..69a7b34 100644
|
||||
IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop)
|
||||
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
|
||||
diff --git public/common/web_preferences.cc public/common/web_preferences.cc
|
||||
index 5563c00..4c24e35 100644
|
||||
index 97b464e..98e7b4e 100644
|
||||
--- public/common/web_preferences.cc
|
||||
+++ public/common/web_preferences.cc
|
||||
@@ -190,6 +190,7 @@ WebPreferences::WebPreferences()
|
||||
@@ -185,6 +185,7 @@ WebPreferences::WebPreferences()
|
||||
rubber_banding_on_compositor_thread(false),
|
||||
use_solid_color_scrollbars(false),
|
||||
navigate_on_drag_drop(true),
|
||||
+ base_background_color(0xFFFFFFFF), // Color::white
|
||||
v8_cache_options(V8_CACHE_OPTIONS_DEFAULT),
|
||||
v8_script_streaming_enabled(false),
|
||||
v8_script_streaming_mode(V8_SCRIPT_STREAMING_MODE_ALL),
|
||||
slimming_paint_enabled(false),
|
||||
cookie_enabled(true),
|
||||
diff --git public/common/web_preferences.h public/common/web_preferences.h
|
||||
index ab43cd9..a5b3022 100644
|
||||
index 250b546..b679e26 100644
|
||||
--- public/common/web_preferences.h
|
||||
+++ public/common/web_preferences.h
|
||||
@@ -179,6 +179,7 @@ struct CONTENT_EXPORT WebPreferences {
|
||||
@@ -181,6 +181,7 @@ struct CONTENT_EXPORT WebPreferences {
|
||||
bool rubber_banding_on_compositor_thread;
|
||||
bool use_solid_color_scrollbars;
|
||||
bool navigate_on_drag_drop;
|
||||
+ uint32_t base_background_color;
|
||||
V8CacheOptions v8_cache_options;
|
||||
bool v8_script_streaming_enabled;
|
||||
V8ScriptStreamingMode v8_script_streaming_mode;
|
||||
bool slimming_paint_enabled;
|
||||
|
||||
diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc
|
||||
index 3be3eb3..23f9891 100644
|
||||
index 6519f37..27b6699 100644
|
||||
--- renderer/render_view_impl.cc
|
||||
+++ renderer/render_view_impl.cc
|
||||
@@ -956,6 +956,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
|
||||
@@ -954,6 +954,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
|
||||
|
||||
settings->setJavaEnabled(prefs.java_enabled);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
diff --git content_browser_client.cc content_browser_client.cc
|
||||
index 8f3d06c..e67e698 100644
|
||||
index 67d2df7..e29a5d9 100644
|
||||
--- content_browser_client.cc
|
||||
+++ content_browser_client.cc
|
||||
@@ -278,6 +278,10 @@ bool ContentBrowserClient::IsFastShutdownPossible() {
|
||||
@ -14,7 +14,7 @@ index 8f3d06c..e67e698 100644
|
||||
return base::FilePath();
|
||||
}
|
||||
diff --git content_browser_client.h content_browser_client.h
|
||||
index d2ae7a0..a5b36d5 100644
|
||||
index c4ab6f3..08583cf 100644
|
||||
--- content_browser_client.h
|
||||
+++ content_browser_client.h
|
||||
@@ -28,6 +28,7 @@
|
||||
@ -25,7 +25,7 @@ index d2ae7a0..a5b36d5 100644
|
||||
#include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
|
||||
#include "ui/base/window_open_disposition.h"
|
||||
|
||||
@@ -509,6 +510,9 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -510,6 +511,9 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
// Clears browser cookies.
|
||||
virtual void ClearCookies(RenderViewHost* rvh) {}
|
||||
|
||||
@ -36,33 +36,33 @@ index d2ae7a0..a5b36d5 100644
|
||||
// This can be called on any thread.
|
||||
virtual base::FilePath GetDefaultDownloadDirectory();
|
||||
diff --git web_contents.cc web_contents.cc
|
||||
index 6768411..1dd382b 100644
|
||||
index aece7c6..63da2c9 100644
|
||||
--- web_contents.cc
|
||||
+++ web_contents.cc
|
||||
@@ -17,7 +17,9 @@ WebContents::CreateParams::CreateParams(BrowserContext* context)
|
||||
main_frame_routing_id(MSG_ROUTING_NONE),
|
||||
@@ -18,7 +18,9 @@ WebContents::CreateParams::CreateParams(BrowserContext* context)
|
||||
initially_hidden(false),
|
||||
guest_delegate(nullptr),
|
||||
- context(nullptr) {}
|
||||
+ context(nullptr),
|
||||
context(nullptr),
|
||||
- renderer_initiated_creation(false) {}
|
||||
+ renderer_initiated_creation(false),
|
||||
+ view(nullptr),
|
||||
+ delegate_view(nullptr) {}
|
||||
|
||||
WebContents::CreateParams::CreateParams(
|
||||
BrowserContext* context, SiteInstance* site)
|
||||
@@ -29,7 +31,9 @@ WebContents::CreateParams::CreateParams(
|
||||
main_frame_routing_id(MSG_ROUTING_NONE),
|
||||
@@ -31,7 +33,9 @@ WebContents::CreateParams::CreateParams(
|
||||
initially_hidden(false),
|
||||
guest_delegate(nullptr),
|
||||
- context(nullptr) {}
|
||||
+ context(nullptr),
|
||||
context(nullptr),
|
||||
- renderer_initiated_creation(false) {}
|
||||
+ renderer_initiated_creation(false),
|
||||
+ view(nullptr),
|
||||
+ delegate_view(nullptr) {}
|
||||
|
||||
WebContents::CreateParams::~CreateParams() {
|
||||
}
|
||||
diff --git web_contents.h web_contents.h
|
||||
index 879e8d8..0287912 100644
|
||||
index 493abd8..eface7b 100644
|
||||
--- web_contents.h
|
||||
+++ web_contents.h
|
||||
@@ -52,9 +52,11 @@ class PageState;
|
||||
@ -77,11 +77,11 @@ index 879e8d8..0287912 100644
|
||||
struct CustomContextMenuContext;
|
||||
struct DropData;
|
||||
struct Manifest;
|
||||
@@ -122,6 +124,10 @@ class WebContents : public PageNavigator,
|
||||
// Used to specify the location context which display the new view should
|
||||
// belong. This can be nullptr if not needed.
|
||||
gfx::NativeView context;
|
||||
+
|
||||
@@ -128,6 +130,10 @@ class WebContents : public PageNavigator,
|
||||
// RenderFrame, have already been created on the renderer side, and
|
||||
// WebContents construction should take this into account.
|
||||
bool renderer_initiated_creation;
|
||||
+
|
||||
+ // Optionally specify the view and delegate view.
|
||||
+ content::WebContentsView* view;
|
||||
+ content::RenderViewHostDelegateView* delegate_view;
|
||||
@ -104,7 +104,7 @@ index 461927c..2217377 100644
|
||||
}
|
||||
|
||||
diff --git web_contents_delegate.h web_contents_delegate.h
|
||||
index 13d1c1d..ddf88d8 100644
|
||||
index d88b27c..fefbed2 100644
|
||||
--- web_contents_delegate.h
|
||||
+++ web_contents_delegate.h
|
||||
@@ -36,9 +36,11 @@ class DownloadItem;
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git render_process_host_impl.cc render_process_host_impl.cc
|
||||
index 37d745e..5723bdc 100644
|
||||
index 6564c438..7d58b7e 100644
|
||||
--- render_process_host_impl.cc
|
||||
+++ render_process_host_impl.cc
|
||||
@@ -2065,6 +2065,8 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead,
|
||||
@@ -2057,6 +2057,8 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead,
|
||||
#endif
|
||||
RemoveUserData(kSessionStorageHolderKey);
|
||||
|
||||
@ -11,7 +11,7 @@ index 37d745e..5723bdc 100644
|
||||
IDMap<IPC::Listener>::iterator iter(&listeners_);
|
||||
while (!iter.IsAtEnd()) {
|
||||
iter.GetCurrentValue()->OnMessageReceived(
|
||||
@@ -2074,8 +2076,6 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead,
|
||||
@@ -2066,8 +2068,6 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead,
|
||||
iter.Advance();
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
diff --git core/frame/FrameView.cpp core/frame/FrameView.cpp
|
||||
index 8719a5c..555d59d 100644
|
||||
index 06ced1c..a638814 100644
|
||||
--- core/frame/FrameView.cpp
|
||||
+++ core/frame/FrameView.cpp
|
||||
@@ -146,8 +146,10 @@ FrameView::FrameView(LocalFrame* frame)
|
||||
|
@ -1,5 +1,5 @@
|
||||
diff --git web_dialog_view.cc web_dialog_view.cc
|
||||
index 0bffda9..c584bc9 100644
|
||||
index 8fe27bf..04bd1a6 100644
|
||||
--- web_dialog_view.cc
|
||||
+++ web_dialog_view.cc
|
||||
@@ -339,7 +339,9 @@ bool WebDialogView::ShouldCreateWebContents(
|
||||
@ -14,7 +14,7 @@ index 0bffda9..c584bc9 100644
|
||||
return delegate_->HandleShouldCreateWebContents();
|
||||
return true;
|
||||
diff --git web_dialog_view.h web_dialog_view.h
|
||||
index ce69cfc..a890771 100644
|
||||
index 22550dd..8d72f6d 100644
|
||||
--- web_dialog_view.h
|
||||
+++ web_dialog_view.h
|
||||
@@ -119,7 +119,9 @@ class WEBVIEW_EXPORT WebDialogView : public views::ClientView,
|
||||
|
@ -43,10 +43,10 @@ index b54a643..5a589e5 100644
|
||||
if (input_method)
|
||||
input_method->OnBlur();
|
||||
diff --git desktop_aura/desktop_window_tree_host_x11.cc desktop_aura/desktop_window_tree_host_x11.cc
|
||||
index 80008cf..46ea712 100644
|
||||
index c6fc3d7..40b9b10 100644
|
||||
--- desktop_aura/desktop_window_tree_host_x11.cc
|
||||
+++ desktop_aura/desktop_window_tree_host_x11.cc
|
||||
@@ -153,7 +153,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
|
||||
@@ -154,7 +154,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
|
||||
window_shape_(NULL),
|
||||
custom_window_shape_(false),
|
||||
urgency_hint_set_(false),
|
||||
@ -56,7 +56,7 @@ index 80008cf..46ea712 100644
|
||||
}
|
||||
|
||||
DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() {
|
||||
@@ -355,7 +356,8 @@ void DesktopWindowTreeHostX11::CloseNow() {
|
||||
@@ -356,7 +357,8 @@ void DesktopWindowTreeHostX11::CloseNow() {
|
||||
// Actually free our native resources.
|
||||
if (ui::PlatformEventSource::GetInstance())
|
||||
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
|
||||
@ -66,43 +66,34 @@ index 80008cf..46ea712 100644
|
||||
xwindow_ = None;
|
||||
|
||||
desktop_native_widget_aura_->OnHostClosed();
|
||||
@@ -449,6 +451,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
|
||||
@@ -455,6 +457,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
|
||||
}
|
||||
|
||||
gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const {
|
||||
+ if (!screen_bounds_.IsEmpty())
|
||||
+ return screen_bounds_;
|
||||
return bounds_;
|
||||
return ToDIPRect(bounds_in_pixels_);
|
||||
}
|
||||
|
||||
@@ -461,6 +465,8 @@ gfx::Rect DesktopWindowTreeHostX11::GetClientAreaBoundsInScreen() const {
|
||||
// Attempts to calculate the rect by asking the NonClientFrameView what it
|
||||
// thought its GetBoundsForClientView() were broke combobox drop down
|
||||
// placement.
|
||||
+ if (!screen_bounds_.IsEmpty())
|
||||
+ return screen_bounds_;
|
||||
return bounds_;
|
||||
}
|
||||
|
||||
@@ -884,6 +890,8 @@ void DesktopWindowTreeHostX11::Hide() {
|
||||
@@ -887,6 +891,8 @@ void DesktopWindowTreeHostX11::Hide() {
|
||||
}
|
||||
|
||||
gfx::Rect DesktopWindowTreeHostX11::GetBounds() const {
|
||||
+ if (!screen_bounds_.IsEmpty())
|
||||
+ return screen_bounds_;
|
||||
return bounds_;
|
||||
return bounds_in_pixels_;
|
||||
}
|
||||
|
||||
@@ -939,6 +947,8 @@ void DesktopWindowTreeHostX11::SetBounds(const gfx::Rect& requested_bounds) {
|
||||
@@ -943,6 +949,8 @@ void DesktopWindowTreeHostX11::SetBounds(
|
||||
}
|
||||
|
||||
gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const {
|
||||
+ if (!screen_bounds_.IsEmpty())
|
||||
+ return screen_bounds_.origin();
|
||||
return bounds_.origin();
|
||||
return bounds_in_pixels_.origin();
|
||||
}
|
||||
|
||||
@@ -1058,10 +1068,14 @@ void DesktopWindowTreeHostX11::InitX11Window(
|
||||
@@ -1063,9 +1071,13 @@ void DesktopWindowTreeHostX11::InitX11Window(
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,15 +101,14 @@ index 80008cf..46ea712 100644
|
||||
+ if (parent_widget == gfx::kNullAcceleratedWidget)
|
||||
+ parent_widget = x_root_window_;
|
||||
+
|
||||
bounds_ = gfx::Rect(params.bounds.origin(),
|
||||
AdjustSize(params.bounds.size()));
|
||||
xwindow_ = XCreateWindow(
|
||||
- xdisplay_, x_root_window_,
|
||||
+ xdisplay_, parent_widget,
|
||||
bounds_.x(), bounds_.y(),
|
||||
bounds_.width(), bounds_.height(),
|
||||
0, // border width
|
||||
@@ -1699,6 +1713,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
|
||||
bounds_in_pixels_ = ToPixelRect(params.bounds);
|
||||
bounds_in_pixels_.set_size(AdjustSize(bounds_in_pixels_.size()));
|
||||
- xwindow_ = XCreateWindow(xdisplay_, x_root_window_, bounds_in_pixels_.x(),
|
||||
+ xwindow_ = XCreateWindow(xdisplay_, parent_widget, bounds_in_pixels_.x(),
|
||||
bounds_in_pixels_.y(), bounds_in_pixels_.width(),
|
||||
bounds_in_pixels_.height(),
|
||||
0, // border width
|
||||
@@ -1718,6 +1730,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -130,7 +120,7 @@ index 80008cf..46ea712 100644
|
||||
if (xev->xfocus.mode != NotifyGrab) {
|
||||
ReleaseCapture();
|
||||
diff --git desktop_aura/desktop_window_tree_host_x11.h desktop_aura/desktop_window_tree_host_x11.h
|
||||
index d6b5cc8..bf20d4c 100644
|
||||
index 8f00d3c..a465bed 100644
|
||||
--- desktop_aura/desktop_window_tree_host_x11.h
|
||||
+++ desktop_aura/desktop_window_tree_host_x11.h
|
||||
@@ -85,6 +85,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
|
||||
@ -142,17 +132,17 @@ index d6b5cc8..bf20d4c 100644
|
||||
protected:
|
||||
// Overridden from DesktopWindowTreeHost:
|
||||
void Init(aura::Window* content_window,
|
||||
@@ -253,6 +255,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
|
||||
@@ -264,6 +266,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
|
||||
// The bounds of |xwindow_|.
|
||||
gfx::Rect bounds_;
|
||||
gfx::Rect bounds_in_pixels_;
|
||||
|
||||
+ // Override the screen bounds when the host is a child window.
|
||||
+ gfx::Rect screen_bounds_;
|
||||
+
|
||||
// Whenever the bounds are set, we keep the previous set of bounds around so
|
||||
// we can have a better chance of getting the real |restored_bounds_|. Window
|
||||
// managers tend to send a Configure message with the maximized bounds, and
|
||||
@@ -337,6 +342,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
|
||||
// we can have a better chance of getting the real
|
||||
// |restored_bounds_in_pixels_|. Window managers tend to send a Configure
|
||||
@@ -349,6 +354,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
|
||||
|
||||
base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_;
|
||||
|
||||
@ -163,10 +153,10 @@ index d6b5cc8..bf20d4c 100644
|
||||
};
|
||||
|
||||
diff --git widget.cc widget.cc
|
||||
index 76dc14a..8c40f67 100644
|
||||
index 7d237c8..8778686 100644
|
||||
--- widget.cc
|
||||
+++ widget.cc
|
||||
@@ -109,6 +109,7 @@ Widget::InitParams::InitParams()
|
||||
@@ -110,6 +110,7 @@ Widget::InitParams::InitParams()
|
||||
use_system_default_icon(false),
|
||||
show_state(ui::SHOW_STATE_DEFAULT),
|
||||
parent(NULL),
|
||||
@ -174,7 +164,7 @@ index 76dc14a..8c40f67 100644
|
||||
native_widget(NULL),
|
||||
desktop_window_tree_host(NULL),
|
||||
layer_type(aura::WINDOW_LAYER_TEXTURED),
|
||||
@@ -132,6 +133,7 @@ Widget::InitParams::InitParams(Type type)
|
||||
@@ -133,6 +134,7 @@ Widget::InitParams::InitParams(Type type)
|
||||
use_system_default_icon(false),
|
||||
show_state(ui::SHOW_STATE_DEFAULT),
|
||||
parent(NULL),
|
||||
@ -182,7 +172,7 @@ index 76dc14a..8c40f67 100644
|
||||
native_widget(NULL),
|
||||
desktop_window_tree_host(NULL),
|
||||
layer_type(aura::WINDOW_LAYER_TEXTURED),
|
||||
@@ -306,7 +308,7 @@ void Widget::Init(const InitParams& in_params) {
|
||||
@@ -307,7 +309,7 @@ void Widget::Init(const InitParams& in_params) {
|
||||
InitParams params = in_params;
|
||||
|
||||
params.child |= (params.type == InitParams::TYPE_CONTROL);
|
||||
@ -191,7 +181,7 @@ index 76dc14a..8c40f67 100644
|
||||
|
||||
if (params.opacity == views::Widget::InitParams::INFER_OPACITY &&
|
||||
params.type != views::Widget::InitParams::TYPE_WINDOW &&
|
||||
@@ -367,7 +369,12 @@ void Widget::Init(const InitParams& in_params) {
|
||||
@@ -370,7 +372,12 @@ void Widget::Init(const InitParams& in_params) {
|
||||
Minimize();
|
||||
} else if (params.delegate) {
|
||||
SetContentsView(params.delegate->GetContentsView());
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp
|
||||
index 0f36f75..b6dd8de 100644
|
||||
index 16f5b8f..6d457f1 100644
|
||||
--- Source/web/ChromeClientImpl.cpp
|
||||
+++ Source/web/ChromeClientImpl.cpp
|
||||
@@ -740,7 +740,7 @@ bool ChromeClientImpl::hasOpenedPopup() const
|
||||
@@ -735,7 +735,7 @@ bool ChromeClientImpl::hasOpenedPopup() const
|
||||
|
||||
PassRefPtrWillBeRawPtr<PopupMenu> ChromeClientImpl::createPopupMenu(LocalFrame& frame, PopupMenuClient* client)
|
||||
{
|
||||
@ -10,12 +10,12 @@ index 0f36f75..b6dd8de 100644
|
||||
+ if (m_webView->useExternalPopupMenus())
|
||||
return adoptRefWillBeNoop(new ExternalPopupMenu(frame, client, *m_webView));
|
||||
|
||||
return adoptRefWillBeNoop(new PopupMenuChromium(frame, client));
|
||||
if (RuntimeEnabledFeatures::htmlPopupMenuEnabled() && RuntimeEnabledFeatures::pagePopupEnabled())
|
||||
diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp
|
||||
index 06e1c3e..95b7405 100644
|
||||
index 5312dcd..87b87fd 100644
|
||||
--- Source/web/WebViewImpl.cpp
|
||||
+++ Source/web/WebViewImpl.cpp
|
||||
@@ -380,6 +380,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
|
||||
@@ -408,6 +408,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
|
||||
, m_fakePageScaleAnimationPageScaleFactor(0)
|
||||
, m_fakePageScaleAnimationUseAnchor(false)
|
||||
, m_contextMenuAllowed(false)
|
||||
@ -23,7 +23,7 @@ index 06e1c3e..95b7405 100644
|
||||
, m_doingDragAndDrop(false)
|
||||
, m_ignoreInputEvents(false)
|
||||
, m_compositorDeviceScaleFactorOverride(0)
|
||||
@@ -4059,9 +4060,14 @@ void WebViewImpl::pageScaleFactorChanged()
|
||||
@@ -4127,9 +4128,14 @@ void WebViewImpl::pageScaleFactorChanged()
|
||||
m_page->inspectorController().pageScaleFactorChanged();
|
||||
}
|
||||
|
||||
@ -40,10 +40,10 @@ index 06e1c3e..95b7405 100644
|
||||
|
||||
void WebViewImpl::startDragging(LocalFrame* frame,
|
||||
diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h
|
||||
index 7474465..580783f 100644
|
||||
index 6048f2b..3cbdefd 100644
|
||||
--- Source/web/WebViewImpl.h
|
||||
+++ Source/web/WebViewImpl.h
|
||||
@@ -383,7 +383,8 @@ public:
|
||||
@@ -389,7 +389,8 @@ public:
|
||||
|
||||
// Returns true if popup menus should be rendered by the browser, false if
|
||||
// they should be rendered by WebKit (which is the default).
|
||||
@ -53,7 +53,7 @@ index 7474465..580783f 100644
|
||||
|
||||
bool contextMenuAllowed() const
|
||||
{
|
||||
@@ -676,6 +677,8 @@ private:
|
||||
@@ -690,6 +691,8 @@ private:
|
||||
|
||||
bool m_contextMenuAllowed;
|
||||
|
||||
@ -63,10 +63,10 @@ index 7474465..580783f 100644
|
||||
|
||||
bool m_ignoreInputEvents;
|
||||
diff --git public/web/WebView.h public/web/WebView.h
|
||||
index 1273aaa..b5d388e 100644
|
||||
index 774d117..9cd6546 100644
|
||||
--- public/web/WebView.h
|
||||
+++ public/web/WebView.h
|
||||
@@ -407,6 +407,7 @@ public:
|
||||
@@ -409,6 +409,7 @@ public:
|
||||
|
||||
// Sets whether select popup menus should be rendered by the browser.
|
||||
BLINK_EXPORT static void setUseExternalPopupMenus(bool);
|
||||
|
@ -42,6 +42,3 @@ Optional components:
|
||||
* FFmpeg audio and video support
|
||||
libffmpegsumo.so
|
||||
Note: Without this component HTML5 audio and video will not function.
|
||||
|
||||
* PDF support
|
||||
libpdf.so
|
||||
|
@ -16,7 +16,6 @@ cefclient.app/
|
||||
Chromium Embedded Framework <= main application library
|
||||
Libraries/
|
||||
ffmpegsumo.so <= HTML5 audio/video support library
|
||||
PDF.plugin <= Pepper plugin for PDF support
|
||||
Resources/
|
||||
cef.pak <= non-localized resources and strings
|
||||
cef_100_percent.pak <====^
|
||||
@ -103,9 +102,6 @@ Optional components:
|
||||
Chromium Embedded Framework.framework/Libraries/ffmpegsumo.so
|
||||
Note: Without this component HTML5 audio and video will not function.
|
||||
|
||||
* PDF support
|
||||
Chromium Embedded Framework.framework/Libraries/PDF.plugin
|
||||
|
||||
* Breakpad support
|
||||
Chromium Embedded Framework.framework/Resources/crash_inspector
|
||||
Chromium Embedded Framework.framework/Resources/crash_report_sender
|
||||
|
@ -38,10 +38,6 @@ 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_47.dll (required for Windows Vista and newer)
|
||||
|
@ -427,7 +427,6 @@ if platform == 'windows':
|
||||
'libcef.dll',
|
||||
'libEGL.dll',
|
||||
'libGLESv2.dll',
|
||||
'pdf.dll',
|
||||
]
|
||||
if not options.x64build:
|
||||
binaries.append('wow_helper.exe')
|
||||
@ -629,7 +628,6 @@ elif platform == 'linux':
|
||||
copy_file(os.path.join(build_dir, 'chrome_sandbox'), os.path.join(dst_dir, 'chrome-sandbox'), options.quiet)
|
||||
copy_file(os.path.join(build_dir, lib_dir_name, 'libcef.so'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'libffmpegsumo.so'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'libpdf.so'), dst_dir, options.quiet)
|
||||
else:
|
||||
sys.stderr.write("No Debug build files.\n")
|
||||
|
||||
@ -649,7 +647,6 @@ elif platform == 'linux':
|
||||
copy_file(os.path.join(build_dir, lib_dir_name, 'libcef.so'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'chrome_sandbox'), os.path.join(dst_dir, 'chrome-sandbox'), options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'libffmpegsumo.so'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'libpdf.so'), dst_dir, options.quiet)
|
||||
else:
|
||||
sys.stderr.write("No Release build files.\n")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user