summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgn <dgn@chromium.org>2015-01-13 10:13:07 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-13 18:14:48 +0000
commit445b5974445aa9a0f8afc87214f9dff090d5255c (patch)
tree318fead70b2289c088af7e16b144ea14472967b5
parent8d4511585ca0bba6364a53dcf6c2e2b5c4015d49 (diff)
downloadchromium_src-445b5974445aa9a0f8afc87214f9dff090d5255c.zip
chromium_src-445b5974445aa9a0f8afc87214f9dff090d5255c.tar.gz
chromium_src-445b5974445aa9a0f8afc87214f9dff090d5255c.tar.bz2
Moving files from //chrome to //components/printing
Other changes: - Modifying #includes and .gypi to target the new paths - Modifying DEPS files to allow the new paths - New gn, gypi, DEPS and OWNERS files for the new //components/printing BUG=444883 Review URL: https://codereview.chromium.org/811563008 Cr-Commit-Position: refs/heads/master@{#311293}
-rw-r--r--chrome/browser/DEPS1
-rw-r--r--chrome/browser/browser_resources.grd3
-rw-r--r--chrome/browser/printing/print_dialog_cloud.cc2
-rw-r--r--chrome/browser/printing/print_preview_dialog_controller_browsertest.cc4
-rw-r--r--chrome/browser/printing/print_preview_message_handler.cc2
-rw-r--r--chrome/browser/printing/print_preview_pdf_generated_browsertest.cc2
-rw-r--r--chrome/browser/printing/print_view_manager.cc2
-rw-r--r--chrome/browser/printing/print_view_manager_base.cc2
-rw-r--r--chrome/browser/printing/print_view_manager_basic.cc2
-rw-r--r--chrome/browser/printing/printing_message_filter.cc2
-rw-r--r--chrome/browser/renderer_context_menu/render_view_context_menu.cc2
-rw-r--r--chrome/browser/ui/webui/print_preview/print_preview_handler.cc2
-rw-r--r--chrome/browser/ui/webui/print_preview/print_preview_ui.cc2
-rw-r--r--chrome/chrome_common.gypi10
-rw-r--r--chrome/chrome_renderer.gypi7
-rw-r--r--chrome/common/BUILD.gn1
-rw-r--r--chrome/common/DEPS1
-rw-r--r--chrome/common/common_message_generator.h2
-rw-r--r--chrome/renderer/BUILD.gn6
-rw-r--r--chrome/renderer/DEPS2
-rw-r--r--chrome/renderer/chrome_content_renderer_client.cc2
-rw-r--r--chrome/renderer/chrome_mock_render_thread.cc2
-rw-r--r--chrome/renderer/chrome_render_frame_observer.cc4
-rw-r--r--chrome/renderer/pepper/chrome_pdf_print_client.cc2
-rw-r--r--chrome/renderer/printing/chrome_print_web_view_helper_delegate.h2
-rw-r--r--chrome/renderer/printing/mock_printer.cc2
-rw-r--r--chrome/renderer/printing/print_web_view_helper_browsertest.cc4
-rw-r--r--components/OWNERS5
-rw-r--r--components/components.gyp7
-rw-r--r--components/printing.gypi49
-rw-r--r--components/printing/DEPS7
-rw-r--r--components/printing/OWNERS4
-rw-r--r--components/printing/README3
-rw-r--r--components/printing/common/BUILD.gn18
-rw-r--r--components/printing/common/OWNERS14
-rw-r--r--components/printing/common/print_messages.cc (renamed from chrome/common/print_messages.cc)2
-rw-r--r--components/printing/common/print_messages.h (renamed from chrome/common/print_messages.h)6
-rw-r--r--components/printing/renderer/BUILD.gn31
-rw-r--r--components/printing/renderer/DEPS6
-rw-r--r--components/printing/renderer/print_web_view_helper.cc (renamed from chrome/renderer/printing/print_web_view_helper.cc)6
-rw-r--r--components/printing/renderer/print_web_view_helper.h (renamed from chrome/renderer/printing/print_web_view_helper.h)6
-rw-r--r--components/printing/renderer/print_web_view_helper_android.cc (renamed from chrome/renderer/printing/print_web_view_helper_android.cc)2
-rw-r--r--components/printing/renderer/print_web_view_helper_linux.cc (renamed from chrome/renderer/printing/print_web_view_helper_linux.cc)4
-rw-r--r--components/printing/renderer/print_web_view_helper_mac.mm (renamed from chrome/renderer/printing/print_web_view_helper_mac.mm)4
-rw-r--r--components/printing/renderer/print_web_view_helper_pdf_win.cc (renamed from chrome/renderer/printing/print_web_view_helper_pdf_win.cc)4
-rw-r--r--components/printing/resources/print_preview_page.html (renamed from chrome/browser/resources/print_preview/print_preview_page.html)0
-rw-r--r--components/resources/components_resources.grd1
-rw-r--r--components/resources/printing_resources.grdp6
48 files changed, 200 insertions, 60 deletions
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS
index e310f4f..3680af8 100644
--- a/chrome/browser/DEPS
+++ b/chrome/browser/DEPS
@@ -57,6 +57,7 @@ include_rules = [
"+components/power",
"+components/precache",
"+components/pref_registry",
+ "+components/printing/common",
"+components/proximity_auth",
"+components/query_parser",
"+components/rappor",
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
index 2b81d9a..19e6224 100644
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
@@ -255,7 +255,6 @@
<include name="IDR_PRERENDER_URL_WHITELIST" file="resources\prerender_url_whitelist.dat" type="BINDATA"/>
<if expr="enable_print_preview">
<include name="IDR_PRINT_PREVIEW_HTML" file="resources\print_preview\print_preview.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
- <include name="IDR_PRINT_PREVIEW_PAGE" file="resources\print_preview\print_preview_page.html" flattenhtml="true" allowexternalscript="false" type="BINDATA" />
<include name="IDR_PRINT_PREVIEW_JS" file="resources\print_preview\print_preview.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_PRINT_PREVIEW_IMAGES_PRINTER"
file="resources\print_preview\images\printer.png" type="BINDATA" />
@@ -344,7 +343,7 @@
<include name="IDR_BLUETOOTH_PAIR_DEVICE_HTML" file="resources\chromeos\bluetooth_pair_device.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SIM_UNLOCK_HTML" file="resources\chromeos\sim_unlock.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SLOW_HTML" file="resources\chromeos\slow.html" flattenhtml="true" type="BINDATA" />
- <include name="IDR_SLOW_JS" file="resources\chromeos\slow.js" type="BINDATA" />
+ <include name="IDR_SLOW_JS" file="resources\chromeos\slow.js" type="BINDATA" />
</if>
<if expr="chromeos">
<include name="IDR_DEMO_APP_MANIFEST" file="resources\chromeos\demo_app\manifest.json" type="BINDATA" />
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc
index 1fbfbdd..1a72938 100644
--- a/chrome/browser/printing/print_dialog_cloud.cc
+++ b/chrome/browser/printing/print_dialog_cloud.cc
@@ -24,11 +24,11 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
-#include "chrome/common/print_messages.h"
#include "chrome/common/url_constants.h"
#include "components/cloud_devices/common/cloud_devices_urls.h"
#include "components/google/core/browser/google_util.h"
#include "components/pref_registry/pref_registry_syncable.h"
+#include "components/printing/common/print_messages.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
diff --git a/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc b/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
index b4402af..06817a2 100644
--- a/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
+++ b/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
@@ -8,14 +8,14 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/common/print_messages.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "components/printing/common/print_messages.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/browser_test_utils.h"
-#include "url/gurl.h"
#include "ipc/ipc_message_macros.h"
+#include "url/gurl.h"
using content::WebContents;
using content::WebContentsObserver;
diff --git a/chrome/browser/printing/print_preview_message_handler.cc b/chrome/browser/printing/print_preview_message_handler.cc
index 0aec73f..da1f6a4 100644
--- a/chrome/browser/printing/print_preview_message_handler.cc
+++ b/chrome/browser/printing/print_preview_message_handler.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/printing/printer_query.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
-#include "chrome/common/print_messages.h"
+#include "components/printing/common/print_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/printing/print_preview_pdf_generated_browsertest.cc b/chrome/browser/printing/print_preview_pdf_generated_browsertest.cc
index 62f1786..367a92d 100644
--- a/chrome/browser/printing/print_preview_pdf_generated_browsertest.cc
+++ b/chrome/browser/printing/print_preview_pdf_generated_browsertest.cc
@@ -31,9 +31,9 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
#include "chrome/common/chrome_paths.h"
-#include "chrome/common/print_messages.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "components/printing/common/print_messages.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_message_handler.h"
#include "content/public/test/browser_test_utils.h"
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc
index 7d4842c..2a2416a 100644
--- a/chrome/browser/printing/print_view_manager.cc
+++ b/chrome/browser/printing/print_view_manager.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/printing/print_preview_dialog_controller.h"
#include "chrome/browser/printing/print_view_manager_observer.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
-#include "chrome/common/print_messages.h"
+#include "components/printing/common/print_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
index 6b98380..efa7b1a 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -17,8 +17,8 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/simple_message_box.h"
#include "chrome/common/pref_names.h"
-#include "chrome/common/print_messages.h"
#include "chrome/grit/generated_resources.h"
+#include "components/printing/common/print_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
diff --git a/chrome/browser/printing/print_view_manager_basic.cc b/chrome/browser/printing/print_view_manager_basic.cc
index d978999..0697e71 100644
--- a/chrome/browser/printing/print_view_manager_basic.cc
+++ b/chrome/browser/printing/print_view_manager_basic.cc
@@ -6,7 +6,7 @@
#if defined(OS_ANDROID)
#include "base/file_descriptor_posix.h"
-#include "chrome/common/print_messages.h"
+#include "components/printing/common/print_messages.h"
#include "printing/printing_context_android.h"
#endif
diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc
index 95ea29e..a4cf147 100644
--- a/chrome/browser/printing/printing_message_filter.cc
+++ b/chrome/browser/printing/printing_message_filter.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/printing/printer_query.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
-#include "chrome/common/print_messages.h"
+#include "components/printing/common/print_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index adb669a..0b8d9f8 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -103,7 +103,7 @@
#if defined(ENABLE_PRINTING)
#include "chrome/browser/printing/print_view_manager_common.h"
-#include "chrome/common/print_messages.h"
+#include "components/printing/common/print_messages.h"
#if defined(ENABLE_PRINT_PREVIEW)
#include "chrome/browser/printing/print_preview_context_menu_observer.h"
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index f6c7653..685284e 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -52,10 +52,10 @@
#include "chrome/common/cloud_print/cloud_print_constants.h"
#include "chrome/common/crash_keys.h"
#include "chrome/common/pref_names.h"
-#include "chrome/common/print_messages.h"
#include "components/cloud_devices/common/cloud_device_description.h"
#include "components/cloud_devices/common/cloud_devices_urls.h"
#include "components/cloud_devices/common/printer_description.h"
+#include "components/printing/common/print_messages.h"
#include "components/signin/core/browser/account_reconcilor.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/signin/core/browser/signin_manager.h"
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
index 4b8262f..9920646 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
@@ -24,11 +24,11 @@
#include "chrome/browser/ui/webui/metrics_handler.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_handler.h"
#include "chrome/browser/ui/webui/theme_source.h"
-#include "chrome/common/print_messages.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/google_chrome_strings.h"
+#include "components/printing/common/print_messages.h"
#include "content/public/browser/url_data_source.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_data_source.h"
diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi
index 9dd4508..27a20dd 100644
--- a/chrome/chrome_common.gypi
+++ b/chrome/chrome_common.gypi
@@ -87,8 +87,6 @@
'common/pref_names_util.cc',
'common/pref_names_util.h',
'common/prerender_types.h',
- 'common/print_messages.cc',
- 'common/print_messages.h',
'common/profiling.cc',
'common/profiling.h',
'common/ref_counted_util.h',
@@ -415,13 +413,9 @@
'common/pepper_permission_util.h',
],
}],
- ['enable_basic_printing==0 and enable_print_preview==0', {
- 'sources!': [
- 'common/print_messages.cc',
- 'common/print_messages.h',
- ]
- }, {
+ ['enable_basic_printing==1 or enable_print_preview==1', {
'dependencies': [
+ '<(DEPTH)/components/components.gyp:printing_common',
'<(DEPTH)/printing/printing.gyp:printing',
],
}],
diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi
index 1d60c3a..e8c936e 100644
--- a/chrome/chrome_renderer.gypi
+++ b/chrome/chrome_renderer.gypi
@@ -235,12 +235,6 @@
'chrome_renderer_printing_sources': [
'renderer/printing/chrome_print_web_view_helper_delegate.cc',
'renderer/printing/chrome_print_web_view_helper_delegate.h',
- 'renderer/printing/print_web_view_helper.cc',
- 'renderer/printing/print_web_view_helper.h',
- 'renderer/printing/print_web_view_helper_android.cc',
- 'renderer/printing/print_web_view_helper_linux.cc',
- 'renderer/printing/print_web_view_helper_mac.mm',
- 'renderer/printing/print_web_view_helper_pdf_win.cc',
],
'chrome_renderer_full_printing_sources': [
'renderer/pepper/chrome_pdf_print_client.cc',
@@ -369,6 +363,7 @@
}],
['enable_basic_printing==1 or enable_print_preview==1', {
'dependencies': [
+ '../components/components.gyp:printing_renderer',
'../printing/printing.gyp:printing',
],
'sources': [
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn
index e34c64d..2375ffe 100644
--- a/chrome/common/BUILD.gn
+++ b/chrome/common/BUILD.gn
@@ -59,6 +59,7 @@ static_library("common") {
"//components/json_schema",
"//components/metrics",
"//components/policy:policy_component_common",
+ "//components/printing/common:printing_common",
"//components/translate/core/common",
"//components/variations",
"//content/public/common",
diff --git a/chrome/common/DEPS b/chrome/common/DEPS
index 340d725..0d72e9b 100644
--- a/chrome/common/DEPS
+++ b/chrome/common/DEPS
@@ -14,6 +14,7 @@ include_rules = [
"+components/metrics/metrics_pref_names.h",
"+components/nacl/common",
"+components/password_manager/core/common",
+ "+components/printing/common",
"+components/policy/core/common",
"+components/signin/core/common",
"+components/translate/core/common",
diff --git a/chrome/common/common_message_generator.h b/chrome/common/common_message_generator.h
index c1492a5..c62ee03 100644
--- a/chrome/common/common_message_generator.h
+++ b/chrome/common/common_message_generator.h
@@ -28,7 +28,7 @@
#if defined(ENABLE_PRINTING)
#include "chrome/common/chrome_utility_printing_messages.h"
-#include "chrome/common/print_messages.h"
+#include "components/printing/common/print_messages.h"
#endif
#if defined(ENABLE_SPELLCHECK)
diff --git a/chrome/renderer/BUILD.gn b/chrome/renderer/BUILD.gn
index 351fcad..600bf53 100644
--- a/chrome/renderer/BUILD.gn
+++ b/chrome/renderer/BUILD.gn
@@ -42,6 +42,7 @@ static_library("renderer") {
"//components/error_page/renderer",
"//components/password_manager/content/renderer",
"//components/plugins/renderer",
+ "//components/printing/renderer:printing_renderer",
"//components/startup_metric_utils",
"//components/translate/content/renderer",
"//components/translate/core/common",
@@ -159,11 +160,6 @@ static_library("renderer") {
sources +=
rebase_path(gypi_values.chrome_renderer_non_android_sources, ".", "..")
}
-
- # TODO(GYP)
- # 'sources': [
- # 'renderer/printing/print_web_view_helper_pdf_win.cc',
- # ],
}
# In GYP this is part of test_support_common.
diff --git a/chrome/renderer/DEPS b/chrome/renderer/DEPS
index 0234d47..41a1a916 100644
--- a/chrome/renderer/DEPS
+++ b/chrome/renderer/DEPS
@@ -14,6 +14,8 @@ include_rules = [
"+components/password_manager/content/renderer",
"+components/pdf/renderer",
"+components/plugins/renderer",
+ "+components/printing/common",
+ "+components/printing/renderer",
"+components/dns_prefetch/renderer",
"+components/signin/core/common",
"+components/translate/content/common",
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index 4ae3bc4..356f7af 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -49,7 +49,6 @@
#include "chrome/renderer/prerender/prerender_media_load_deferrer.h"
#include "chrome/renderer/prerender/prerenderer_client.h"
#include "chrome/renderer/principals_extension_bindings.h"
-#include "chrome/renderer/printing/print_web_view_helper.h"
#include "chrome/renderer/safe_browsing/malware_dom_details.h"
#include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h"
#include "chrome/renderer/searchbox/search_bouncer.h"
@@ -128,6 +127,7 @@
#if defined(ENABLE_PRINTING)
#include "chrome/renderer/printing/chrome_print_web_view_helper_delegate.h"
+#include "components/printing/renderer/print_web_view_helper.h"
#endif
#if defined(ENABLE_PRINT_PREVIEW)
diff --git a/chrome/renderer/chrome_mock_render_thread.cc b/chrome/renderer/chrome_mock_render_thread.cc
index 637e777..bb3e589 100644
--- a/chrome/renderer/chrome_mock_render_thread.cc
+++ b/chrome/renderer/chrome_mock_render_thread.cc
@@ -24,7 +24,7 @@
#endif
#if defined(ENABLE_PRINTING)
-#include "chrome/common/print_messages.h"
+#include "components/printing/common/print_messages.h"
#endif
ChromeMockRenderThread::ChromeMockRenderThread()
diff --git a/chrome/renderer/chrome_render_frame_observer.cc b/chrome/renderer/chrome_render_frame_observer.cc
index 667cc6a3..8a814e3 100644
--- a/chrome/renderer/chrome_render_frame_observer.cc
+++ b/chrome/renderer/chrome_render_frame_observer.cc
@@ -10,10 +10,10 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/common/prerender_messages.h"
-#include "chrome/common/print_messages.h"
#include "chrome/common/render_messages.h"
#include "chrome/renderer/prerender/prerender_helper.h"
-#include "chrome/renderer/printing/print_web_view_helper.h"
+#include "components/printing/common/print_messages.h"
+#include "components/printing/renderer/print_web_view_helper.h"
#include "content/public/renderer/render_frame.h"
#include "skia/ext/image_operations.h"
#include "third_party/WebKit/public/platform/WebImage.h"
diff --git a/chrome/renderer/pepper/chrome_pdf_print_client.cc b/chrome/renderer/pepper/chrome_pdf_print_client.cc
index 51ab320..a0d8fee 100644
--- a/chrome/renderer/pepper/chrome_pdf_print_client.cc
+++ b/chrome/renderer/pepper/chrome_pdf_print_client.cc
@@ -4,7 +4,7 @@
#include "chrome/renderer/pepper/chrome_pdf_print_client.h"
-#include "chrome/renderer/printing/print_web_view_helper.h"
+#include "components/printing/renderer/print_web_view_helper.h"
#include "content/public/renderer/pepper_plugin_instance.h"
#include "content/public/renderer/render_view.h"
#include "third_party/WebKit/public/web/WebDocument.h"
diff --git a/chrome/renderer/printing/chrome_print_web_view_helper_delegate.h b/chrome/renderer/printing/chrome_print_web_view_helper_delegate.h
index 8a113bf..2561a59 100644
--- a/chrome/renderer/printing/chrome_print_web_view_helper_delegate.h
+++ b/chrome/renderer/printing/chrome_print_web_view_helper_delegate.h
@@ -5,7 +5,7 @@
#ifndef CHROME_RENDERER_PRINTING_CHROME_PRINT_WEB_VIEW_HELPER_DELEGATE_H_
#define CHROME_RENDERER_PRINTING_CHROME_PRINT_WEB_VIEW_HELPER_DELEGATE_H_
-#include "chrome/renderer/printing/print_web_view_helper.h"
+#include "components/printing/renderer/print_web_view_helper.h"
class ChromePrintWebViewHelperDelegate
: public printing::PrintWebViewHelper::Delegate {
diff --git a/chrome/renderer/printing/mock_printer.cc b/chrome/renderer/printing/mock_printer.cc
index dba8a34..210534c 100644
--- a/chrome/renderer/printing/mock_printer.cc
+++ b/chrome/renderer/printing/mock_printer.cc
@@ -9,7 +9,7 @@
#include "base/memory/shared_memory.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/common/print_messages.h"
+#include "components/printing/common/print_messages.h"
#include "ipc/ipc_message_utils.h"
#include "printing/pdf_metafile_skia.h"
#include "printing/units.h"
diff --git a/chrome/renderer/printing/print_web_view_helper_browsertest.cc b/chrome/renderer/printing/print_web_view_helper_browsertest.cc
index e766fa1..1e743cc 100644
--- a/chrome/renderer/printing/print_web_view_helper_browsertest.cc
+++ b/chrome/renderer/printing/print_web_view_helper_browsertest.cc
@@ -5,10 +5,10 @@
#include "base/command_line.h"
#include "base/run_loop.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/print_messages.h"
#include "chrome/renderer/printing/mock_printer.h"
-#include "chrome/renderer/printing/print_web_view_helper.h"
#include "chrome/test/base/chrome_render_view_test.h"
+#include "components/printing/common/print_messages.h"
+#include "components/printing/renderer/print_web_view_helper.h"
#include "content/public/renderer/render_view.h"
#include "ipc/ipc_listener.h"
#include "printing/print_job_constants.h"
diff --git a/components/OWNERS b/components/OWNERS
index 2758535..6b7cd48 100644
--- a/components/OWNERS
+++ b/components/OWNERS
@@ -160,6 +160,11 @@ per-file pdf.gypi=thestig@chromium.org
per-file precache*=bengr@chromium.org
per-file precache*=sclittle@chromium.org
+per-file printing*=alekseys@chromium.org
+per-file printing*=gene@chromium.org
+per-file printing*=thestig@chromium.org
+per-file printing*=vitalybuka@chromium.org
+
per-file policy*=mnissler@chromium.org
per-file policy*=bartfab@chromium.org
per-file policy*=atwilson@chromium.org
diff --git a/components/components.gyp b/components/components.gyp
index 6d3fb3e..0972d45 100644
--- a/components/components.gyp
+++ b/components/components.gyp
@@ -140,6 +140,13 @@
'webdata_services.gypi',
],
}],
+ ['android_webview_build == 0 and OS != "ios"', {
+ 'includes': [
+ # TODO(dgn) move it to a condition based on whether print is enabled
+ # once the duplicates have been removed from webview.
+ 'printing.gypi',
+ ],
+ }],
['enable_plugins==1', {
'includes': [
'pdf.gypi',
diff --git a/components/printing.gypi b/components/printing.gypi
new file mode 100644
index 0000000..442df52
--- /dev/null
+++ b/components/printing.gypi
@@ -0,0 +1,49 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ # GN: //components/printing/common:printing_common
+ 'target_name': 'printing_common',
+ 'type': 'static_library',
+ 'dependencies': [
+ '<(DEPTH)/base/base.gyp:base',
+ '<(DEPTH)/ipc/ipc.gyp:ipc',
+ '<(DEPTH)/printing/printing.gyp:printing',
+ '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
+ '<(DEPTH)/ui/gfx/gfx.gyp:gfx',
+ ],
+ 'sources': [
+ "printing/common/print_messages.cc",
+ "printing/common/print_messages.h",
+ ],
+ },{
+ # GN: //components/printing/common:printing_renderer
+ 'target_name': 'printing_renderer',
+ 'type': 'static_library',
+ 'dependencies': [
+ '<(DEPTH)/base/base.gyp:base',
+ '<(DEPTH)/content/content.gyp:content_common',
+ '<(DEPTH)/content/content.gyp:content_renderer',
+ '<(DEPTH)/net/net.gyp:net',
+ '<(DEPTH)/printing/printing.gyp:printing',
+ '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
+ '<(DEPTH)/ui/base/ui_base.gyp:ui_base',
+ 'components_resources.gyp:components_resources',
+ 'printing_common',
+ ],
+ 'sources': [
+ 'printing/renderer/print_web_view_helper.cc',
+ 'printing/renderer/print_web_view_helper.h',
+ 'printing/renderer/print_web_view_helper_android.cc',
+ 'printing/renderer/print_web_view_helper_linux.cc',
+ 'printing/renderer/print_web_view_helper_mac.mm',
+ 'printing/renderer/print_web_view_helper_pdf_win.cc',
+ ],
+ # TODO(dgn): C4267: http://crbug.com/167187 size_t -> int
+ 'msvs_disabled_warnings': [ 4267 ],
+ },
+ ],
+}
diff --git a/components/printing/DEPS b/components/printing/DEPS
new file mode 100644
index 0000000..057bda2
--- /dev/null
+++ b/components/printing/DEPS
@@ -0,0 +1,7 @@
+include_rules = [
+ "+content/public",
+ "+ipc",
+ "+printing",
+ "+third_party/WebKit/public",
+ "+ui/gfx"
+]
diff --git a/components/printing/OWNERS b/components/printing/OWNERS
new file mode 100644
index 0000000..4406a70
--- /dev/null
+++ b/components/printing/OWNERS
@@ -0,0 +1,4 @@
+alekseys@chromium.org
+gene@chromium.org
+thestig@chromium.org
+vitalybuka@chromium.org
diff --git a/components/printing/README b/components/printing/README
new file mode 100644
index 0000000..7e036f5
--- /dev/null
+++ b/components/printing/README
@@ -0,0 +1,3 @@
+Printing is a work in progress component. It is introduced to allow chrome
+and webview to share the common printing-related code. When completed, it will
+contain the code necessary for using basic printing in content-based clients.
diff --git a/components/printing/common/BUILD.gn b/components/printing/common/BUILD.gn
new file mode 100644
index 0000000..3110072
--- /dev/null
+++ b/components/printing/common/BUILD.gn
@@ -0,0 +1,18 @@
+# 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.
+
+static_library("printing_common") {
+ sources = [
+ "print_messages.cc",
+ "print_messages.h",
+ ]
+
+ deps = [
+ "//base",
+ "//ipc",
+ "//printing",
+ "//third_party/WebKit/public:blink",
+ "//ui/gfx",
+ ]
+}
diff --git a/components/printing/common/OWNERS b/components/printing/common/OWNERS
new file mode 100644
index 0000000..cbc9bc9
--- /dev/null
+++ b/components/printing/common/OWNERS
@@ -0,0 +1,14 @@
+# Changes to IPC messages require a security review to avoid introducing
+# new sandbox escapes.
+per-file *messages*.h=set noparent
+per-file *messages*.h=dcheng@chromium.org
+per-file *messages*.h=inferno@chromium.org
+per-file *messages*.h=jln@chromium.org
+per-file *messages*.h=jorgelo@chromium.org
+per-file *messages*.h=jschuh@chromium.org
+per-file *messages*.h=kenrb@chromium.org
+per-file *messages*.h=mkwst@chromium.org
+per-file *messages*.h=nasko@chromium.org
+per-file *messages*.h=palmer@chromium.org
+per-file *messages*.h=tsepez@chromium.org
+per-file *messages*.h=wfh@chromium.org
diff --git a/chrome/common/print_messages.cc b/components/printing/common/print_messages.cc
index 33420bc..3a5cddd 100644
--- a/chrome/common/print_messages.cc
+++ b/components/printing/common/print_messages.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/print_messages.h"
+#include "components/printing/common/print_messages.h"
#include "base/basictypes.h"
#include "base/strings/string16.h"
diff --git a/chrome/common/print_messages.h b/components/printing/common/print_messages.h
index 6ae0563..effc2f24 100644
--- a/chrome/common/print_messages.h
+++ b/components/printing/common/print_messages.h
@@ -19,8 +19,8 @@
#include "ui/gfx/ipc/gfx_param_traits.h"
#include "ui/gfx/native_widget_types.h"
-#ifndef CHROME_COMMON_PRINT_MESSAGES_H_
-#define CHROME_COMMON_PRINT_MESSAGES_H_
+#ifndef COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_
+#define COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_
struct PrintMsg_Print_Params {
PrintMsg_Print_Params();
@@ -82,7 +82,7 @@ struct PrintHostMsg_SetOptionsFromDocument_Params {
printing::PageRanges page_ranges;
};
-#endif // CHROME_COMMON_PRINT_MESSAGES_H_
+#endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_
#define IPC_MESSAGE_START PrintMsgStart
diff --git a/components/printing/renderer/BUILD.gn b/components/printing/renderer/BUILD.gn
new file mode 100644
index 0000000..768c95b
--- /dev/null
+++ b/components/printing/renderer/BUILD.gn
@@ -0,0 +1,31 @@
+# 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.
+
+static_library("printing_renderer") {
+ sources = [
+ "print_web_view_helper.cc",
+ "print_web_view_helper.h",
+ "print_web_view_helper_android.cc",
+ "print_web_view_helper_linux.cc",
+ "print_web_view_helper_mac.mm",
+ "print_web_view_helper_pdf_win.cc",
+ ]
+
+ deps = [
+ "//base",
+ "//components/printing/common:printing_common",
+ "//components/resources",
+ "//content/public/common",
+ "//content/public/renderer",
+ "//net",
+ "//printing",
+ "//third_party/WebKit/public:blink",
+ "//ui/base",
+ ]
+
+ if (is_win) {
+ # TODO(dgn): crbug.com/167187 fix size_t to int truncations.
+ cflags = [ "/wd4267" ]
+ }
+}
diff --git a/components/printing/renderer/DEPS b/components/printing/renderer/DEPS
new file mode 100644
index 0000000..ada73c4
--- /dev/null
+++ b/components/printing/renderer/DEPS
@@ -0,0 +1,6 @@
+include_rules = [
+ "+grit/components_resources.h",
+ "+net/base",
+ "+skia/ext",
+ "+ui/base",
+]
diff --git a/chrome/renderer/printing/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc
index 369348c..4c9368b 100644
--- a/chrome/renderer/printing/print_web_view_helper.cc
+++ b/components/printing/renderer/print_web_view_helper.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/renderer/printing/print_web_view_helper.h"
+#include "components/printing/renderer/print_web_view_helper.h"
#include <string>
@@ -15,12 +15,12 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/common/print_messages.h"
-#include "chrome/grit/browser_resources.h"
+#include "components/printing/common/print_messages.h"
#include "content/public/common/web_preferences.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/render_view.h"
+#include "grit/components_resources.h"
#include "net/base/escape.h"
#include "printing/pdf_metafile_skia.h"
#include "printing/units.h"
diff --git a/chrome/renderer/printing/print_web_view_helper.h b/components/printing/renderer/print_web_view_helper.h
index 0b71906..3e8e573 100644
--- a/chrome/renderer/printing/print_web_view_helper.h
+++ b/components/printing/renderer/print_web_view_helper.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_
-#define CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_
+#ifndef COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_
+#define COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_
#include <vector>
@@ -496,4 +496,4 @@ class PrintWebViewHelper
} // namespace printing
-#endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_
+#endif // COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_
diff --git a/chrome/renderer/printing/print_web_view_helper_android.cc b/components/printing/renderer/print_web_view_helper_android.cc
index 95da0ce..c5e4e4a 100644
--- a/chrome/renderer/printing/print_web_view_helper_android.cc
+++ b/components/printing/renderer/print_web_view_helper_android.cc
@@ -4,4 +4,4 @@
// All the necessary logic already lives in print_web_view_helper_linux.cc.
// We need a separate file for Android due to build/filename_rules.gypi rules.
-#include "chrome/renderer/printing/print_web_view_helper_linux.cc"
+#include "components/printing/renderer/print_web_view_helper_linux.cc"
diff --git a/chrome/renderer/printing/print_web_view_helper_linux.cc b/components/printing/renderer/print_web_view_helper_linux.cc
index ae862d9..1ebc2ca 100644
--- a/chrome/renderer/printing/print_web_view_helper_linux.cc
+++ b/components/printing/renderer/print_web_view_helper_linux.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/renderer/printing/print_web_view_helper.h"
+#include "components/printing/renderer/print_web_view_helper.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "chrome/common/print_messages.h"
+#include "components/printing/common/print_messages.h"
#include "content/public/renderer/render_thread.h"
#include "printing/metafile_skia_wrapper.h"
#include "printing/page_size_margins.h"
diff --git a/chrome/renderer/printing/print_web_view_helper_mac.mm b/components/printing/renderer/print_web_view_helper_mac.mm
index 508b486..ba1c946 100644
--- a/chrome/renderer/printing/print_web_view_helper_mac.mm
+++ b/components/printing/renderer/print_web_view_helper_mac.mm
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/renderer/printing/print_web_view_helper.h"
+#include "components/printing/renderer/print_web_view_helper.h"
#import <AppKit/AppKit.h>
#include "base/logging.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/metrics/histogram.h"
-#include "chrome/common/print_messages.h"
+#include "components/printing/common/print_messages.h"
#include "printing/metafile_skia_wrapper.h"
#include "printing/page_size_margins.h"
#include "skia/ext/platform_device.h"
diff --git a/chrome/renderer/printing/print_web_view_helper_pdf_win.cc b/components/printing/renderer/print_web_view_helper_pdf_win.cc
index f382ff6..5809639 100644
--- a/chrome/renderer/printing/print_web_view_helper_pdf_win.cc
+++ b/components/printing/renderer/print_web_view_helper_pdf_win.cc
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/renderer/printing/print_web_view_helper.h"
+#include "components/printing/renderer/print_web_view_helper.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/process/process_handle.h"
-#include "chrome/common/print_messages.h"
+#include "components/printing/common/print_messages.h"
#include "content/public/renderer/render_thread.h"
#include "printing/metafile_skia_wrapper.h"
#include "printing/page_size_margins.h"
diff --git a/chrome/browser/resources/print_preview/print_preview_page.html b/components/printing/resources/print_preview_page.html
index 4ea37f5..4ea37f5 100644
--- a/chrome/browser/resources/print_preview/print_preview_page.html
+++ b/components/printing/resources/print_preview_page.html
diff --git a/components/resources/components_resources.grd b/components/resources/components_resources.grd
index c9b2312..2d0dfbe 100644
--- a/components/resources/components_resources.grd
+++ b/components/resources/components_resources.grd
@@ -9,6 +9,7 @@
<release seq="1">
<includes>
<part file="dom_distiller_resources.grdp" />
+ <part file="printing_resources.grdp" />
<part file="translate_resources.grdp" />
</includes>
</release>
diff --git a/components/resources/printing_resources.grdp b/components/resources/printing_resources.grdp
new file mode 100644
index 0000000..7213746
--- /dev/null
+++ b/components/resources/printing_resources.grdp
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<grit-part>
+ <if expr="enable_print_preview">
+ <include name="IDR_PRINT_PREVIEW_PAGE" file="../printing/resources/print_preview_page.html" flattenhtml="true" allowexternalscript="false" type="BINDATA" />
+ </if>
+</grit-part>