diff options
-rw-r--r-- | build/common.gypi | 23 | ||||
-rw-r--r-- | chrome/browser/browser_about_handler.cc | 4 | ||||
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 32 | ||||
-rw-r--r-- | chrome/browser/browser_resources.grd | 40 | ||||
-rw-r--r-- | chrome/browser/chrome_content_browser_client.cc | 2 | ||||
-rw-r--r-- | chrome/browser/prefs/browser_prefs.cc | 5 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_dependency_manager.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/tab_contents/tab_contents.cc | 5 | ||||
-rw-r--r-- | chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc | 9 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 8 | ||||
-rw-r--r-- | chrome/chrome_tests.gypi | 8 | ||||
-rw-r--r-- | chrome/common/chrome_utility_messages.h | 2 | ||||
-rw-r--r-- | chrome/renderer/chrome_content_renderer_client.cc | 2 | ||||
-rw-r--r-- | chrome/renderer/pepper/ppb_pdf_impl.cc | 2 | ||||
-rw-r--r-- | chrome/test/base/testing_browser_process.cc | 16 | ||||
-rw-r--r-- | chrome/utility/chrome_content_utility_client.cc | 5 | ||||
-rw-r--r-- | printing/printing.gyp | 11 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.cc | 8 |
18 files changed, 123 insertions, 61 deletions
diff --git a/build/common.gypi b/build/common.gypi index b6a0aeb..5b85430 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -246,6 +246,12 @@ # Enable Chrome browser extensions 'enable_extensions%': 1, + # Enable browser automation. + 'enable_automation%': 1, + + # Enable printing support and UI. + 'enable_printing%': 1, + # Enable Web Intents web content registration via HTML element # and WebUI managing such registrations. 'enable_web_intents_tag%': 0, @@ -473,13 +479,6 @@ 'linux_use_gold_flags%': 0, }], - # Enable automation on platforms other than Android. - ['OS=="android"', { - 'enable_automation%': 0, - }, { - 'enable_automation%': 1, - }], - # Enable Skia UI text drawing incrementally on different platforms. # http://crbug.com/105550 # @@ -559,6 +558,7 @@ 'test_isolation_mode%': '<(test_isolation_mode)', 'test_isolation_outdir%': '<(test_isolation_outdir)', 'enable_automation%': '<(enable_automation)', + 'enable_printing%': '<(enable_printing)', 'force_rlz_use_chrome_net%': '<(force_rlz_use_chrome_net)', 'enable_task_manager%': '<(enable_task_manager)', 'platformsdk_path%': '<(platformsdk_path)', @@ -875,7 +875,10 @@ 'input_speech%': 0, 'enable_web_intents%': 0, 'enable_extensions%': 0, + 'enable_automation%': 0, + 'enable_printing%': 0, 'java_bridge%': 1, + # Android does not support themes. 'enable_themes%': 0, @@ -1073,6 +1076,9 @@ ['enable_extensions==1', { 'grit_defines': ['-D', 'enable_extensions'], }], + ['enable_printing==1', { + 'grit_defines': ['-D', 'enable_printing'], + }], ['clang_use_chrome_plugins==1 and OS!="win"', { 'variables': { 'clang_chrome_plugins_flags': [ @@ -1507,6 +1513,9 @@ ['enable_automation==1', { 'defines': ['ENABLE_AUTOMATION=1'], }], + ['enable_printing==1', { + 'defines': ['ENABLE_PRINTING=1'], + }], ], # conditions for 'target_defaults' 'target_conditions': [ ['enable_wexit_time_destructors==1', { diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index ecb8f2c..989405d 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -46,7 +46,6 @@ const char* const kChromePaths[] = { chrome::kChromeUIPluginsHost, chrome::kChromeUIPolicyHost, chrome::kChromeUIPredictorsHost, - chrome::kChromeUIPrintHost, chrome::kChromeUIProfilerHost, chrome::kChromeUIQuotaInternalsHost, chrome::kChromeUISessionsHost, @@ -78,6 +77,9 @@ const char* const kChromePaths[] = { chrome::kChromeUISystemInfoHost, chrome::kChromeUIWallpaperHost, #endif +#if defined(ENABLE_PRINTING) + chrome::kChromeUIPrintHost, +#endif }; } // namespace diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 0325007..f3e5f0b 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -144,7 +144,7 @@ BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line) g_browser_process = this; clipboard_.reset(new ui::Clipboard); -#if !defined(OS_ANDROID) +#if defined(ENABLE_PRINTING) // Must be created after the NotificationService. print_job_manager_.reset(new printing::PrintJobManager); #endif @@ -281,7 +281,7 @@ unsigned int BrowserProcessImpl::ReleaseModule() { if (0 == module_ref_count_) { release_last_reference_callstack_ = base::debug::StackTrace(); -#if !defined(OS_ANDROID) +#if defined(ENABLE_PRINTING) // Wait for the pending print jobs to finish. Don't do this later, since // this might cause a nested message loop to run, and we don't want pending // tasks to run once teardown has started. @@ -499,27 +499,27 @@ printing::PrintJobManager* BrowserProcessImpl::print_job_manager() { printing::PrintPreviewTabController* BrowserProcessImpl::print_preview_tab_controller() { -#if defined(OS_ANDROID) - NOTIMPLEMENTED(); - return NULL; -#else +#if defined(ENABLE_PRINTING) DCHECK(CalledOnValidThread()); if (!print_preview_tab_controller_.get()) CreatePrintPreviewTabController(); return print_preview_tab_controller_.get(); +#else + NOTIMPLEMENTED(); + return NULL; #endif } printing::BackgroundPrintingManager* BrowserProcessImpl::background_printing_manager() { -#if defined(OS_ANDROID) - NOTIMPLEMENTED(); - return NULL; -#else +#if defined(ENABLE_PRINTING) DCHECK(CalledOnValidThread()); if (!background_printing_manager_.get()) CreateBackgroundPrintingManager(); return background_printing_manager_.get(); +#else + NOTIMPLEMENTED(); + return NULL; #endif } @@ -713,7 +713,7 @@ void BrowserProcessImpl::CreateLocalState() { pref_change_registrar_.Init(local_state_.get()); -#if !defined(OS_ANDROID) +#if defined(ENABLE_PRINTING) print_job_manager_->InitOnUIThread(local_state_.get()); #endif @@ -831,17 +831,21 @@ void BrowserProcessImpl::CreateStatusTray() { } void BrowserProcessImpl::CreatePrintPreviewTabController() { -#if defined(OS_ANDROID) - NOTIMPLEMENTED(); -#else +#if defined(ENABLE_PRINTING) DCHECK(print_preview_tab_controller_.get() == NULL); print_preview_tab_controller_ = new printing::PrintPreviewTabController(); +#else + NOTIMPLEMENTED(); #endif } void BrowserProcessImpl::CreateBackgroundPrintingManager() { +#if defined(ENABLE_PRINTING) DCHECK(background_printing_manager_.get() == NULL); background_printing_manager_.reset(new printing::BackgroundPrintingManager()); +#else + NOTIMPLEMENTED(); +#endif } void BrowserProcessImpl::CreateSafeBrowsingService() { diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd index 4bbb960..080addd 100644 --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd @@ -35,10 +35,12 @@ <include name="IDR_CERTIFICATE_VIEWER_JS" file="resources\certificate_viewer.js" type="BINDATA" /> <include name="IDR_CERTIFICATE_VIEWER_CSS" file="resources\certificate_viewer.css" type="BINDATA" /> </if> - <include name="IDR_CLOUDPRINT_MANIFEST" file="resources\cloud_print_app\manifest.json" type="BINDATA" /> - <include name="IDR_CLOUD_PRINT_SETUP_DONE_HTML" file="resources\cloud_print\cloud_print_setup_done.html" flattenhtml="true" type="BINDATA" /> - <include name="IDR_CLOUD_PRINT_SETUP_FLOW_HTML" file="resources\cloud_print\cloud_print_setup_flow.html" flattenhtml="true" type="BINDATA" /> - <include name="IDR_CLOUD_PRINT_SETUP_LOGIN_HTML" file="resources\cloud_print\cloud_print_setup_login.html" flattenhtml="true" type="BINDATA" /> + <if expr="pp_ifdef('enable_printing')"> + <include name="IDR_CLOUDPRINT_MANIFEST" file="resources\cloud_print_app\manifest.json" type="BINDATA" /> + <include name="IDR_CLOUD_PRINT_SETUP_DONE_HTML" file="resources\cloud_print\cloud_print_setup_done.html" flattenhtml="true" type="BINDATA" /> + <include name="IDR_CLOUD_PRINT_SETUP_FLOW_HTML" file="resources\cloud_print\cloud_print_setup_flow.html" flattenhtml="true" type="BINDATA" /> + <include name="IDR_CLOUD_PRINT_SETUP_LOGIN_HTML" file="resources\cloud_print\cloud_print_setup_login.html" flattenhtml="true" type="BINDATA" /> + </if> <include name="IDR_CRASHES_HTML" file="resources\crashes.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> <include name="IDR_CRASHES_JS" file="resources\crashes.js" type="BINDATA" /> <include name="IDR_CREDITS_HTML" file="resources\about_credits.html" flattenhtml="true" type="BINDATA" /> @@ -101,20 +103,22 @@ <include name="IDR_POLICY_CSS" file="resources\policy.css" type="BINDATA"/> <include name="IDR_POLICY_HTML" file="resources\policy.html" flattenhtml="true" allowexternalscript="true" type="BINDATA"/> <include name="IDR_POLICY_JS" file="resources\policy.js" type="BINDATA"/> - <include name="IDR_PRINT_PREVIEW_HTML" file="resources\print_preview\print_preview.html" flattenhtml="true" allowexternalscript="true" 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_CLASSIC_PRINTER_32" - file="resources\print_preview\images\classic_printer_32.png" type="BINDATA" /> - <include name="IDR_PRINT_PREVIEW_IMAGES_CLOUD_PRINTER_32" - file="resources\print_preview\images\cloud_printer_32.png" type="BINDATA" /> - <include name="IDR_PRINT_PREVIEW_IMAGES_CLOUD_PRINTER_SHARED_32" - file="resources\print_preview\images\cloud_printer_shared_32.png" type="BINDATA" /> - <include name="IDR_PRINT_PREVIEW_IMAGES_GOOGLE_PROMOTED_PRINTER_32" - file="resources\print_preview\images\google_promoted_printer_32.png" type="BINDATA" /> - <include name="IDR_PRINT_PREVIEW_IMAGES_MOBILE_32" - file="resources\print_preview\images\mobile_32.png" type="BINDATA" /> - <include name="IDR_PRINT_PREVIEW_IMAGES_MOBILE_SHARED_32" - file="resources\print_preview\images\mobile_shared_32.png" type="BINDATA" /> + <if expr="pp_ifdef('enable_printing')"> + <include name="IDR_PRINT_PREVIEW_HTML" file="resources\print_preview\print_preview.html" flattenhtml="true" allowexternalscript="true" 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_CLASSIC_PRINTER_32" + file="resources\print_preview\images\classic_printer_32.png" type="BINDATA" /> + <include name="IDR_PRINT_PREVIEW_IMAGES_CLOUD_PRINTER_32" + file="resources\print_preview\images\cloud_printer_32.png" type="BINDATA" /> + <include name="IDR_PRINT_PREVIEW_IMAGES_CLOUD_PRINTER_SHARED_32" + file="resources\print_preview\images\cloud_printer_shared_32.png" type="BINDATA" /> + <include name="IDR_PRINT_PREVIEW_IMAGES_GOOGLE_PROMOTED_PRINTER_32" + file="resources\print_preview\images\google_promoted_printer_32.png" type="BINDATA" /> + <include name="IDR_PRINT_PREVIEW_IMAGES_MOBILE_32" + file="resources\print_preview\images\mobile_32.png" type="BINDATA" /> + <include name="IDR_PRINT_PREVIEW_IMAGES_MOBILE_SHARED_32" + file="resources\print_preview\images\mobile_shared_32.png" type="BINDATA" /> + </if> <include name="IDR_PROFILER_HTML" file="resources\profiler\profiler.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> <include name="IDR_PROFILER_JS" file="resources\profiler\profiler.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_READER_OUT_OF_DATE_HTML" file="resources\reader_out_of_date.html" flattenhtml="true" type="BINDATA" /> diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 8202caf..9cc0a79 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -382,7 +382,7 @@ void ChromeContentBrowserClient::RenderProcessHostCreated( host->GetChannel()->AddFilter(new ChromeRenderMessageFilter( id, profile, profile->GetRequestContextForRenderProcess(id))); host->GetChannel()->AddFilter(new PluginInfoMessageFilter(id, profile)); -#if !defined(OS_ANDROID) +#if defined(ENABLE_PRINTING) host->GetChannel()->AddFilter(new PrintingMessageFilter(id)); #endif host->GetChannel()->AddFilter( diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index d896951..45ef651 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc @@ -151,11 +151,14 @@ void RegisterLocalState(PrefService* local_state) { FlagsUI::RegisterPrefs(local_state); ManagedMode::RegisterPrefs(local_state); NewTabPageHandler::RegisterPrefs(local_state); - printing::PrintJobManager::RegisterPrefs(local_state); PromoResourceService::RegisterPrefs(local_state); UpgradeDetector::RegisterPrefs(local_state); #endif +#if defined(ENABLE_PRINTING) + printing::PrintJobManager::RegisterPrefs(local_state); +#endif + #if defined(OS_CHROMEOS) chromeos::AudioHandler::RegisterPrefs(local_state); chromeos::language_prefs::RegisterPrefs(local_state); diff --git a/chrome/browser/profiles/profile_dependency_manager.cc b/chrome/browser/profiles/profile_dependency_manager.cc index 9230a22..04ce697 100644 --- a/chrome/browser/profiles/profile_dependency_manager.cc +++ b/chrome/browser/profiles/profile_dependency_manager.cc @@ -188,7 +188,7 @@ void ProfileDependencyManager::AssertFactoriesBuilt() { captive_portal::CaptivePortalServiceFactory::GetInstance(); #endif ChromeURLDataManagerFactory::GetInstance(); -#if !defined(OS_ANDROID) +#if defined(ENABLE_PRINTING) CloudPrintProxyServiceFactory::GetInstance(); #endif CookieSettings::Factory::GetInstance(); diff --git a/chrome/browser/ui/tab_contents/tab_contents.cc b/chrome/browser/ui/tab_contents/tab_contents.cc index c4bf323eb..1a528dd 100644 --- a/chrome/browser/ui/tab_contents/tab_contents.cc +++ b/chrome/browser/ui/tab_contents/tab_contents.cc @@ -121,7 +121,6 @@ TabContents::TabContents(WebContents* contents) zoom_controller_.reset(new ZoomController(this)); #if !defined(OS_ANDROID) - print_view_manager_.reset(new printing::PrintViewManager(this)); sad_tab_helper_.reset(new SadTabHelper(contents)); #endif @@ -147,6 +146,10 @@ TabContents::TabContents(WebContents* contents) #if !defined(OS_ANDROID) if (OmniboxSearchHint::IsEnabled(profile())) omnibox_search_hint_.reset(new OmniboxSearchHint(this)); +#endif + +#if defined(ENABLE_PRINTING) + print_view_manager_.reset(new printing::PrintViewManager(this)); print_preview_.reset(new printing::PrintPreviewMessageHandler(contents)); #endif diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index 14e55ab..f61f82b 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc @@ -235,15 +235,16 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, // extensions, etc) aren't supported. if (url.host() == chrome::kChromeUIInspectHost) return &NewWebUI<InspectUI>; - // Android doesn't support print/print-preview. + // Android does not support plugins for now. + if (url.host() == chrome::kChromeUIPluginsHost) + return &NewWebUI<PluginsUI>; +#endif +#if defined(ENABLE_PRINTING) if (url.host() == chrome::kChromeUIPrintHost && !g_browser_process->local_state()->GetBoolean( prefs::kPrintPreviewDisabled)) { return &NewWebUI<PrintPreviewUI>; } - // Android does not support plugins for now. - if (url.host() == chrome::kChromeUIPluginsHost) - return &NewWebUI<PluginsUI>; #endif #if defined(OS_WIN) if (url.host() == chrome::kChromeUIConflictsHost) diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index f1be1eb..d5c3980 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -4637,6 +4637,12 @@ ['exclude', '^browser/automation/'], ], }], + ['enable_printing!=1', { + 'sources/': [ + ['exclude', '^browser/printing/'], + ['exclude', '^browser/ui/webui/print_preview/'], + ], + }], ['enable_session_service!=1', { 'sources!': [ 'browser/sessions/session_restore.cc', @@ -4698,7 +4704,6 @@ ['exclude', '^browser/captive_portal/'], ['exclude', '^browser/chrome_to_mobile'], ['exclude', '^browser/importer/'], - ['exclude', '^browser/printing/'], ['exclude', '^browser/ui/panels/'], ['exclude', '^browser/ui/tabs/'], ['exclude', '^browser/ui/toolbar/'], @@ -4709,7 +4714,6 @@ ['exclude', '^browser/ui/webui/inspect_'], ['exclude', '^browser/ui/webui/options'], ['exclude', '^browser/ui/webui/options2'], - ['exclude', '^browser/ui/webui/print_preview/'], ['exclude', '^browser/ui/webui/signin/'], ['exclude', '^browser/ui/webui/sync_promo'], ['exclude', '^browser/usb/'], diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index b525f80..41a79be 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -2106,6 +2106,12 @@ ['exclude', '^browser/automation/'], ], }], + ['enable_printing!=1', { + 'sources/': [ + ['exclude', '^browser/printing/'], + ['exclude', '^browser/ui/webui/print_preview/'], + ], + }], ['enable_session_service!=1', { 'sources!': [ 'browser/sessions/session_service_unittest.cc', @@ -2366,14 +2372,12 @@ 'sources/': [ ['exclude', '^browser/captive_portal/'], ['exclude', '^browser/chrome_to_mobile'], - ['exclude', '^browser/printing/'], ['exclude', '^browser/themes/'], ['exclude', '^browser/ui/panels'], ['exclude', '^browser/ui/tabs/'], ['exclude', '^browser/ui/toolbar/'], ['exclude', '^browser/ui/webui/options/'], ['exclude', '^browser/ui/webui/options2/'], - ['exclude', '^browser/ui/webui/print_preview/'], # No service process on Android. ['exclude', '^common/service_'], ['exclude', '^service/'], diff --git a/chrome/common/chrome_utility_messages.h b/chrome/common/chrome_utility_messages.h index 0f58ce5..df8aefa 100644 --- a/chrome/common/chrome_utility_messages.h +++ b/chrome/common/chrome_utility_messages.h @@ -161,11 +161,13 @@ IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseJSON_Succeeded, IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_ParseJSON_Failed, std::string /* error message, if any*/) +#if defined(ENABLE_PRINTING) // Reply when the utility process has succeeded in obtaining the printer // capabilities and defaults. IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded, std::string /* printer name */, printing::PrinterCapsAndDefaults) +#endif // Reply when the utility process has failed to obtain the printer // capabilities and defaults. diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index 6a2dea2..f67675c 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -254,7 +254,9 @@ void ChromeContentRendererClient::RenderViewCreated( } new ExtensionHelper(render_view, extension_dispatcher_.get()); new PageLoadHistograms(render_view, histogram_snapshots_.get()); +#if defined(ENABLE_PRINTING) new PrintWebViewHelper(render_view); +#endif new SearchBox(render_view); new SpellCheckProvider(render_view, this); new prerender::PrerendererClient(render_view); diff --git a/chrome/renderer/pepper/ppb_pdf_impl.cc b/chrome/renderer/pepper/ppb_pdf_impl.cc index ff3baea..388c4dd 100644 --- a/chrome/renderer/pepper/ppb_pdf_impl.cc +++ b/chrome/renderer/pepper/ppb_pdf_impl.cc @@ -372,6 +372,7 @@ const PPB_PDF* PPB_PDF_Impl::GetInterface() { // static void PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) { +#if defined(ENABLE_PRINTING) PluginInstance* instance = HostGlobals::Get()->GetInstance(instance_id); if (!instance) return; @@ -383,4 +384,5 @@ void PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) { PrintWebViewHelper* print_view_helper = PrintWebViewHelper::Get(render_view); if (print_view_helper) print_view_helper->PrintNode(element); +#endif } diff --git a/chrome/test/base/testing_browser_process.cc b/chrome/test/base/testing_browser_process.cc index 8ae4c44..9f368f7 100644 --- a/chrome/test/base/testing_browser_process.cc +++ b/chrome/test/base/testing_browser_process.cc @@ -188,27 +188,27 @@ printing::PrintJobManager* TestingBrowserProcess::print_job_manager() { printing::PrintPreviewTabController* TestingBrowserProcess::print_preview_tab_controller() { -#if defined(OS_ANDROID) - NOTIMPLEMENTED(); - return NULL; -#else +#if defined(ENABLE_PRINTING) if (!print_preview_tab_controller_.get()) print_preview_tab_controller_ = new printing::PrintPreviewTabController(); return print_preview_tab_controller_.get(); +#else + NOTIMPLEMENTED(); + return NULL; #endif } printing::BackgroundPrintingManager* TestingBrowserProcess::background_printing_manager() { -#if defined(OS_ANDROID) - NOTIMPLEMENTED(); - return NULL; -#else +#if defined(ENABLE_PRINTING) if (!background_printing_manager_.get()) { background_printing_manager_.reset( new printing::BackgroundPrintingManager()); } return background_printing_manager_.get(); +#else + NOTIMPLEMENTED(); + return NULL; #endif } diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc index 7bccbfc..9a129e9 100644 --- a/chrome/utility/chrome_content_utility_client.cc +++ b/chrome/utility/chrome_content_utility_client.cc @@ -371,6 +371,7 @@ void ChromeContentUtilityClient::OnParseJSON(const std::string& json) { void ChromeContentUtilityClient::OnGetPrinterCapsAndDefaults( const std::string& printer_name) { +#if defined(ENABLE_PRINTING) scoped_refptr<printing::PrintBackend> print_backend = printing::PrintBackend::CreateInstance(NULL); printing::PrinterCapsAndDefaults printer_info; @@ -381,7 +382,9 @@ void ChromeContentUtilityClient::OnGetPrinterCapsAndDefaults( if (print_backend->GetPrinterCapsAndDefaults(printer_name, &printer_info)) { Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded( printer_name, printer_info)); - } else { + } else +#endif + { Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed( printer_name)); } diff --git a/printing/printing.gyp b/printing/printing.gyp index 7d02e60..19fa1b2 100644 --- a/printing/printing.gyp +++ b/printing/printing.gyp @@ -87,6 +87,11 @@ ], }, 'conditions': [ + ['enable_printing!=1', { + 'sources/': [ + ['exclude', '.'], + ], + }], ['toolkit_uses_gtk == 0',{ 'sources/': [['exclude', '_cairo\\.cc$']] }], @@ -209,6 +214,12 @@ 'units_unittest.cc', ], 'conditions': [ + ['enable_printing!=1', { + 'sources/': [ + ['exclude', '.'], + ['include', 'run_all_unittests.cc'], + ], + }], ['toolkit_uses_gtk == 0', {'sources/': [['exclude', '_gtk_unittest\\.cc$']]}], ['OS!="mac"', {'sources/': [['exclude', '_mac_unittest\\.(cc|mm?)$']]}], ['OS!="win"', {'sources/': [['exclude', '_win_unittest\\.cc$']]}], diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc index 429dd03..9973100 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -1169,6 +1169,7 @@ int PluginInstance::PrintBegin(const WebPrintParams& print_params) { } bool PluginInstance::PrintPage(int page_number, WebKit::WebCanvas* canvas) { +#if defined(ENABLE_PRINTING) DCHECK(plugin_print_interface_); PP_PrintPageNumberRange_Dev page_range; page_range.first_page_number = page_range.last_page_number = page_number; @@ -1188,6 +1189,9 @@ bool PluginInstance::PrintPage(int page_number, WebKit::WebCanvas* canvas) { { return PrintPageHelper(&page_range, 1, canvas); } +#else // defined(ENABLED_PRINTING) + return false; +#endif } bool PluginInstance::PrintPageHelper(PP_PrintPageNumberRange_Dev* page_ranges, @@ -1415,6 +1419,7 @@ PluginDelegate::PlatformContext3D* PluginInstance::CreateContext3D() { bool PluginInstance::PrintPDFOutput(PP_Resource print_output, WebKit::WebCanvas* canvas) { +#if defined(ENABLE_PRINTING) ::ppapi::thunk::EnterResourceNoLock<PPB_Buffer_API> enter(print_output, true); if (enter.failed()) return false; @@ -1518,6 +1523,9 @@ bool PluginInstance::PrintPDFOutput(PP_Resource print_output, #endif // defined(OS_WIN) return ret; +#else // defined(ENABLE_PRINTING) + return false; +#endif } PPB_Graphics2D_Impl* PluginInstance::GetBoundGraphics2D() const { |