move pdf viewer behind feature flag

This commit is contained in:
deepak1556 2018-03-15 17:51:48 +09:00 committed by Aleksei Kuzmin
parent c1908147a9
commit 4b39d17e5f
21 changed files with 159 additions and 63 deletions

View file

@ -5,12 +5,10 @@
#include "chrome/renderer/pepper/chrome_renderer_pepper_host_factory.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "chrome/renderer/pepper/pepper_flash_font_file_host.h"
#include "chrome/renderer/pepper/pepper_flash_fullscreen_host.h"
#include "chrome/renderer/pepper/pepper_flash_menu_host.h"
#include "chrome/renderer/pepper/pepper_flash_renderer_host.h"
#include "components/pdf/renderer/pepper_pdf_host.h"
#include "content/public/renderer/renderer_ppapi_host.h"
#include "ppapi/host/ppapi_host.h"
#include "ppapi/host/resource_host.h"
@ -18,6 +16,11 @@
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
#if defined(ENABLE_PDF_VIEWER)
#include "base/memory/ptr_util.h"
#include "components/pdf/renderer/pepper_pdf_host.h"
#endif // defined(ENABLE_PDF_VIEWER)
using ppapi::host::ResourceHost;
ChromeRendererPepperHostFactory::ChromeRendererPepperHostFactory(
@ -81,6 +84,7 @@ std::unique_ptr<ResourceHost> ChromeRendererPepperHostFactory::CreateResourceHos
}
}
#if defined(ENABLE_PDF_VIEWER)
if (host_->GetPpapiHost()->permissions().HasPermission(
ppapi::PERMISSION_PRIVATE)) {
switch (message.type()) {
@ -89,6 +93,7 @@ std::unique_ptr<ResourceHost> ChromeRendererPepperHostFactory::CreateResourceHos
}
}
}
#endif // defined(ENABLE_PDF_VIEWER)
return std::unique_ptr<ResourceHost>();
}

View file

@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ENABLE_PDF_VIEWER
#error("This header can only be used when enable_pdf_viewer gyp flag is enabled")
#endif // defined(ENABLE_PDF_VIEWER)
#include "components/pdf/renderer/pepper_pdf_host.h"
#include "atom/common/api/api_messages.h"

View file

@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ENABLE_PDF_VIEWER
#error("This header can only be used when enable_pdf_viewer gyp flag is enabled")
#endif // defined(ENABLE_PDF_VIEWER)
#ifndef COMPONENTS_PDF_RENDERER_PEPPER_PDF_HOST_H_
#define COMPONENTS_PDF_RENDERER_PEPPER_PDF_HOST_H_