FIXME: PDF component IPC should be converted to Mojo.
https://codereview.chromium.org/2455543002
This commit is contained in:
Родитель
e03f7baa60
Коммит
25d966110e
|
@ -9,9 +9,9 @@
|
|||
#include "atom/browser/atom_browser_context.h"
|
||||
#include "atom/browser/loader/layered_resource_handler.h"
|
||||
#include "atom/browser/ui/webui/pdf_viewer_handler.h"
|
||||
#include "atom/common/api/api_messages.h"
|
||||
#include "atom/common/atom_constants.h"
|
||||
#include "base/sequenced_task_runner_helpers.h"
|
||||
#include "components/pdf/common/pdf_messages.h"
|
||||
#include "content/browser/loader/resource_dispatcher_host_impl.h"
|
||||
#include "content/browser/loader/resource_request_info_impl.h"
|
||||
#include "content/browser/loader/stream_resource_handler.h"
|
||||
|
@ -217,7 +217,7 @@ bool PdfViewerUI::OnMessageReceived(
|
|||
content::RenderFrameHost* render_frame_host) {
|
||||
bool handled = true;
|
||||
IPC_BEGIN_MESSAGE_MAP(PdfViewerUI, message)
|
||||
IPC_MESSAGE_HANDLER(PDFHostMsg_PDFSaveURLAs, OnSaveURLAs)
|
||||
IPC_MESSAGE_HANDLER(AtomFrameHostMsg_PDFSaveURLAs, OnSaveURLAs)
|
||||
IPC_MESSAGE_UNHANDLED(handled = false)
|
||||
IPC_END_MESSAGE_MAP()
|
||||
return handled;
|
||||
|
|
|
@ -8,9 +8,11 @@
|
|||
#include "base/strings/string16.h"
|
||||
#include "base/values.h"
|
||||
#include "content/public/common/common_param_traits.h"
|
||||
#include "content/public/common/referrer.h"
|
||||
#include "ipc/ipc_message_macros.h"
|
||||
#include "ui/gfx/geometry/rect_f.h"
|
||||
#include "ui/gfx/ipc/gfx_param_traits.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
// The message starter should be declared in ipc/ipc_message_start.h. Since
|
||||
// we don't want to patch Chromium, we just pretend to be Content Shell.
|
||||
|
@ -62,3 +64,8 @@ IPC_SYNC_MESSAGE_ROUTED1_1(AtomViewHostMsg_SetTemporaryZoomLevel,
|
|||
|
||||
// Sent by renderer to get the zoom level.
|
||||
IPC_SYNC_MESSAGE_ROUTED0_1(AtomViewHostMsg_GetZoomLevel, double /* result */)
|
||||
|
||||
// Brings up SaveAs... dialog to save specified URL.
|
||||
IPC_MESSAGE_ROUTED2(AtomFrameHostMsg_PDFSaveURLAs,
|
||||
GURL /* url */,
|
||||
content::Referrer /* referrer */)
|
||||
|
|
|
@ -10,4 +10,3 @@
|
|||
#include "chrome/common/widevine_cdm_messages.h"
|
||||
#include "chrome/common/chrome_utility_messages.h"
|
||||
#include "chrome/common/chrome_utility_printing_messages.h"
|
||||
#include "components/pdf/common/pdf_messages.h"
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
// Copyright 2014 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Multiply-included file, no traditional include guard.
|
||||
#include <string.h>
|
||||
|
||||
#include "content/public/common/common_param_traits_macros.h"
|
||||
#include "content/public/common/referrer.h"
|
||||
#include "ipc/ipc_message_macros.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/ipc/url_param_traits.h"
|
||||
|
||||
#define IPC_MESSAGE_START PDFMsgStart
|
||||
|
||||
// Brings up SaveAs... dialog to save specified URL.
|
||||
IPC_MESSAGE_ROUTED2(PDFHostMsg_PDFSaveURLAs,
|
||||
GURL /* url */,
|
||||
content::Referrer /* referrer */)
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
#include "components/pdf/renderer/pepper_pdf_host.h"
|
||||
|
||||
#include "atom/common/api/api_messages.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "components/pdf/common/pdf_messages.h"
|
||||
#include "content/public/common/referrer.h"
|
||||
#include "content/public/renderer/pepper_plugin_instance.h"
|
||||
#include "content/public/renderer/render_frame.h"
|
||||
|
@ -77,8 +77,8 @@ int32_t PepperPDFHost::OnHostMsgSaveAs(
|
|||
referrer.url = url;
|
||||
referrer.policy = blink::kWebReferrerPolicyDefault;
|
||||
referrer = content::Referrer::SanitizeForRequest(url, referrer);
|
||||
render_frame->Send(
|
||||
new PDFHostMsg_PDFSaveURLAs(render_frame->GetRoutingID(), url, referrer));
|
||||
render_frame->Send(new AtomFrameHostMsg_PDFSaveURLAs(
|
||||
render_frame->GetRoutingID(), url, referrer));
|
||||
return PP_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -644,7 +644,6 @@
|
|||
'chromium_src/chrome/renderer/tts_dispatcher.cc',
|
||||
'chromium_src/chrome/renderer/tts_dispatcher.h',
|
||||
'chromium_src/chrome/utility/utility_message_handler.h',
|
||||
'chromium_src/components/pdf/common/pdf_messages.h',
|
||||
'chromium_src/components/pdf/renderer/pepper_pdf_host.cc',
|
||||
'chromium_src/components/pdf/renderer/pepper_pdf_host.h',
|
||||
'chromium_src/extensions/browser/app_window/size_constraints.cc',
|
||||
|
|
Загрузка…
Ссылка в новой задаче