summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael BrĂ¼ning <michael.bruning@qt.io>2019-01-14 17:18:05 +0100
committerMichael BrĂ¼ning <michael.bruning@qt.io>2019-01-31 11:18:34 +0000
commitf708f47083983328c522f0bdf9f163f14b83665a (patch)
tree021c65c3178b40e4ff7eea6e1b2be849a7f61832
parentc677809fe785df63fe97608cb5a949302b2f0c66 (diff)
downloadqtwebengine-chromium-f708f47083983328c522f0bdf9f163f14b83665a.tar.gz
Fixup extensions / pdf code for 71-based
Includes: * Flagging out unsupprted API from PDF viewer JavaScript files * Correctly excluding apps_shim build files in no-extension builds * Flagging out the extensions update method * Miscellaneous adaptations Change-Id: Ie4d95c1ca991bce8f064a99fc78d1e1ed9626d2d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--chromium/chrome/browser/apps/app_shim/BUILD.gn17
-rw-r--r--chromium/chrome/browser/extensions/api/streams_private/streams_private_api.cc4
-rw-r--r--chromium/chrome/browser/resources/pdf/browser_api.js11
-rw-r--r--chromium/chrome/browser/resources/pdf/metrics.js2
-rw-r--r--chromium/chrome/browser/resources/pdf/pdf_viewer.js2
-rw-r--r--chromium/chrome/common/extensions/api/BUILD.gn4
-rw-r--r--chromium/chrome/common/safe_browsing/BUILD.gn7
-rw-r--r--chromium/extensions/browser/extension_system.h3
-rw-r--r--chromium/tools/json_schema_compiler/h_generator.py2
9 files changed, 27 insertions, 25 deletions
diff --git a/chromium/chrome/browser/apps/app_shim/BUILD.gn b/chromium/chrome/browser/apps/app_shim/BUILD.gn
index d2d02de181e..19aa43bb16f 100644
--- a/chromium/chrome/browser/apps/app_shim/BUILD.gn
+++ b/chromium/chrome/browser/apps/app_shim/BUILD.gn
@@ -1,6 +1,7 @@
# Copyright 2015 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.
+import("//extensions/buildflags/buildflags.gni")
# This is the part of the Chrome browser process responsible for launching and
# communicating with app_shim processes on Mac.
@@ -14,8 +15,6 @@ source_set("app_shim") {
"app_shim_host_manager_mac.mm",
"apps_page_shim_handler.h",
"apps_page_shim_handler.mm",
- "extension_app_shim_handler_mac.cc",
- "extension_app_shim_handler_mac.h",
"unix_domain_socket_acceptor.cc",
"unix_domain_socket_acceptor.h",
]
@@ -35,8 +34,18 @@ source_set("app_shim") {
"//components/version_info",
"//content/public/browser",
"//content/public/common",
- "//extensions/browser",
- "//extensions/common",
"//ui/views:views",
]
+
+ if (enable_extensions) {
+ sources += [
+ "extension_app_shim_handler_mac.cc",
+ "extension_app_shim_handler_mac.h",
+ ]
+
+ deps += [
+ "//extensions/browser",
+ "//extensions/common",
+ ]
+ }
}
diff --git a/chromium/chrome/browser/extensions/api/streams_private/streams_private_api.cc b/chromium/chrome/browser/extensions/api/streams_private/streams_private_api.cc
index 73d951b1fac..68c610cffca 100644
--- a/chromium/chrome/browser/extensions/api/streams_private/streams_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/streams_private/streams_private_api.cc
@@ -72,7 +72,11 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent(
// will take ownership of the stream.
GURL handler_url(Extension::GetBaseURLFromExtensionId(extension_id).spec() +
handler->handler_url());
+#if !defined(TOOLKIT_QT)
int tab_id = ExtensionTabUtil::GetTabId(web_contents);
+#else
+ int tab_id = -1;
+#endif // !defined(TOOLKIT_QT)
std::unique_ptr<StreamContainer> stream_container(new StreamContainer(
std::move(stream), tab_id, embedded, handler_url, extension_id,
std::move(transferrable_loader), original_url));
diff --git a/chromium/chrome/browser/resources/pdf/browser_api.js b/chromium/chrome/browser/resources/pdf/browser_api.js
index fcab1f81cda..88c17d47f95 100644
--- a/chromium/chrome/browser/resources/pdf/browser_api.js
+++ b/chromium/chrome/browser/resources/pdf/browser_api.js
@@ -213,15 +213,8 @@ function createBrowserApiForPrintPreview() {
tabId: -1,
};
return new Promise(function(resolve, reject) {
- if (!chrome.tabs) {
resolve();
return;
- }
- chrome.tabs.getCurrent(function(tab) {
- streamInfo.tabId = tab.id;
- streamInfo.tabUrl = tab.url;
- resolve();
- });
})
.then(function() {
return BrowserApi.create(streamInfo, BrowserApi.ZoomBehavior.NONE);
@@ -233,9 +226,5 @@ function createBrowserApiForPrintPreview() {
* current environment.
*/
function createBrowserApi() {
- if (location.origin === 'chrome://print') {
return createBrowserApiForPrintPreview();
- }
-
- return createBrowserApiForMimeHandlerView();
}
diff --git a/chromium/chrome/browser/resources/pdf/metrics.js b/chromium/chrome/browser/resources/pdf/metrics.js
index d0cb77c8d97..9416835b45d 100644
--- a/chromium/chrome/browser/resources/pdf/metrics.js
+++ b/chromium/chrome/browser/resources/pdf/metrics.js
@@ -189,7 +189,7 @@ window.PDFMetricsImpl = class {
* @private
*/
log_(eventCode) {
- chrome.metricsPrivate.recordValue(this.actionsMetric_, eventCode);
+ // chrome.metricsPrivate.recordValue(this.actionsMetric_, eventCode);
}
/**
diff --git a/chromium/chrome/browser/resources/pdf/pdf_viewer.js b/chromium/chrome/browser/resources/pdf/pdf_viewer.js
index 862b73894fd..2c7412fefcd 100644
--- a/chromium/chrome/browser/resources/pdf/pdf_viewer.js
+++ b/chromium/chrome/browser/resources/pdf/pdf_viewer.js
@@ -313,7 +313,7 @@ function PDFViewer(browserApi) {
new ViewportScroller(this.viewport_, this.plugin_, window);
// Request translated strings.
- chrome.resourcesPrivate.getStrings('pdf', this.handleStrings_.bind(this));
+ // TO-DO mibrunin: check if this can / needs to be enabled chrome.resourcesPrivate.getStrings('pdf', this.handleStrings_.bind(this));
}
PDFViewer.prototype = {
diff --git a/chromium/chrome/common/extensions/api/BUILD.gn b/chromium/chrome/common/extensions/api/BUILD.gn
index 75d423b9ca6..8744d2cf98c 100644
--- a/chromium/chrome/common/extensions/api/BUILD.gn
+++ b/chromium/chrome/common/extensions/api/BUILD.gn
@@ -39,13 +39,11 @@ group("extensions_features") {
# Private Targets
generated_json_strings("generated_api_json_strings") {
- sources = ["streams_private.idl"]
-
configs = [ "//build/config:precompiled_headers" ]
bundle_name = "Chrome"
schema_include_rules = chrome_extensions_api_schema_include_rules
- sources += [
+ sources = [
"app.json",
"browser_action.json",
"commands.json",
diff --git a/chromium/chrome/common/safe_browsing/BUILD.gn b/chromium/chrome/common/safe_browsing/BUILD.gn
index f971c742a2d..aaf11889793 100644
--- a/chromium/chrome/common/safe_browsing/BUILD.gn
+++ b/chromium/chrome/common/safe_browsing/BUILD.gn
@@ -107,10 +107,6 @@ source_set("safe_browsing") {
":file_type_policies",
]
- if (is_mac) {
- deps += [ ":disk_image_type_sniffer_mac" ]
- }
-
if (safe_browsing_mode == 1) {
sources = [
"binary_feature_extractor.cc",
@@ -149,5 +145,8 @@ source_set("safe_browsing") {
"//ipc",
"//third_party/zlib/google:zip",
]
+ if (is_mac) {
+ deps += [ ":disk_image_type_sniffer_mac" ]
+ }
}
}
diff --git a/chromium/extensions/browser/extension_system.h b/chromium/extensions/browser/extension_system.h
index 5177822be88..f622573cd66 100644
--- a/chromium/extensions/browser/extension_system.h
+++ b/chromium/extensions/browser/extension_system.h
@@ -133,6 +133,7 @@ class ExtensionSystem : public KeyedService {
virtual std::unique_ptr<ExtensionSet> GetDependentExtensions(
const Extension* extension) = 0;
+#if !defined(TOOLKIT_QT)
// Install an updated version of |extension_id| with the version given in
// |unpacked_dir|. If |install_immediately| is true, the system will install
// the given extension immediately instead of waiting until idle. Ownership
@@ -143,7 +144,7 @@ class ExtensionSystem : public KeyedService {
const base::FilePath& unpacked_dir,
bool install_immediately,
InstallUpdateCallback install_update_callback) = 0;
-
+#endif
// Attempts finishing installation of an update for an extension with the
// specified id, when installation of that extension was previously delayed.
// |install_immediately| - Install the extension should be installed if it is
diff --git a/chromium/tools/json_schema_compiler/h_generator.py b/chromium/tools/json_schema_compiler/h_generator.py
index 90e34d33fa3..9a9bb9b81dd 100644
--- a/chromium/tools/json_schema_compiler/h_generator.py
+++ b/chromium/tools/json_schema_compiler/h_generator.py
@@ -281,7 +281,9 @@ class _Generator(object):
(c.Eblock()
.Append()
.Sblock(' private:')
+ .Append('#if !defined(__GNUC__) || __GNUC__ > 5')
.Append('DISALLOW_COPY_AND_ASSIGN(%(classname)s);')
+ .Append('#endif')
.Eblock('};')
)
return c.Substitute({'classname': classname})