Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1813)

Unified Diff: chrome/browser/pdf/pdf_extension_util.cc

Issue 1237343002: Fix nested GuestView's container bounds calculation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: betterfix Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/pdf/pdf_extension_util.cc
diff --git a/chrome/browser/pdf/pdf_extension_util.cc b/chrome/browser/pdf/pdf_extension_util.cc
index 1987a6851db45af9356f5311ec5f0dfd3e6119c0..f44c7a2df0ff2511b0c48f2d570724d3e72bfc19 100644
--- a/chrome/browser/pdf/pdf_extension_util.cc
+++ b/chrome/browser/pdf/pdf_extension_util.cc
@@ -8,6 +8,8 @@
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/grit/browser_resources.h"
+#include "content/public/test/browser_test_utils.h"
+#include "grit/component_extension_resources.h"
#include "ui/base/resource/resource_bundle.h"
namespace pdf_extension_util {
@@ -48,4 +50,23 @@ std::string GetManifest() {
return manifest_contents;
}
+bool EnsurePDFHasLoaded(content::WebContents* web_contents) {
raymes 2015/07/21 01:20:14 This file is used in production code however this
lazyboy 2015/07/21 03:55:06 Oh I missed that seeing pdf_extension_util and pdf
+ std::string scripting_api_js =
+ ResourceBundle::GetSharedInstance()
+ .GetRawDataResource(IDR_PDF_PDF_SCRIPTING_API_JS)
+ .as_string();
+ CHECK(content::ExecuteScript(web_contents, scripting_api_js));
+
+ bool load_success = false;
+ CHECK(content::ExecuteScriptAndExtractBool(
+ web_contents,
+ "var scriptingAPI = new PDFScriptingAPI(window, "
+ " document.getElementsByTagName('embed')[0]);"
+ "scriptingAPI.setLoadCallback(function(success) {"
+ " window.domAutomationController.send(success);"
+ "});",
+ &load_success));
+ return load_success;
+}
+
} // namespace pdf_extension_util
« no previous file with comments | « chrome/browser/pdf/pdf_extension_util.h ('k') | chrome/test/data/extensions/platform_apps/web_view/shim/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698