Dont intercept pdf request for subframes
Will not work without OOPIF support
This commit is contained in:
parent
4381e0895f
commit
d022d108a3
3 changed files with 3 additions and 5 deletions
|
@ -8,14 +8,12 @@
|
||||||
#include "atom/browser/web_contents_permission_helper.h"
|
#include "atom/browser/web_contents_permission_helper.h"
|
||||||
#include "atom/common/atom_constants.h"
|
#include "atom/common/atom_constants.h"
|
||||||
#include "atom/common/platform_util.h"
|
#include "atom/common/platform_util.h"
|
||||||
#include "base/guid.h"
|
|
||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "content/public/browser/browser_thread.h"
|
#include "content/public/browser/browser_thread.h"
|
||||||
#include "content/public/browser/stream_info.h"
|
#include "content/public/browser/stream_info.h"
|
||||||
#include "net/base/escape.h"
|
#include "net/base/escape.h"
|
||||||
#include "net/ssl/client_cert_store.h"
|
#include "net/ssl/client_cert_store.h"
|
||||||
#include "net/url_request/url_request.h"
|
|
||||||
#include "url/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
|
||||||
#if defined(USE_NSS_CERTS)
|
#if defined(USE_NSS_CERTS)
|
||||||
|
@ -122,7 +120,9 @@ bool AtomResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
|
||||||
const std::string& mime_type,
|
const std::string& mime_type,
|
||||||
GURL* origin,
|
GURL* origin,
|
||||||
std::string* payload) {
|
std::string* payload) {
|
||||||
if (mime_type == "application/pdf") {
|
const content::ResourceRequestInfo* info =
|
||||||
|
content::ResourceRequestInfo::ForRequest(request);
|
||||||
|
if (mime_type == "application/pdf" && info->IsMainFrame()) {
|
||||||
*origin = GURL(kPdfViewerUIOrigin);
|
*origin = GURL(kPdfViewerUIOrigin);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,5 @@ const char kPdfPluginSrc[] = "src";
|
||||||
|
|
||||||
const char kPdfViewerUIOrigin[] = "chrome://pdf-viewer/";
|
const char kPdfViewerUIOrigin[] = "chrome://pdf-viewer/";
|
||||||
const char kPdfViewerUIHost[] = "pdf-viewer";
|
const char kPdfViewerUIHost[] = "pdf-viewer";
|
||||||
const char kPdfViewerUIStreamId[] = "streamId";
|
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -28,7 +28,6 @@ extern const char kPdfPluginSrc[];
|
||||||
// Constants for PDF viewer webui.
|
// Constants for PDF viewer webui.
|
||||||
extern const char kPdfViewerUIOrigin[];
|
extern const char kPdfViewerUIOrigin[];
|
||||||
extern const char kPdfViewerUIHost[];
|
extern const char kPdfViewerUIHost[];
|
||||||
extern const char kPdfViewerUIStreamId[];
|
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue