Move printing related stuff to the root printing project from the browser project. This simplifies further refactoring and eases understanding of the printing part of Chrome.
Also renamed win_printing_context to printing_context_win (correct naming convention) and added stub implementations for _linux and mac. Now all but one file is compiling on all platforms. TEST=none (no functional change). BUG=none Review URL: http://codereview.chromium.org/149212 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20086 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
chrome
browser
browser_main.cc
chrome.gypprinting
print_job.ccprint_job_manager.ccprint_job_unittest.ccprint_job_worker.ccprint_job_worker.hprint_job_worker_owner.hprint_view_manager.ccprint_view_manager.hprinting_layout_uitest.cc
renderer_host
printing
DEPSemf_win.hemf_win_unittest.ccnative_metafile.hpage_number.ccpage_number.hpage_number_unittest.ccpage_overlays.ccpage_overlays.hpage_overlays_unittest.ccpage_range.ccpage_range.hpage_range_unittest.ccpage_setup.ccpage_setup.hpage_setup_unittest.ccprint_settings.ccprint_settings.hprinted_document.ccprinted_document.hprinted_page.ccprinted_page.hprinted_pages_source.hprinting.gypprinting_context.hprinting_context_linux.ccprinting_context_mac.ccprinting_context_win.ccprinting_context_win_unittest.ccprinting_test.h
@ -90,7 +90,6 @@
|
||||
#include "chrome/browser/jankometer.h"
|
||||
#include "chrome/browser/metrics/user_metrics.h"
|
||||
#include "chrome/browser/net/url_fixer_upper.h"
|
||||
#include "chrome/browser/printing/printed_document.h"
|
||||
#include "chrome/browser/profile.h"
|
||||
#include "chrome/browser/rlz/rlz.h"
|
||||
#include "chrome/browser/views/user_data_dir_dialog.h"
|
||||
@ -103,6 +102,7 @@
|
||||
#include "net/base/sdch_manager.h"
|
||||
#include "net/base/winsock_init.h"
|
||||
#include "net/http/http_network_layer.h"
|
||||
#include "printing/printed_document.h"
|
||||
#include "sandbox/src/sandbox.h"
|
||||
#include "views/widget/accelerator_handler.h"
|
||||
#endif // defined(OS_WIN)
|
||||
|
@ -7,9 +7,9 @@
|
||||
#include "base/message_loop.h"
|
||||
#include "base/timer.h"
|
||||
#include "chrome/browser/printing/print_job_worker.h"
|
||||
#include "chrome/browser/printing/printed_document.h"
|
||||
#include "chrome/browser/printing/printed_page.h"
|
||||
#include "chrome/common/notification_service.h"
|
||||
#include "printing/printed_document.h"
|
||||
#include "printing/printed_page.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4355) // 'this' : used in base member initializer list
|
||||
|
@ -6,9 +6,9 @@
|
||||
|
||||
#include "chrome/browser/printing/print_job.h"
|
||||
#include "chrome/browser/printing/printer_query.h"
|
||||
#include "chrome/browser/printing/printed_document.h"
|
||||
#include "chrome/browser/printing/printed_page.h"
|
||||
#include "chrome/common/notification_service.h"
|
||||
#include "printing/printed_document.h"
|
||||
#include "printing/printed_page.h"
|
||||
|
||||
namespace printing {
|
||||
|
||||
|
@ -5,9 +5,9 @@
|
||||
#include "base/message_loop.h"
|
||||
#include "chrome/browser/printing/print_job.h"
|
||||
#include "chrome/browser/printing/print_job_worker.h"
|
||||
#include "chrome/browser/printing/printed_pages_source.h"
|
||||
#include "chrome/common/notification_registrar.h"
|
||||
#include "chrome/common/notification_service.h"
|
||||
#include "printing/printed_pages_source.h"
|
||||
#include "googleurl/src/gurl.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
|
||||
#include "base/message_loop.h"
|
||||
#include "chrome/browser/printing/print_job.h"
|
||||
#include "chrome/browser/printing/printed_document.h"
|
||||
#include "chrome/browser/printing/printed_page.h"
|
||||
#include "chrome/common/notification_service.h"
|
||||
#include "printing/printed_document.h"
|
||||
#include "printing/printed_page.h"
|
||||
|
||||
namespace printing {
|
||||
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
#include "base/task.h"
|
||||
#include "base/thread.h"
|
||||
#include "chrome/browser/printing/page_number.h"
|
||||
#include "chrome/browser/printing/win_printing_context.h"
|
||||
#include "printing/page_number.h"
|
||||
#include "printing/printing_context.h"
|
||||
|
||||
namespace printing {
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__
|
||||
#define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__
|
||||
|
||||
#include "chrome/browser/printing/win_printing_context.h"
|
||||
#include "printing/printing_context.h"
|
||||
|
||||
class MessageLoop;
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/printing/print_job.h"
|
||||
#include "chrome/browser/printing/print_job_manager.h"
|
||||
#include "chrome/browser/printing/printed_document.h"
|
||||
#include "chrome/browser/printing/printer_query.h"
|
||||
#include "chrome/browser/renderer_host/render_view_host.h"
|
||||
#include "chrome/browser/tab_contents/navigation_entry.h"
|
||||
@ -18,6 +17,7 @@
|
||||
#include "chrome/common/render_messages.h"
|
||||
#include "grit/generated_resources.h"
|
||||
#include "printing/native_metafile.h"
|
||||
#include "printing/printed_document.h"
|
||||
|
||||
using base::TimeDelta;
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
#define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_
|
||||
|
||||
#include "base/ref_counted.h"
|
||||
#include "chrome/browser/printing/printed_pages_source.h"
|
||||
#include "chrome/common/notification_registrar.h"
|
||||
#include "printing/printed_pages_source.h"
|
||||
|
||||
class RenderViewHost;
|
||||
class TabContents;
|
||||
|
@ -15,8 +15,8 @@
|
||||
#include "chrome/test/automation/tab_proxy.h"
|
||||
#include "chrome/test/automation/window_proxy.h"
|
||||
#include "chrome/test/ui/ui_test.h"
|
||||
#include "chrome/browser/printing/printing_test.h"
|
||||
#include "net/url_request/url_request_unittest.h"
|
||||
#include "printing/printing_test.h"
|
||||
#include "printing/native_metafile.h"
|
||||
|
||||
namespace {
|
||||
|
@ -113,6 +113,27 @@ class WriteClipboardTask : public Task {
|
||||
scoped_ptr<Clipboard::ObjectMap> objects_;
|
||||
};
|
||||
|
||||
void RenderParamsFromPrintSettings(const printing::PrintSettings& settings,
|
||||
ViewMsg_Print_Params* params) {
|
||||
DCHECK(params);
|
||||
#if defined(OS_WIN)
|
||||
params->printable_size.SetSize(
|
||||
settings.page_setup_pixels().content_area().width(),
|
||||
settings.page_setup_pixels().content_area().height());
|
||||
params->dpi = settings.dpi();
|
||||
// Currently hardcoded at 1.25. See PrintSettings' constructor.
|
||||
params->min_shrink = settings.min_shrink;
|
||||
// Currently hardcoded at 2.0. See PrintSettings' constructor.
|
||||
params->max_shrink = settings.max_shrink;
|
||||
// Currently hardcoded at 72dpi. See PrintSettings' constructor.
|
||||
params->desired_dpi = settings.desired_dpi;
|
||||
// Always use an invalid cookie.
|
||||
params->document_cookie = 0;
|
||||
params->selection_only = settings.selection_only;
|
||||
#else
|
||||
NOTIMPLEMENTED();
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@ -724,7 +745,7 @@ void ResourceMessageFilter::OnGetDefaultPrintSettingsReply(
|
||||
if (printer_query->last_status() != printing::PrintingContext::OK) {
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
} else {
|
||||
printer_query->settings().RenderParams(¶ms);
|
||||
RenderParamsFromPrintSettings(printer_query->settings(), ¶ms);
|
||||
params.document_cookie = printer_query->cookie();
|
||||
}
|
||||
ViewHostMsg_GetDefaultPrintSettings::WriteReplyParams(reply_msg, params);
|
||||
@ -781,7 +802,7 @@ void ResourceMessageFilter::OnScriptedPrintReply(
|
||||
!printer_query->settings().dpi()) {
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
} else {
|
||||
printer_query->settings().RenderParams(¶ms.params);
|
||||
RenderParamsFromPrintSettings(printer_query->settings(), ¶ms.params);
|
||||
params.params.document_cookie = printer_query->cookie();
|
||||
params.pages =
|
||||
printing::PageRange::GetPages(printer_query->settings().ranges);
|
||||
|
@ -540,6 +540,7 @@
|
||||
'../app/app.gyp:app_resources',
|
||||
'../media/media.gyp:media',
|
||||
'../net/net.gyp:net_resources',
|
||||
'../printing/printing.gyp:printing',
|
||||
'../skia/skia.gyp:skia',
|
||||
'../third_party/icu38/icu38.gyp:icui18n',
|
||||
'../third_party/icu38/icu38.gyp:icuuc',
|
||||
@ -1267,14 +1268,6 @@
|
||||
'browser/plugin_service.h',
|
||||
'browser/possible_url_model.cc',
|
||||
'browser/possible_url_model.h',
|
||||
'browser/printing/page_number.cc',
|
||||
'browser/printing/page_number.h',
|
||||
'browser/printing/page_overlays.cc',
|
||||
'browser/printing/page_overlays.h',
|
||||
'browser/printing/page_range.cc',
|
||||
'browser/printing/page_range.h',
|
||||
'browser/printing/page_setup.cc',
|
||||
'browser/printing/page_setup.h',
|
||||
'browser/printing/print_job.cc',
|
||||
'browser/printing/print_job.h',
|
||||
'browser/printing/print_job_manager.cc',
|
||||
@ -1282,19 +1275,10 @@
|
||||
'browser/printing/print_job_worker.cc',
|
||||
'browser/printing/print_job_worker.h',
|
||||
'browser/printing/print_job_worker_owner.h',
|
||||
'browser/printing/print_settings.cc',
|
||||
'browser/printing/print_settings.h',
|
||||
'browser/printing/print_view_manager.cc',
|
||||
'browser/printing/print_view_manager.h',
|
||||
'browser/printing/printed_document.cc',
|
||||
'browser/printing/printed_document.h',
|
||||
'browser/printing/printed_page.cc',
|
||||
'browser/printing/printed_page.h',
|
||||
'browser/printing/printed_pages_source.h',
|
||||
'browser/printing/printer_query.cc',
|
||||
'browser/printing/printer_query.h',
|
||||
'browser/printing/win_printing_context.cc',
|
||||
'browser/printing/win_printing_context.h',
|
||||
'browser/privacy_blacklist/blacklist.h',
|
||||
'browser/privacy_blacklist/blacklist.cc',
|
||||
'browser/process_singleton.h',
|
||||
@ -1886,7 +1870,6 @@
|
||||
'dependencies': [
|
||||
'../google_update/google_update.gyp:google_update',
|
||||
'installer/installer.gyp:installer_util',
|
||||
'../printing/printing.gyp:printing',
|
||||
'../third_party/cld/cld.gyp:cld',
|
||||
'../views/views.gyp:views',
|
||||
'../gears/gears.gyp:gears',
|
||||
@ -3256,7 +3239,6 @@
|
||||
'browser/media_uitest.cc',
|
||||
'browser/metrics/metrics_service_uitest.cc',
|
||||
'browser/printing/printing_layout_uitest.cc',
|
||||
'browser/printing/printing_test.h',
|
||||
'browser/renderer_host/resource_dispatcher_host_uitest.cc',
|
||||
'browser/sanity_uitest.cc',
|
||||
'browser/session_history_uitest.cc',
|
||||
@ -3551,12 +3533,7 @@
|
||||
'browser/password_manager/login_database_unittest.cc',
|
||||
'browser/password_manager/password_form_manager_unittest.cc',
|
||||
'browser/password_manager/password_store_mac_unittest.cc',
|
||||
'browser/printing/page_number_unittest.cc',
|
||||
'browser/printing/page_overlays_unittest.cc',
|
||||
'browser/printing/page_range_unittest.cc',
|
||||
'browser/printing/page_setup_unittest.cc',
|
||||
'browser/printing/print_job_unittest.cc',
|
||||
'browser/printing/win_printing_context_unittest.cc',
|
||||
'browser/privacy_blacklist/blacklist_unittest.cc',
|
||||
'browser/profile_manager_unittest.cc',
|
||||
'browser/renderer_host/audio_renderer_host_unittest.cc',
|
||||
@ -3779,8 +3756,6 @@
|
||||
'browser/importer/firefox_importer_unittest.cc',
|
||||
'browser/importer/importer_unittest.cc',
|
||||
'browser/login_prompt_unittest.cc',
|
||||
'browser/printing/page_number_unittest.cc',
|
||||
'browser/printing/page_overlays_unittest.cc',
|
||||
'browser/printing/print_job_unittest.cc',
|
||||
'browser/rlz/rlz_unittest.cc',
|
||||
'browser/safe_browsing/safe_browsing_blocking_page_unittest.cc',
|
||||
|
@ -1,3 +1,6 @@
|
||||
include_rules = [
|
||||
"+app/gfx", # Font's are here.
|
||||
"+app", # win_util::FormatSystemTime/Date.
|
||||
"+base",
|
||||
"+skia/ext",
|
||||
]
|
||||
|
@ -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 PRINTING_EMF_WIN_H__
|
||||
#define PRINTING_EMF_WIN_H__
|
||||
#ifndef PRINTING_EMF_WIN_H_
|
||||
#define PRINTING_EMF_WIN_H_
|
||||
|
||||
#include <windows.h>
|
||||
#include <vector>
|
||||
@ -178,4 +178,4 @@ class Emf::Enumerator {
|
||||
|
||||
} // namespace printing
|
||||
|
||||
#endif // PRINTING_EMF_WIN_H__
|
||||
#endif // PRINTING_EMF_WIN_H_
|
||||
|
@ -64,7 +64,7 @@ TEST(EmfTest, DC) {
|
||||
/*
|
||||
|
||||
// DEPS check fails even if include is in a multi line comment:
|
||||
// #include "chrome/browser/printing/win_printing_context.h"
|
||||
// #include "printing/printing_context.h"
|
||||
// #include "chrome/common/chrome_paths.h"
|
||||
|
||||
// Disabled if no "UnitTest printer" exist. Useful to reproduce bug 1186598.
|
||||
|
@ -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 PRINTING_NATIVE_METAFILE_H__
|
||||
#define PRINTING_NATIVE_METAFILE_H__
|
||||
#ifndef PRINTING_NATIVE_METAFILE_H_
|
||||
#define PRINTING_NATIVE_METAFILE_H_
|
||||
|
||||
// Define a metafile format for the current platform. We use this platform
|
||||
// independent define so we can define interfaces in platform agnostic manner.
|
||||
@ -25,12 +25,16 @@ typedef Emf NativeMetafile;
|
||||
#elif defined(OS_MACOSX)
|
||||
|
||||
// TODO(port): Printing using PDF?
|
||||
// The mock class is here so we can compile.
|
||||
class NativeMetafile {};
|
||||
|
||||
#elif defined(OS_LINUX)
|
||||
|
||||
// TODO(port): Printing using PostScript?
|
||||
// The mock class is here so we can compile.
|
||||
class NativeMetafile {};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // PRINTING_NATIVE_METAFILE_H__
|
||||
#endif // PRINTING_NATIVE_METAFILE_H_
|
||||
|
@ -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/browser/printing/page_number.h"
|
||||
#include "printing/page_number.h"
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "chrome/browser/printing/print_settings.h"
|
||||
#include "printing/print_settings.h"
|
||||
|
||||
namespace printing {
|
||||
|
@ -2,12 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CHROME_BROWSER_PRINTING_PAGE_NUMBER_H__
|
||||
#define CHROME_BROWSER_PRINTING_PAGE_NUMBER_H__
|
||||
#ifndef PRINTING_PAGE_NUMBER_H_
|
||||
#define PRINTING_PAGE_NUMBER_H_
|
||||
|
||||
#include <ostream>
|
||||
|
||||
#include "chrome/browser/printing/page_range.h"
|
||||
#include "printing/page_range.h"
|
||||
|
||||
namespace printing {
|
||||
|
||||
@ -70,4 +70,4 @@ inline typename std::basic_ostream<E,T>& operator<<(
|
||||
|
||||
} // namespace printing
|
||||
|
||||
#endif // CHROME_BROWSER_PRINTING_PAGE_NUMBER_H__
|
||||
#endif // PRINTING_PAGE_NUMBER_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.
|
||||
|
||||
#include "chrome/browser/printing/page_number.h"
|
||||
#include "chrome/browser/printing/print_settings.h"
|
||||
#include "printing/page_number.h"
|
||||
#include "printing/print_settings.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
TEST(PageNumberTest, Count) {
|
@ -2,13 +2,13 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/browser/printing/page_overlays.h"
|
||||
#include "printing/page_overlays.h"
|
||||
|
||||
#include "app/gfx/text_elider.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/string_util.h"
|
||||
#include "chrome/browser/printing/printed_document.h"
|
||||
#include "chrome/browser/printing/printed_page.h"
|
||||
#include "printing/printed_document.h"
|
||||
#include "printing/printed_page.h"
|
||||
|
||||
namespace {
|
||||
|
@ -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_BROWSER_PRINTING_PAGE_OVERLAYS_H__
|
||||
#define CHROME_BROWSER_PRINTING_PAGE_OVERLAYS_H__
|
||||
#ifndef PRINTING_PAGE_OVERLAYS_H_
|
||||
#define PRINTING_PAGE_OVERLAYS_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -77,4 +77,4 @@ class PageOverlays {
|
||||
|
||||
} // namespace printing
|
||||
|
||||
#endif // CHROME_BROWSER_PRINTING_PAGE_OVERLAYS_H__
|
||||
#endif // PRINTING_PAGE_OVERLAYS_H_
|
@ -2,17 +2,20 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "base/at_exit.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/string_util.h"
|
||||
#include "chrome/browser/printing/page_overlays.h"
|
||||
#include "chrome/browser/printing/print_settings.h"
|
||||
#include "chrome/browser/printing/printed_document.h"
|
||||
#include "chrome/browser/printing/printed_page.h"
|
||||
#include "chrome/browser/printing/printed_pages_source.h"
|
||||
#include "printing/page_overlays.h"
|
||||
#include "printing/print_settings.h"
|
||||
#include "printing/printed_document.h"
|
||||
#include "printing/printed_page.h"
|
||||
#include "printing/printed_pages_source.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace {
|
||||
|
||||
base::AtExitManager global_at_exit_manager;
|
||||
|
||||
class PageOverlaysTest : public testing::Test {
|
||||
private:
|
||||
MessageLoop message_loop_;
|
@ -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/browser/printing/page_range.h"
|
||||
#include "printing/page_range.h"
|
||||
|
||||
#include "base/stl_util-inl.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_BROWSER_PRINTING_PAGE_RANGE_H__
|
||||
#define CHROME_BROWSER_PRINTING_PAGE_RANGE_H__
|
||||
#ifndef PRINTING_PAGE_RANGE_H_
|
||||
#define PRINTING_PAGE_RANGE_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -31,4 +31,4 @@ struct PageRange {
|
||||
|
||||
} // namespace printing
|
||||
|
||||
#endif // CHROME_BROWSER_PRINTING_PAGE_RANGE_H__
|
||||
#endif // PRINTING_PAGE_RANGE_H_
|
@ -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/browser/printing/page_range.h"
|
||||
#include "printing/page_range.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
TEST(PageRangeTest, RangeMerge) {
|
@ -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/browser/printing/page_setup.h"
|
||||
#include "printing/page_setup.h"
|
||||
|
||||
#include "base/logging.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_BROWSER_PRINTING_PAGE_SETUP_H__
|
||||
#define CHROME_BROWSER_PRINTING_PAGE_SETUP_H__
|
||||
#ifndef PRINTING_PAGE_SETUP_H_
|
||||
#define PRINTING_PAGE_SETUP_H_
|
||||
|
||||
#include "base/gfx/rect.h"
|
||||
|
||||
@ -79,4 +79,4 @@ class PageSetup {
|
||||
|
||||
} // namespace printing
|
||||
|
||||
#endif // CHROME_BROWSER_PRINTING_PAGE_SETUP_H__
|
||||
#endif // PRINTING_PAGE_SETUP_H_
|
@ -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/browser/printing/page_setup.h"
|
||||
#include "printing/page_setup.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
@ -2,11 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/browser/printing/print_settings.h"
|
||||
#include "printing/print_settings.h"
|
||||
|
||||
#include "base/atomic_sequence_num.h"
|
||||
#include "base/logging.h"
|
||||
#include "chrome/common/render_messages.h"
|
||||
#include "printing/units.h"
|
||||
|
||||
namespace printing {
|
||||
@ -94,22 +93,6 @@ void PrintSettings::SetPrinterPrintableArea(
|
||||
page_setup_pixels_.SetRequestedMargins(margins);
|
||||
}
|
||||
|
||||
void PrintSettings::RenderParams(ViewMsg_Print_Params* params) const {
|
||||
DCHECK(params);
|
||||
params->printable_size.SetSize(page_setup_pixels_.content_area().width(),
|
||||
page_setup_pixels_.content_area().height());
|
||||
params->dpi = dpi_;
|
||||
// Currently hardcoded at 1.25. See PrintSettings' constructor.
|
||||
params->min_shrink = min_shrink;
|
||||
// Currently hardcoded at 2.0. See PrintSettings' constructor.
|
||||
params->max_shrink = max_shrink;
|
||||
// Currently hardcoded at 72dpi. See PrintSettings' constructor.
|
||||
params->desired_dpi = desired_dpi;
|
||||
// Always use an invalid cookie.
|
||||
params->document_cookie = 0;
|
||||
params->selection_only = selection_only;
|
||||
}
|
||||
|
||||
bool PrintSettings::Equals(const PrintSettings& rhs) const {
|
||||
// Do not test the display device name (printer_name_) for equality since it
|
||||
// may sometimes be chopped off at 30 chars. As long as device_name is the
|
@ -2,15 +2,14 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CHROME_BROWSER_PRINTING_PRINT_SETTINGS_H__
|
||||
#define CHROME_BROWSER_PRINTING_PRINT_SETTINGS_H__
|
||||
#ifndef PRINTING_PRINT_SETTINGS_H_
|
||||
#define PRINTING_PRINT_SETTINGS_H_
|
||||
|
||||
#include "base/gfx/rect.h"
|
||||
#include "chrome/browser/printing/page_overlays.h"
|
||||
#include "chrome/browser/printing/page_range.h"
|
||||
#include "chrome/browser/printing/page_setup.h"
|
||||
#include "printing/page_overlays.h"
|
||||
#include "printing/page_range.h"
|
||||
#include "printing/page_setup.h"
|
||||
|
||||
struct ViewMsg_Print_Params;
|
||||
typedef struct HDC__* HDC;
|
||||
typedef struct _devicemodeW DEVMODE;
|
||||
|
||||
@ -38,10 +37,6 @@ class PrintSettings {
|
||||
void SetPrinterPrintableArea(gfx::Size const& physical_size_pixels,
|
||||
gfx::Rect const& printable_area_pixels);
|
||||
|
||||
// Initializes the print parameters that needs to be sent to the renderer
|
||||
// process.
|
||||
void RenderParams(ViewMsg_Print_Params* params) const;
|
||||
|
||||
// Equality operator.
|
||||
// NOTE: printer_name is NOT tested for equality since it doesn't affect the
|
||||
// output.
|
||||
@ -109,4 +104,4 @@ class PrintSettings {
|
||||
|
||||
} // namespace printing
|
||||
|
||||
#endif // CHROME_BROWSER_PRINTING_PRINT_SETTINGS_H__
|
||||
#endif // PRINTING_PRINT_SETTINGS_H_
|
@ -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/browser/printing/printed_document.h"
|
||||
#include "printing/printed_document.h"
|
||||
|
||||
#include <set>
|
||||
|
||||
@ -14,10 +14,10 @@
|
||||
#include "base/singleton.h"
|
||||
#include "base/string_util.h"
|
||||
#include "base/time.h"
|
||||
#include "chrome/browser/printing/page_number.h"
|
||||
#include "chrome/browser/printing/page_overlays.h"
|
||||
#include "chrome/browser/printing/printed_pages_source.h"
|
||||
#include "chrome/browser/printing/printed_page.h"
|
||||
#include "printing/page_number.h"
|
||||
#include "printing/page_overlays.h"
|
||||
#include "printing/printed_pages_source.h"
|
||||
#include "printing/printed_page.h"
|
||||
#include "printing/units.h"
|
||||
#include "skia/ext/platform_device.h"
|
||||
|
@ -2,17 +2,17 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CHROME_BROWSER_PRINTING_PRINTED_DOCUMENT_H__
|
||||
#define CHROME_BROWSER_PRINTING_PRINTED_DOCUMENT_H__
|
||||
#ifndef PRINTING_PRINTED_DOCUMENT_H_
|
||||
#define PRINTING_PRINTED_DOCUMENT_H_
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/ref_counted.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "chrome/browser/printing/print_settings.h"
|
||||
#include "printing/native_metafile.h"
|
||||
#include "googleurl/src/gurl.h"
|
||||
#include "printing/print_settings.h"
|
||||
#include "printing/native_metafile.h"
|
||||
|
||||
class MessageLoop;
|
||||
|
||||
@ -104,7 +104,7 @@ class PrintedDocument : public base::RefCountedThreadSafe<PrintedDocument> {
|
||||
|
||||
private:
|
||||
// Array of data for each print previewed page.
|
||||
typedef std::map<int, scoped_refptr<PrintedPage>> PrintedPages;
|
||||
typedef std::map<int, scoped_refptr<PrintedPage> > PrintedPages;
|
||||
|
||||
// Contains all the mutable stuff. All this stuff MUST be accessed with the
|
||||
// lock held.
|
||||
@ -189,4 +189,4 @@ class PrintedDocument : public base::RefCountedThreadSafe<PrintedDocument> {
|
||||
|
||||
} // namespace printing
|
||||
|
||||
#endif // CHROME_BROWSER_PRINTING_PRINTED_DOCUMENT_H__
|
||||
#endif // PRINTING_PRINTED_DOCUMENT_H_
|
@ -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/browser/printing/printed_page.h"
|
||||
#include "printing/printed_page.h"
|
||||
|
||||
namespace printing {
|
||||
|
@ -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_BROWSER_PRINTING_PRINTED_PAGE_H__
|
||||
#define CHROME_BROWSER_PRINTING_PRINTED_PAGE_H__
|
||||
#ifndef PRINTING_PRINTED_PAGE_H_
|
||||
#define PRINTING_PRINTED_PAGE_H_
|
||||
|
||||
#include "base/gfx/rect.h"
|
||||
#include "base/gfx/size.h"
|
||||
@ -47,4 +47,4 @@ class PrintedPage : public base::RefCountedThreadSafe<PrintedPage> {
|
||||
|
||||
} // namespace printing
|
||||
|
||||
#endif // CHROME_BROWSER_PRINTING_PRINTED_PAGE_H__
|
||||
#endif // PRINTING_PRINTED_PAGE_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_BROWSER_PRINTING_PRINTED_PAGES_SOURCE_H__
|
||||
#define CHROME_BROWSER_PRINTING_PRINTED_PAGES_SOURCE_H__
|
||||
#ifndef PRINTING_PRINTED_PAGES_SOURCE_H_
|
||||
#define PRINTING_PRINTED_PAGES_SOURCE_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -26,4 +26,4 @@ class PrintedPagesSource {
|
||||
|
||||
} // namespace printing
|
||||
|
||||
#endif // CHROME_BROWSER_PRINTING_PRINTED_PAGES_SOURCE_H__
|
||||
#endif // PRINTING_PRINTED_PAGES_SOURCE_H_
|
@ -14,9 +14,13 @@
|
||||
'target_name': 'printing',
|
||||
'type': '<(library)',
|
||||
'dependencies': [
|
||||
'../app/app.gyp:app_base', # Only required for Font support
|
||||
'../base/base.gyp:base',
|
||||
'../base/base.gyp:base_gfx',
|
||||
|
||||
'../build/temp_gyp/googleurl.gyp:googleurl',
|
||||
'../skia/skia.gyp:skia',
|
||||
'../third_party/icu38/icu38.gyp:icui18n',
|
||||
'../third_party/icu38/icu38.gyp:icuuc',
|
||||
],
|
||||
'msvs_guid': '9E5416B9-B91B-4029-93F4-102C1AD5CAF4',
|
||||
'include_dirs': [
|
||||
@ -26,6 +30,25 @@
|
||||
'emf_win.cc',
|
||||
'emf_win.h',
|
||||
'native_metafile.h',
|
||||
'page_number.cc',
|
||||
'page_number.h',
|
||||
'page_overlays.cc',
|
||||
'page_overlays.h',
|
||||
'page_range.cc',
|
||||
'page_range.h',
|
||||
'page_setup.cc',
|
||||
'page_setup.h',
|
||||
'print_settings.cc',
|
||||
'print_settings.h',
|
||||
'printed_document.cc',
|
||||
'printed_document.h',
|
||||
'printed_page.cc',
|
||||
'printed_page.h',
|
||||
'printed_pages_source.h',
|
||||
'printing_context.h',
|
||||
'printing_context_linux.cc',
|
||||
'printing_context_mac.cc',
|
||||
'printing_context_win.cc',
|
||||
'units.cc',
|
||||
'units.h',
|
||||
],
|
||||
@ -38,7 +61,12 @@
|
||||
['OS!="linux"', {'sources/': [['exclude', '_linux\\.cc$']]}],
|
||||
['OS!="mac"', {'sources/': [['exclude', '_mac\\.(cc|mm?)$']]}],
|
||||
['OS!="win"', {
|
||||
'sources/': [['exclude', '_win\\.cc$']]
|
||||
'sources/': [
|
||||
['exclude', '_win\\.cc$'],
|
||||
['exclude',
|
||||
'printed_document.cc',
|
||||
]
|
||||
]
|
||||
}, { # else: OS=="win"
|
||||
'sources/': [['exclude', '_posix\\.cc$']]
|
||||
}],
|
||||
@ -55,17 +83,31 @@
|
||||
],
|
||||
'sources': [
|
||||
'emf_win_unittest.cc',
|
||||
'printing_test.h',
|
||||
'page_number_unittest.cc',
|
||||
'page_overlays_unittest.cc',
|
||||
'page_range_unittest.cc',
|
||||
'page_setup_unittest.cc',
|
||||
'printing_context_win_unittest.cc',
|
||||
'units_unittest.cc',
|
||||
],
|
||||
'conditions': [
|
||||
['OS!="linux"', {'sources/': [['exclude', '_linux_unittest\\.cc$']]}],
|
||||
['OS!="mac"', {'sources/': [['exclude', '_mac_unittest\\.(cc|mm?)$']]}],
|
||||
['OS!="win"', {
|
||||
'sources/': [['exclude', '_win_unittest\\.cc$']]
|
||||
'sources/': [
|
||||
['exclude', '_win_unittest\\.cc$'],
|
||||
|
||||
# Most of the printing functionailty is Windows only for now.
|
||||
['exclude', '.*'],
|
||||
['include', 'page_range_unittest.cc'],
|
||||
['include', 'page_setup_unittest.cc'],
|
||||
['include', 'units_unittest.cc'],
|
||||
]
|
||||
}, { # else: OS=="win"
|
||||
'sources/': [['exclude', '_posix_unittest\\.cc$']]
|
||||
}],
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
@ -2,15 +2,20 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CHROME_BROWSER_PRINTING_WIN_PRINTING_CONTEXT_H__
|
||||
#define CHROME_BROWSER_PRINTING_WIN_PRINTING_CONTEXT_H__
|
||||
#ifndef PRINTING_PRINTING_CONTEXT_H_
|
||||
#define PRINTING_PRINTING_CONTEXT_H_
|
||||
|
||||
#include "build/build_config.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include <ocidl.h>
|
||||
#include <commdlg.h>
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "chrome/browser/printing/print_settings.h"
|
||||
#include "printing/print_settings.h"
|
||||
|
||||
namespace printing {
|
||||
|
||||
@ -29,9 +34,11 @@ class PrintingContext {
|
||||
PrintingContext();
|
||||
~PrintingContext();
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Asks the user what printer and format should be used to print. Updates the
|
||||
// context with the select device settings.
|
||||
Result AskUserForSettings(HWND window, int max_pages, bool has_selection);
|
||||
#endif
|
||||
|
||||
// Selects the user's default printer and format. Updates the context with the
|
||||
// default device settings.
|
||||
@ -61,16 +68,18 @@ class PrintingContext {
|
||||
// document.
|
||||
Result DocumentDone();
|
||||
|
||||
// Cancels printing. Can be used in a multithreaded context. Takes effect
|
||||
// Cancels printing. Can be used in a multi-threaded context. Takes effect
|
||||
// immediately.
|
||||
void Cancel();
|
||||
|
||||
// Dismiss the Print... dialog box if shown.
|
||||
void DismissDialog();
|
||||
|
||||
#if defined(OS_WIN)
|
||||
HDC context() {
|
||||
return hdc_;
|
||||
}
|
||||
#endif
|
||||
|
||||
const PrintSettings& settings() const {
|
||||
return settings_;
|
||||
@ -84,6 +93,7 @@ class PrintingContext {
|
||||
// Does bookkeeping when an error occurs.
|
||||
PrintingContext::Result OnError();
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Used in response to the user canceling the printing.
|
||||
static BOOL CALLBACK AbortProc(HDC hdc, int nCode);
|
||||
|
||||
@ -110,6 +120,7 @@ class PrintingContext {
|
||||
|
||||
// The selected printer context.
|
||||
HDC hdc_;
|
||||
#endif
|
||||
|
||||
// Complete print context settings.
|
||||
PrintSettings settings_;
|
||||
@ -119,8 +130,10 @@ class PrintingContext {
|
||||
int page_number_;
|
||||
#endif
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// The dialog box for the time it is shown.
|
||||
volatile HWND dialog_box_;
|
||||
#endif
|
||||
|
||||
// The dialog box has been dismissed.
|
||||
volatile bool dialog_box_dismissed_;
|
||||
@ -136,4 +149,4 @@ class PrintingContext {
|
||||
|
||||
} // namespace printing
|
||||
|
||||
#endif // CHROME_BROWSER_PRINTING_WIN_PRINTING_CONTEXT_H__
|
||||
#endif // PRINTING_PRINTING_CONTEXT_H_
|
117
printing/printing_context_linux.cc
Normal file
117
printing/printing_context_linux.cc
Normal file
@ -0,0 +1,117 @@
|
||||
// Copyright (c) 2009 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.
|
||||
|
||||
#include "printing/printing_context.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
|
||||
namespace printing {
|
||||
|
||||
PrintingContext::PrintingContext()
|
||||
:
|
||||
#ifndef NDEBUG
|
||||
page_number_(-1),
|
||||
#endif
|
||||
dialog_box_dismissed_(false),
|
||||
in_print_job_(false),
|
||||
abort_printing_(false) {
|
||||
}
|
||||
|
||||
PrintingContext::~PrintingContext() {
|
||||
ResetSettings();
|
||||
}
|
||||
|
||||
|
||||
PrintingContext::Result PrintingContext::UseDefaultSettings() {
|
||||
DCHECK(!in_print_job_);
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
PrintingContext::Result PrintingContext::InitWithSettings(
|
||||
const PrintSettings& settings) {
|
||||
DCHECK(!in_print_job_);
|
||||
settings_ = settings;
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
void PrintingContext::ResetSettings() {
|
||||
#ifndef NDEBUG
|
||||
page_number_ = -1;
|
||||
#endif
|
||||
dialog_box_dismissed_ = false;
|
||||
abort_printing_ = false;
|
||||
in_print_job_ = false;
|
||||
}
|
||||
|
||||
PrintingContext::Result PrintingContext::NewDocument(
|
||||
const std::wstring& document_name) {
|
||||
DCHECK(!in_print_job_);
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
|
||||
#ifndef NDEBUG
|
||||
page_number_ = 0;
|
||||
#endif
|
||||
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
PrintingContext::Result PrintingContext::NewPage() {
|
||||
if (abort_printing_)
|
||||
return CANCEL;
|
||||
DCHECK(in_print_job_);
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
|
||||
#ifndef NDEBUG
|
||||
++page_number_;
|
||||
#endif
|
||||
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
PrintingContext::Result PrintingContext::PageDone() {
|
||||
if (abort_printing_)
|
||||
return CANCEL;
|
||||
DCHECK(in_print_job_);
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
PrintingContext::Result PrintingContext::DocumentDone() {
|
||||
if (abort_printing_)
|
||||
return CANCEL;
|
||||
DCHECK(in_print_job_);
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
|
||||
ResetSettings();
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
void PrintingContext::Cancel() {
|
||||
abort_printing_ = true;
|
||||
in_print_job_ = false;
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
}
|
||||
|
||||
void PrintingContext::DismissDialog() {
|
||||
NOTIMPLEMENTED();
|
||||
}
|
||||
|
||||
PrintingContext::Result PrintingContext::OnError() {
|
||||
ResetSettings();
|
||||
return abort_printing_ ? CANCEL : FAILED;
|
||||
}
|
||||
|
||||
} // namespace printing
|
117
printing/printing_context_mac.cc
Normal file
117
printing/printing_context_mac.cc
Normal file
@ -0,0 +1,117 @@
|
||||
// Copyright (c) 2009 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.
|
||||
|
||||
#include "printing/printing_context.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
|
||||
namespace printing {
|
||||
|
||||
PrintingContext::PrintingContext()
|
||||
:
|
||||
#ifndef NDEBUG
|
||||
page_number_(-1),
|
||||
#endif
|
||||
dialog_box_dismissed_(false),
|
||||
in_print_job_(false),
|
||||
abort_printing_(false) {
|
||||
}
|
||||
|
||||
PrintingContext::~PrintingContext() {
|
||||
ResetSettings();
|
||||
}
|
||||
|
||||
|
||||
PrintingContext::Result PrintingContext::UseDefaultSettings() {
|
||||
DCHECK(!in_print_job_);
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
PrintingContext::Result PrintingContext::InitWithSettings(
|
||||
const PrintSettings& settings) {
|
||||
DCHECK(!in_print_job_);
|
||||
settings_ = settings;
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
void PrintingContext::ResetSettings() {
|
||||
#ifndef NDEBUG
|
||||
page_number_ = -1;
|
||||
#endif
|
||||
dialog_box_dismissed_ = false;
|
||||
abort_printing_ = false;
|
||||
in_print_job_ = false;
|
||||
}
|
||||
|
||||
PrintingContext::Result PrintingContext::NewDocument(
|
||||
const std::wstring& document_name) {
|
||||
DCHECK(!in_print_job_);
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
|
||||
#ifndef NDEBUG
|
||||
page_number_ = 0;
|
||||
#endif
|
||||
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
PrintingContext::Result PrintingContext::NewPage() {
|
||||
if (abort_printing_)
|
||||
return CANCEL;
|
||||
DCHECK(in_print_job_);
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
|
||||
#ifndef NDEBUG
|
||||
++page_number_;
|
||||
#endif
|
||||
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
PrintingContext::Result PrintingContext::PageDone() {
|
||||
if (abort_printing_)
|
||||
return CANCEL;
|
||||
DCHECK(in_print_job_);
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
PrintingContext::Result PrintingContext::DocumentDone() {
|
||||
if (abort_printing_)
|
||||
return CANCEL;
|
||||
DCHECK(in_print_job_);
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
|
||||
ResetSettings();
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
void PrintingContext::Cancel() {
|
||||
abort_printing_ = true;
|
||||
in_print_job_ = false;
|
||||
|
||||
NOTIMPLEMENTED();
|
||||
}
|
||||
|
||||
void PrintingContext::DismissDialog() {
|
||||
NOTIMPLEMENTED();
|
||||
}
|
||||
|
||||
PrintingContext::Result PrintingContext::OnError() {
|
||||
ResetSettings();
|
||||
return abort_printing_ ? CANCEL : FAILED;
|
||||
}
|
||||
|
||||
} // namespace printing
|
@ -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/browser/printing/win_printing_context.h"
|
||||
#include "printing/printing_context.h"
|
||||
|
||||
#include <winspool.h>
|
||||
|
||||
@ -10,8 +10,7 @@
|
||||
#include "base/message_loop.h"
|
||||
#include "base/time.h"
|
||||
#include "base/time_format.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/printing/printed_document.h"
|
||||
#include "printing/printed_document.h"
|
||||
#include "skia/ext/platform_device_win.h"
|
||||
|
||||
using base::Time;
|
||||
@ -144,8 +143,8 @@ PrintingContext::PrintingContext()
|
||||
#endif
|
||||
dialog_box_(NULL),
|
||||
dialog_box_dismissed_(false),
|
||||
abort_printing_(false),
|
||||
in_print_job_(false) {
|
||||
in_print_job_(false),
|
||||
abort_printing_(false) {
|
||||
}
|
||||
|
||||
PrintingContext::~PrintingContext() {
|
7
chrome/browser/printing/win_printing_context_unittest.cc → printing/printing_context_win_unittest.cc
7
chrome/browser/printing/win_printing_context_unittest.cc → printing/printing_context_win_unittest.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/browser/printing/win_printing_context.h"
|
||||
#include "printing/printing_context.h"
|
||||
|
||||
#include "printing/printing_test.h"
|
||||
#include "printing/print_settings.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "chrome/browser/printing/printing_test.h"
|
||||
#include "chrome/browser/printing/print_settings.h"
|
||||
|
||||
// This test is automatically disabled if no printer is available.
|
||||
class PrintingContextTest : public PrintingTest<testing::Test> {
|
||||
@ -20,7 +20,6 @@ TEST_F(PrintingContextTest, Base) {
|
||||
printing::PrintingContext context;
|
||||
EXPECT_EQ(context.InitWithSettings(settings), printing::PrintingContext::OK);
|
||||
|
||||
;
|
||||
// The print may lie to use and may not support world transformation.
|
||||
// Verify right now.
|
||||
XFORM random_matrix = { 1, 0.1f, 0, 1.5f, 0, 1 };
|
Reference in New Issue
Block a user