Commit f537167a authored by vitalybuka's avatar vitalybuka Committed by Commit bot

Fix compilation on Windows with enable_printing=2.

BUG=374321
NOTRY=true

Review URL: https://codereview.chromium.org/552703002

Cr-Commit-Position: refs/heads/master@{#293820}
parent 597255e6
...@@ -114,6 +114,7 @@ class TabsAddedNotificationObserver ...@@ -114,6 +114,7 @@ class TabsAddedNotificationObserver
DISALLOW_COPY_AND_ASSIGN(TabsAddedNotificationObserver); DISALLOW_COPY_AND_ASSIGN(TabsAddedNotificationObserver);
}; };
#if defined(ENABLE_FULL_PRINTING)
class ScopedPreviewTestingDelegate : PrintPreviewUI::TestingDelegate { class ScopedPreviewTestingDelegate : PrintPreviewUI::TestingDelegate {
public: public:
explicit ScopedPreviewTestingDelegate(bool auto_cancel) explicit ScopedPreviewTestingDelegate(bool auto_cancel)
...@@ -169,6 +170,8 @@ class ScopedPreviewTestingDelegate : PrintPreviewUI::TestingDelegate { ...@@ -169,6 +170,8 @@ class ScopedPreviewTestingDelegate : PrintPreviewUI::TestingDelegate {
gfx::Size dialog_size_; gfx::Size dialog_size_;
}; };
#endif // ENABLE_FULL_PRINTING
#if !defined(OS_CHROMEOS) && !defined(OS_WIN) #if !defined(OS_CHROMEOS) && !defined(OS_WIN)
bool CopyTestDataAndSetCommandLineArg( bool CopyTestDataAndSetCommandLineArg(
const base::FilePath& test_data_file, const base::FilePath& test_data_file,
...@@ -1110,6 +1113,9 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MAYBE_WebContentsHasFocus) { ...@@ -1110,6 +1113,9 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MAYBE_WebContentsHasFocus) {
->HasFocus()); ->HasFocus());
} }
#if defined(ENABLE_FULL_PRINTING)
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX) #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX)
#define MAYBE_WindowDotPrintShouldBringUpPrintPreview \ #define MAYBE_WindowDotPrintShouldBringUpPrintPreview \
DISABLED_WindowDotPrintShouldBringUpPrintPreview DISABLED_WindowDotPrintShouldBringUpPrintPreview
...@@ -1159,6 +1165,7 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ...@@ -1159,6 +1165,7 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
minimum_dialog_size.height()); minimum_dialog_size.height());
GetFirstAppWindow()->GetBaseWindow()->Close(); GetFirstAppWindow()->GetBaseWindow()->Close();
} }
#endif // ENABLE_FULL_PRINTING
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "chrome/browser/first_run/upgrade_util.h" #include "chrome/browser/first_run/upgrade_util.h"
#include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/service_process/service_process_control.h"
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/common/crash_keys.h" #include "chrome/common/crash_keys.h"
...@@ -47,6 +46,10 @@ ...@@ -47,6 +46,10 @@
#include "chrome/browser/chromeos/boot_times_loader.h" #include "chrome/browser/chromeos/boot_times_loader.h"
#endif #endif
#if defined(ENABLE_FULL_PRINTING)
#include "chrome/browser/service_process/service_process_control.h"
#endif
using base::Time; using base::Time;
using base::TimeDelta; using base::TimeDelta;
using content::BrowserThread; using content::BrowserThread;
...@@ -140,9 +143,10 @@ bool ShutdownPreThreadsStop() { ...@@ -140,9 +143,10 @@ bool ShutdownPreThreadsStop() {
chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker( chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker(
"BrowserShutdownStarted", false); "BrowserShutdownStarted", false);
#endif #endif
#if defined(ENABLE_FULL_PRINTING)
// Shutdown the IPC channel to the service processes. // Shutdown the IPC channel to the service processes.
ServiceProcessControl::GetInstance()->Disconnect(); ServiceProcessControl::GetInstance()->Disconnect();
#endif // ENABLE_FULL_PRINTING
// WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough
// time to get here. If you have something that *must* happen on end session, // time to get here. If you have something that *must* happen on end session,
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/callback.h" #include "base/callback.h"
#include "chrome/browser/local_discovery/privet_url_fetcher.h" #include "chrome/browser/local_discovery/privet_url_fetcher.h"
#include "chrome/browser/local_discovery/pwg_raster_converter.h"
#include "net/base/host_port_pair.h" #include "net/base/host_port_pair.h"
namespace base { namespace base {
...@@ -26,6 +25,7 @@ class PdfRenderSettings; ...@@ -26,6 +25,7 @@ class PdfRenderSettings;
namespace local_discovery { namespace local_discovery {
class PWGRasterConverter;
class PrivetHTTPClient; class PrivetHTTPClient;
// Represents a simple request that returns pure JSON. // Represents a simple request that returns pure JSON.
...@@ -208,7 +208,6 @@ class PrivetV1HTTPClient { ...@@ -208,7 +208,6 @@ class PrivetV1HTTPClient {
// Creates operation to submit print job to local printer. // Creates operation to submit print job to local printer.
virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation( virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation(
PrivetLocalPrintOperation::Delegate* delegate) = 0; PrivetLocalPrintOperation::Delegate* delegate) = 0;
}; };
} // namespace local_discovery } // namespace local_discovery
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
#include "ui/gfx/text_elider.h" #include "ui/gfx/text_elider.h"
#include "url/gurl.h" #include "url/gurl.h"
#if defined(ENABLE_FULL_PRINTING)
#include "chrome/browser/local_discovery/pwg_raster_converter.h"
#endif // ENABLE_FULL_PRINTING
using namespace cloud_devices::printer; using namespace cloud_devices::printer;
namespace cloud_print { namespace cloud_print {
...@@ -34,6 +38,9 @@ const char kUrlPlaceHolder[] = "http://host/"; ...@@ -34,6 +38,9 @@ const char kUrlPlaceHolder[] = "http://host/";
const char kPrivetRegisterActionArgName[] = "action"; const char kPrivetRegisterActionArgName[] = "action";
const char kPrivetRegisterUserArgName[] = "user"; const char kPrivetRegisterUserArgName[] = "user";
const int kPrivetCancelationTimeoutSeconds = 3;
#if defined(ENABLE_FULL_PRINTING)
const char kPrivetURLKeyUserName[] = "user_name"; const char kPrivetURLKeyUserName[] = "user_name";
const char kPrivetURLKeyClientName[] = "client_name"; const char kPrivetURLKeyClientName[] = "client_name";
const char kPrivetURLKeyJobname[] = "job_name"; const char kPrivetURLKeyJobname[] = "job_name";
...@@ -47,13 +54,11 @@ const char kPrivetContentTypeAny[] = "*/*"; ...@@ -47,13 +54,11 @@ const char kPrivetContentTypeAny[] = "*/*";
const char kPrivetKeyJobID[] = "job_id"; const char kPrivetKeyJobID[] = "job_id";
const int kPrivetCancelationTimeoutSeconds = 3;
const int kPrivetLocalPrintMaxRetries = 2; const int kPrivetLocalPrintMaxRetries = 2;
const int kPrivetLocalPrintDefaultTimeout = 5; const int kPrivetLocalPrintDefaultTimeout = 5;
const size_t kPrivetLocalPrintMaxJobNameLength = 64; const size_t kPrivetLocalPrintMaxJobNameLength = 64;
#endif // ENABLE_FULL_PRINTING
GURL CreatePrivetURL(const std::string& path) { GURL CreatePrivetURL(const std::string& path) {
GURL url(kUrlPlaceHolder); GURL url(kUrlPlaceHolder);
...@@ -460,6 +465,7 @@ bool PrivetDataReadOperationImpl::OnRawData(PrivetURLFetcher* fetcher, ...@@ -460,6 +465,7 @@ bool PrivetDataReadOperationImpl::OnRawData(PrivetURLFetcher* fetcher,
return true; return true;
} }
#if defined(ENABLE_FULL_PRINTING)
PrivetLocalPrintOperationImpl::PrivetLocalPrintOperationImpl( PrivetLocalPrintOperationImpl::PrivetLocalPrintOperationImpl(
PrivetHTTPClient* privet_client, PrivetHTTPClient* privet_client,
PrivetLocalPrintOperation::Delegate* delegate) PrivetLocalPrintOperation::Delegate* delegate)
...@@ -819,6 +825,7 @@ void PrivetLocalPrintOperationImpl::SetPWGRasterConverterForTesting( ...@@ -819,6 +825,7 @@ void PrivetLocalPrintOperationImpl::SetPWGRasterConverterForTesting(
scoped_ptr<PWGRasterConverter> pwg_raster_converter) { scoped_ptr<PWGRasterConverter> pwg_raster_converter) {
pwg_raster_converter_ = pwg_raster_converter.Pass(); pwg_raster_converter_ = pwg_raster_converter.Pass();
} }
#endif // ENABLE_FULL_PRINTING
PrivetHTTPClientImpl::PrivetHTTPClientImpl( PrivetHTTPClientImpl::PrivetHTTPClientImpl(
const std::string& name, const std::string& name,
...@@ -921,8 +928,12 @@ PrivetV1HTTPClientImpl::CreateCapabilitiesOperation( ...@@ -921,8 +928,12 @@ PrivetV1HTTPClientImpl::CreateCapabilitiesOperation(
scoped_ptr<PrivetLocalPrintOperation> scoped_ptr<PrivetLocalPrintOperation>
PrivetV1HTTPClientImpl::CreateLocalPrintOperation( PrivetV1HTTPClientImpl::CreateLocalPrintOperation(
PrivetLocalPrintOperation::Delegate* delegate) { PrivetLocalPrintOperation::Delegate* delegate) {
#if defined(ENABLE_FULL_PRINTING)
return scoped_ptr<PrivetLocalPrintOperation>( return scoped_ptr<PrivetLocalPrintOperation>(
new PrivetLocalPrintOperationImpl(info_client(), delegate)); new PrivetLocalPrintOperationImpl(info_client(), delegate));
#else
return scoped_ptr<PrivetLocalPrintOperation>();
#endif // ENABLE_FULL_PRINTING
} }
} // namespace local_discovery } // namespace local_discovery
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_IMPL_H_ #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_IMPL_H_
#include <string> #include <string>
#include <vector>
#include "base/callback.h" #include "base/callback.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
...@@ -193,6 +194,7 @@ class PrivetDataReadOperationImpl : public PrivetDataReadOperation, ...@@ -193,6 +194,7 @@ class PrivetDataReadOperationImpl : public PrivetDataReadOperation,
scoped_ptr<PrivetURLFetcher> url_fetcher_; scoped_ptr<PrivetURLFetcher> url_fetcher_;
}; };
#if defined(ENABLE_FULL_PRINTING)
class PrivetLocalPrintOperationImpl class PrivetLocalPrintOperationImpl
: public PrivetLocalPrintOperation, : public PrivetLocalPrintOperation,
public PrivetURLFetcher::Delegate { public PrivetURLFetcher::Delegate {
...@@ -282,6 +284,7 @@ class PrivetLocalPrintOperationImpl ...@@ -282,6 +284,7 @@ class PrivetLocalPrintOperationImpl
base::WeakPtrFactory<PrivetLocalPrintOperationImpl> weak_factory_; base::WeakPtrFactory<PrivetLocalPrintOperationImpl> weak_factory_;
}; };
#endif // ENABLE_FULL_PRINTING
class PrivetHTTPClientImpl : public PrivetHTTPClient { class PrivetHTTPClientImpl : public PrivetHTTPClient {
public: public:
......
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#if defined(ENABLE_FULL_PRINTING)
#include "chrome/browser/local_discovery/pwg_raster_converter.h"
#endif // ENABLE_FULL_PRINTING
using testing::StrictMock; using testing::StrictMock;
using testing::NiceMock; using testing::NiceMock;
...@@ -76,34 +80,6 @@ const char kSampleInfoResponseRegistered[] = "{" ...@@ -76,34 +80,6 @@ const char kSampleInfoResponseRegistered[] = "{"
" ]" " ]"
"}"; "}";
const char kSampleInfoResponseWithCreatejob[] = "{"
" \"version\": \"1.0\","
" \"name\": \"Common printer\","
" \"description\": \"Printer connected through Chrome connector\","
" \"url\": \"https://www.google.com/cloudprint\","
" \"type\": ["
" \"printer\""
" ],"
" \"id\": \"\","
" \"device_state\": \"idle\","
" \"connection_state\": \"online\","
" \"manufacturer\": \"Google\","
" \"model\": \"Google Chrome\","
" \"serial_number\": \"1111-22222-33333-4444\","
" \"firmware\": \"24.0.1312.52\","
" \"uptime\": 600,"
" \"setup_url\": \"http://support.google.com/\","
" \"support_url\": \"http://support.google.com/cloudprint/?hl=en\","
" \"update_url\": \"http://support.google.com/cloudprint/?hl=en\","
" \"x-privet-token\": \"SampleTokenForTesting\","
" \"api\": ["
" \"/privet/accesstoken\","
" \"/privet/capabilities\","
" \"/privet/printer/createjob\","
" \"/privet/printer/submitdoc\","
" ]"
"}";
const char kSampleRegisterStartResponse[] = "{" const char kSampleRegisterStartResponse[] = "{"
"\"user\": \"example@google.com\"," "\"user\": \"example@google.com\","
"\"action\": \"start\"" "\"action\": \"start\""
...@@ -138,14 +114,6 @@ const char kSampleRegisterCancelResponse[] = "{" ...@@ -138,14 +114,6 @@ const char kSampleRegisterCancelResponse[] = "{"
"\"action\": \"cancel\"" "\"action\": \"cancel\""
"}"; "}";
const char kSampleLocalPrintResponse[] = "{"
"\"job_id\": \"123\","
"\"expires_in\": 500,"
"\"job_type\": \"application/pdf\","
"\"job_size\": 16,"
"\"job_name\": \"Sample job name\","
"}";
const char kSampleCapabilitiesResponse[] = "{" const char kSampleCapabilitiesResponse[] = "{"
"\"version\" : \"1.0\"," "\"version\" : \"1.0\","
"\"printer\" : {" "\"printer\" : {"
...@@ -156,20 +124,47 @@ const char kSampleCapabilitiesResponse[] = "{" ...@@ -156,20 +124,47 @@ const char kSampleCapabilitiesResponse[] = "{"
"}" "}"
"}"; "}";
const char kSampleCapabilitiesResponsePWGOnly[] = "{" #if defined(ENABLE_FULL_PRINTING)
"\"version\" : \"1.0\"," const char kSampleInfoResponseWithCreatejob[] = "{"
"\"printer\" : {" " \"version\": \"1.0\","
" \"supported_content_type\" : [" " \"name\": \"Common printer\","
" { \"content_type\" : \"image/pwg-raster\" }" " \"description\": \"Printer connected through Chrome connector\","
" ]" " \"url\": \"https://www.google.com/cloudprint\","
"}" " \"type\": ["
" \"printer\""
" ],"
" \"id\": \"\","
" \"device_state\": \"idle\","
" \"connection_state\": \"online\","
" \"manufacturer\": \"Google\","
" \"model\": \"Google Chrome\","
" \"serial_number\": \"1111-22222-33333-4444\","
" \"firmware\": \"24.0.1312.52\","
" \"uptime\": 600,"
" \"setup_url\": \"http://support.google.com/\","
" \"support_url\": \"http://support.google.com/cloudprint/?hl=en\","
" \"update_url\": \"http://support.google.com/cloudprint/?hl=en\","
" \"x-privet-token\": \"SampleTokenForTesting\","
" \"api\": ["
" \"/privet/accesstoken\","
" \"/privet/capabilities\","
" \"/privet/printer/createjob\","
" \"/privet/printer/submitdoc\","
" ]"
"}"; "}";
const char kSampleCapabilitiesResponseWithAnyMimetype[] = "{" const char kSampleLocalPrintResponse[] = "{"
"\"job_id\": \"123\","
"\"expires_in\": 500,"
"\"job_type\": \"application/pdf\","
"\"job_size\": 16,"
"\"job_name\": \"Sample job name\","
"}";
const char kSampleCapabilitiesResponsePWGOnly[] = "{"
"\"version\" : \"1.0\"," "\"version\" : \"1.0\","
"\"printer\" : {" "\"printer\" : {"
" \"supported_content_type\" : [" " \"supported_content_type\" : ["
" { \"content_type\" : \"*/*\" },"
" { \"content_type\" : \"image/pwg-raster\" }" " { \"content_type\" : \"image/pwg-raster\" }"
" ]" " ]"
"}" "}"
...@@ -186,6 +181,16 @@ const char kSampleInvalidDocumentTypeResponse[] = "{" ...@@ -186,6 +181,16 @@ const char kSampleInvalidDocumentTypeResponse[] = "{"
const char kSampleCreatejobResponse[] = "{ \"job_id\": \"1234\" }"; const char kSampleCreatejobResponse[] = "{ \"job_id\": \"1234\" }";
const char kSampleCapabilitiesResponseWithAnyMimetype[] = "{"
"\"version\" : \"1.0\","
"\"printer\" : {"
" \"supported_content_type\" : ["
" { \"content_type\" : \"*/*\" },"
" { \"content_type\" : \"image/pwg-raster\" }"
" ]"
"}"
"}";
const char kSampleCJT[] = "{ \"version\" : \"1.0\" }"; const char kSampleCJT[] = "{ \"version\" : \"1.0\" }";
const char kSampleCapabilitiesResponsePWGSettings[] = const char kSampleCapabilitiesResponsePWGSettings[] =
...@@ -207,6 +212,7 @@ const char kSampleCJTDuplex[] = ...@@ -207,6 +212,7 @@ const char kSampleCJTDuplex[] =
"\"version\" : \"1.0\"," "\"version\" : \"1.0\","
"\"print\": { \"duplex\": {\"type\": \"SHORT_EDGE\"} }" "\"print\": { \"duplex\": {\"type\": \"SHORT_EDGE\"} }"
"}"; "}";
#endif // ENABLE_FULL_PRINTING
// Return the representation of the given JSON that would be outputted by // Return the representation of the given JSON that would be outputted by
// JSONWriter. This ensures the same JSON values are represented by the same // JSONWriter. This ensures the same JSON values are represented by the same
...@@ -429,35 +435,6 @@ class MockLocalPrintDelegate : public PrivetLocalPrintOperation::Delegate { ...@@ -429,35 +435,6 @@ class MockLocalPrintDelegate : public PrivetLocalPrintOperation::Delegate {
MOCK_METHOD1(OnPrivetPrintingErrorInternal, void(int http_code)); MOCK_METHOD1(OnPrivetPrintingErrorInternal, void(int http_code));
}; };
// A note on PWG raster conversion: The PWG raster converter used simply
// converts strings to file paths based on them by appending "test.pdf", since
// it's easier to test that way. Instead of using a mock, we simply check if the
// request is uploading a file that is based on this pattern.
class FakePWGRasterConverter : public PWGRasterConverter {
public:
FakePWGRasterConverter() {
}
virtual ~FakePWGRasterConverter() {
}
virtual void Start(base::RefCountedMemory* data,
const printing::PdfRenderSettings& conversion_settings,
const printing::PwgRasterSettings& bitmap_settings,
const ResultCallback& callback) OVERRIDE {
bitmap_settings_ = bitmap_settings;
std::string data_str(data->front_as<char>(), data->size());
callback.Run(true, base::FilePath().AppendASCII(data_str + "test.pdf"));
}
const printing::PwgRasterSettings& bitmap_settings() {
return bitmap_settings_;
}
private:
printing::PwgRasterSettings bitmap_settings_;
};
class PrivetInfoTest : public PrivetHTTPTest { class PrivetInfoTest : public PrivetHTTPTest {
public: public:
PrivetInfoTest() {} PrivetInfoTest() {}
...@@ -489,7 +466,7 @@ TEST_F(PrivetInfoTest, SuccessfulInfo) { ...@@ -489,7 +466,7 @@ TEST_F(PrivetInfoTest, SuccessfulInfo) {
EXPECT_CALL(info_callback_, OnPrivetJSONDoneInternal()); EXPECT_CALL(info_callback_, OnPrivetJSONDoneInternal());
fetcher->delegate()->OnURLFetchComplete(fetcher); fetcher->delegate()->OnURLFetchComplete(fetcher);
}; }
TEST_F(PrivetInfoTest, InfoFailureHTTP) { TEST_F(PrivetInfoTest, InfoFailureHTTP) {
info_operation_->Start(); info_operation_->Start();
...@@ -502,7 +479,7 @@ TEST_F(PrivetInfoTest, InfoFailureHTTP) { ...@@ -502,7 +479,7 @@ TEST_F(PrivetInfoTest, InfoFailureHTTP) {
EXPECT_CALL(info_callback_, OnPrivetJSONDoneInternal()); EXPECT_CALL(info_callback_, OnPrivetJSONDoneInternal());
fetcher->delegate()->OnURLFetchComplete(fetcher); fetcher->delegate()->OnURLFetchComplete(fetcher);
}; }
class PrivetRegisterTest : public PrivetHTTPTest { class PrivetRegisterTest : public PrivetHTTPTest {
public: public:
...@@ -726,7 +703,7 @@ TEST_F(PrivetCapabilitiesTest, SuccessfulCapabilities) { ...@@ -726,7 +703,7 @@ TEST_F(PrivetCapabilitiesTest, SuccessfulCapabilities) {
std::string version; std::string version;
EXPECT_TRUE(capabilities_callback_.value()->GetString("version", &version)); EXPECT_TRUE(capabilities_callback_.value()->GetString("version", &version));
EXPECT_EQ("1.0", version); EXPECT_EQ("1.0", version);
}; }
TEST_F(PrivetCapabilitiesTest, CacheToken) { TEST_F(PrivetCapabilitiesTest, CacheToken) {
capabilities_operation_->Start(); capabilities_operation_->Start();
...@@ -751,7 +728,7 @@ TEST_F(PrivetCapabilitiesTest, CacheToken) { ...@@ -751,7 +728,7 @@ TEST_F(PrivetCapabilitiesTest, CacheToken) {
EXPECT_TRUE(SuccessfulResponseToURL( EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/capabilities"), GURL("http://10.0.0.8:6006/privet/capabilities"),
kSampleCapabilitiesResponse)); kSampleCapabilitiesResponse));
}; }
TEST_F(PrivetCapabilitiesTest, BadToken) { TEST_F(PrivetCapabilitiesTest, BadToken) {
capabilities_operation_->Start(); capabilities_operation_->Start();
...@@ -773,6 +750,36 @@ TEST_F(PrivetCapabilitiesTest, BadToken) { ...@@ -773,6 +750,36 @@ TEST_F(PrivetCapabilitiesTest, BadToken) {
EXPECT_TRUE(SuccessfulResponseToURL( EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/capabilities"), GURL("http://10.0.0.8:6006/privet/capabilities"),
kSampleCapabilitiesResponse)); kSampleCapabilitiesResponse));
}
#if defined(ENABLE_FULL_PRINTING)
// A note on PWG raster conversion: The PWG raster converter used simply
// converts strings to file paths based on them by appending "test.pdf", since
// it's easier to test that way. Instead of using a mock, we simply check if the
// request is uploading a file that is based on this pattern.
class FakePWGRasterConverter : public PWGRasterConverter {
public:
FakePWGRasterConverter() {
}
virtual ~FakePWGRasterConverter() {
}
virtual void Start(base::RefCountedMemory* data,
const printing::PdfRenderSettings& conversion_settings,
const printing::PwgRasterSettings& bitmap_settings,
const ResultCallback& callback) OVERRIDE {
bitmap_settings_ = bitmap_settings;
std::string data_str(data->front_as<char>(), data->size());
callback.Run(true, base::FilePath().AppendASCII(data_str + "test.pdf"));
}
const printing::PwgRasterSettings& bitmap_settings() {
return bitmap_settings_;
}
private:
printing::PwgRasterSettings bitmap_settings_;
}; };
class PrivetLocalPrintTest : public PrivetHTTPTest { class PrivetLocalPrintTest : public PrivetHTTPTest {
...@@ -832,7 +839,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrint) { ...@@ -832,7 +839,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrint) {
"job_name=Sample+job+name"), "job_name=Sample+job+name"),
"Sample print data", "Sample print data",
kSampleLocalPrintResponse)); kSampleLocalPrintResponse));
}; }
TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithAnyMimetype) { TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithAnyMimetype) {
local_print_operation_->SetUsername("sample@gmail.com"); local_print_operation_->SetUsername("sample@gmail.com");
...@@ -859,7 +866,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithAnyMimetype) { ...@@ -859,7 +866,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithAnyMimetype) {
"job_name=Sample+job+name"), "job_name=Sample+job+name"),
"Sample print data", "Sample print data",
kSampleLocalPrintResponse)); kSampleLocalPrintResponse));
}; }
TEST_F(PrivetLocalPrintTest, SuccessfulPWGLocalPrint) { TEST_F(PrivetLocalPrintTest, SuccessfulPWGLocalPrint) {
local_print_operation_->SetUsername("sample@gmail.com"); local_print_operation_->SetUsername("sample@gmail.com");
...@@ -890,7 +897,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulPWGLocalPrint) { ...@@ -890,7 +897,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulPWGLocalPrint) {
pwg_converter_->bitmap_settings().odd_page_transform); pwg_converter_->bitmap_settings().odd_page_transform);
EXPECT_FALSE(pwg_converter_->bitmap_settings().rotate_all_pages); EXPECT_FALSE(pwg_converter_->bitmap_settings().rotate_all_pages);
EXPECT_FALSE(pwg_converter_->bitmap_settings().reverse_page_order); EXPECT_FALSE(pwg_converter_->bitmap_settings().reverse_page_order);
}; }
TEST_F(PrivetLocalPrintTest, SuccessfulPWGLocalPrintDuplex) { TEST_F(PrivetLocalPrintTest, SuccessfulPWGLocalPrintDuplex) {
local_print_operation_->SetUsername("sample@gmail.com"); local_print_operation_->SetUsername("sample@gmail.com");
...@@ -927,7 +934,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulPWGLocalPrintDuplex) { ...@@ -927,7 +934,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulPWGLocalPrintDuplex) {
pwg_converter_->bitmap_settings().odd_page_transform); pwg_converter_->bitmap_settings().odd_page_transform);
EXPECT_FALSE(pwg_converter_->bitmap_settings().rotate_all_pages); EXPECT_FALSE(pwg_converter_->bitmap_settings().rotate_all_pages);
EXPECT_TRUE(pwg_converter_->bitmap_settings().reverse_page_order); EXPECT_TRUE(pwg_converter_->bitmap_settings().reverse_page_order);
}; }
TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithCreatejob) { TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithCreatejob) {
local_print_operation_->SetUsername("sample@gmail.com"); local_print_operation_->SetUsername("sample@gmail.com");
...@@ -959,7 +966,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithCreatejob) { ...@@ -959,7 +966,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithCreatejob) {
"job_name=Sample+job+name&job_id=1234"), "job_name=Sample+job+name&job_id=1234"),
"Sample print data", "Sample print data",
kSampleLocalPrintResponse)); kSampleLocalPrintResponse));
}; }
TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithOverlongName) { TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithOverlongName) {
local_print_operation_->SetUsername("sample@gmail.com"); local_print_operation_->SetUsername("sample@gmail.com");
...@@ -993,7 +1000,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithOverlongName) { ...@@ -993,7 +1000,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithOverlongName) {
"%3A123456789%3A123456789%3A&job_id=1234"), "%3A123456789%3A123456789%3A&job_id=1234"),
"Sample print data", "Sample print data",
kSampleLocalPrintResponse)); kSampleLocalPrintResponse));
}; }
TEST_F(PrivetLocalPrintTest, PDFPrintInvalidDocumentTypeRetry) { TEST_F(PrivetLocalPrintTest, PDFPrintInvalidDocumentTypeRetry) {
local_print_operation_->SetUsername("sample@gmail.com"); local_print_operation_->SetUsername("sample@gmail.com");
...@@ -1032,7 +1039,7 @@ TEST_F(PrivetLocalPrintTest, PDFPrintInvalidDocumentTypeRetry) { ...@@ -1032,7 +1039,7 @@ TEST_F(PrivetLocalPrintTest, PDFPrintInvalidDocumentTypeRetry) {
"job_name=Sample+job+name&job_id=1234"), "job_name=Sample+job+name&job_id=1234"),
base::FilePath(FILE_PATH_LITERAL("sample/path/test.pdf")), base::FilePath(FILE_PATH_LITERAL("sample/path/test.pdf")),
kSampleLocalPrintResponse)); kSampleLocalPrintResponse));
}; }
TEST_F(PrivetLocalPrintTest, LocalPrintRetryOnInvalidJobID) { TEST_F(PrivetLocalPrintTest, LocalPrintRetryOnInvalidJobID) {
local_print_operation_->SetUsername("sample@gmail.com"); local_print_operation_->SetUsername("sample@gmail.com");
...@@ -1067,8 +1074,8 @@ TEST_F(PrivetLocalPrintTest, LocalPrintRetryOnInvalidJobID) { ...@@ -1067,8 +1074,8 @@ TEST_F(PrivetLocalPrintTest, LocalPrintRetryOnInvalidJobID) {
EXPECT_TRUE(SuccessfulResponseToURL( EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/printer/createjob"), GURL("http://10.0.0.8:6006/privet/printer/createjob"),
kSampleCreatejobResponse)); kSampleCreatejobResponse));
}; }
#endif // ENABLE_FULL_PRINTING
} // namespace } // namespace
......
...@@ -43,7 +43,9 @@ ...@@ -43,7 +43,9 @@
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
#include "chrome/browser/metrics/android_metrics_provider.h" #include "chrome/browser/metrics/android_metrics_provider.h"
#else #endif
#if defined(ENABLE_FULL_PRINTING)
#include "chrome/browser/service_process/service_process_control.h" #include "chrome/browser/service_process/service_process_control.h"
#endif #endif
...@@ -394,10 +396,9 @@ void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() { ...@@ -394,10 +396,9 @@ void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() {
DCHECK_EQ(num_async_histogram_fetches_in_progress_, 0); DCHECK_EQ(num_async_histogram_fetches_in_progress_, 0);
#if defined(OS_ANDROID) #if !defined(ENABLE_FULL_PRINTING)
// Android has no service process.
num_async_histogram_fetches_in_progress_ = 1; num_async_histogram_fetches_in_progress_ = 1;
#else // OS_ANDROID #else // !ENABLE_FULL_PRINTING
num_async_histogram_fetches_in_progress_ = 2; num_async_histogram_fetches_in_progress_ = 2;
// Run requests to service and content in parallel. // Run requests to service and content in parallel.
if (!ServiceProcessControl::GetInstance()->GetHistograms(callback, timeout)) { if (!ServiceProcessControl::GetInstance()->GetHistograms(callback, timeout)) {
...@@ -408,7 +409,7 @@ void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() { ...@@ -408,7 +409,7 @@ void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() {
// here to make code work even if |GetHistograms()| fired |callback|. // here to make code work even if |GetHistograms()| fired |callback|.
--num_async_histogram_fetches_in_progress_; --num_async_histogram_fetches_in_progress_;
} }
#endif // OS_ANDROID #endif // !ENABLE_FULL_PRINTING
// Set up the callback to task to call after we receive histograms from all // Set up the callback to task to call after we receive histograms from all
// child processes. |timeout| specifies how long to wait before absolutely // child processes. |timeout| specifies how long to wait before absolutely
......
...@@ -253,10 +253,12 @@ TaskManagerModel::TaskManagerModel(TaskManager* task_manager) ...@@ -253,10 +253,12 @@ TaskManagerModel::TaskManagerModel(TaskManager* task_manager)
task_manager, task_manager,
scoped_ptr<WebContentsInformation>( scoped_ptr<WebContentsInformation>(
new task_manager::TabContentsInformation()))); new task_manager::TabContentsInformation())));
#if defined(ENABLE_FULL_PRINTING)
AddResourceProvider(new task_manager::WebContentsResourceProvider( AddResourceProvider(new task_manager::WebContentsResourceProvider(
task_manager, task_manager,
scoped_ptr<WebContentsInformation>( scoped_ptr<WebContentsInformation>(
new task_manager::PrintingInformation()))); new task_manager::PrintingInformation())));
#endif // ENABLE_FULL_PRINTING
AddResourceProvider(new task_manager::WebContentsResourceProvider( AddResourceProvider(new task_manager::WebContentsResourceProvider(
task_manager, task_manager,
scoped_ptr<WebContentsInformation>( scoped_ptr<WebContentsInformation>(
......
...@@ -69,8 +69,10 @@ int StringForChromeHost(const GURL& url) { ...@@ -69,8 +69,10 @@ int StringForChromeHost(const GURL& url) {
return IDS_PLUGINS_TITLE; return IDS_PLUGINS_TITLE;
if (host == chrome::kChromeUIPolicyHost) if (host == chrome::kChromeUIPolicyHost)
return IDS_POLICY_TITLE; return IDS_POLICY_TITLE;
#if defined(ENABLE_FULL_PRINTING)
if (host == chrome::kChromeUIPrintHost) if (host == chrome::kChromeUIPrintHost)
return IDS_PRINT_PREVIEW_TITLE; return IDS_PRINT_PREVIEW_TITLE;
#endif // ENABLE_FULL_PRINTING
if (host == chrome::kChromeUISettingsHost) if (host == chrome::kChromeUISettingsHost)
return IDS_SETTINGS_TITLE; return IDS_SETTINGS_TITLE;
if (host == chrome::kChromeUIVersionHost) if (host == chrome::kChromeUIVersionHost)
......
...@@ -1854,8 +1854,6 @@ ...@@ -1854,8 +1854,6 @@
], ],
# Used on top of the "basic" sources when enable_printing == 1 (full). # Used on top of the "basic" sources when enable_printing == 1 (full).
'chrome_browser_full_printing_sources': [ 'chrome_browser_full_printing_sources': [
'browser/local_discovery/privet_http_impl.cc',
'browser/local_discovery/privet_http_impl.h',
'browser/local_discovery/pwg_raster_converter.cc', 'browser/local_discovery/pwg_raster_converter.cc',
'browser/local_discovery/pwg_raster_converter.h', 'browser/local_discovery/pwg_raster_converter.h',
'browser/printing/background_printing_manager.cc', 'browser/printing/background_printing_manager.cc',
...@@ -2388,6 +2386,8 @@ ...@@ -2388,6 +2386,8 @@
'browser/local_discovery/privet_http_asynchronous_factory.h', 'browser/local_discovery/privet_http_asynchronous_factory.h',
'browser/local_discovery/privet_http_asynchronous_factory_mac.cc', 'browser/local_discovery/privet_http_asynchronous_factory_mac.cc',
'browser/local_discovery/privet_http_asynchronous_factory_mac.h', 'browser/local_discovery/privet_http_asynchronous_factory_mac.h',
'browser/local_discovery/privet_http_impl.cc',
'browser/local_discovery/privet_http_impl.h',
'browser/local_discovery/privet_local_printer_lister.cc', 'browser/local_discovery/privet_local_printer_lister.cc',
'browser/local_discovery/privet_local_printer_lister.h', 'browser/local_discovery/privet_local_printer_lister.h',
'browser/local_discovery/privet_notifications.cc', 'browser/local_discovery/privet_notifications.cc',
......
...@@ -2078,6 +2078,7 @@ ...@@ -2078,6 +2078,7 @@
['exclude', '^browser/printing/cloud_print/test/.*'], ['exclude', '^browser/printing/cloud_print/test/.*'],
['exclude', '^browser/printing/print_preview_dialog_controller_browsertest.cc'], ['exclude', '^browser/printing/print_preview_dialog_controller_browsertest.cc'],
['exclude', '^browser/printing/print_preview_pdf_generated_browsertest.cc'], ['exclude', '^browser/printing/print_preview_pdf_generated_browsertest.cc'],
['exclude', '^browser/service_process/service_process_control_browsertest.cc'],
['exclude', '^browser/ui/webui/print_preview/print_preview_ui_browsertest.cc'], ['exclude', '^browser/ui/webui/print_preview/print_preview_ui_browsertest.cc'],
['exclude', '^renderer/printing/print_web_view_helper_browsertest.cc'], ['exclude', '^renderer/printing/print_web_view_helper_browsertest.cc'],
['exclude', '^test/data/webui/print_preview.cc'], ['exclude', '^test/data/webui/print_preview.cc'],
......
...@@ -2268,9 +2268,6 @@ ...@@ -2268,9 +2268,6 @@
['exclude', '^common/service_'], ['exclude', '^common/service_'],
['exclude', '^service/'], ['exclude', '^service/'],
], ],
'sources!': [
'browser/local_discovery/privet_http_unittest.cc',
],
}], }],
['enable_captive_portal_detection!=1', { ['enable_captive_portal_detection!=1', {
'sources/': [ 'sources/': [
......
...@@ -14,12 +14,10 @@ ...@@ -14,12 +14,10 @@
#include "printing/pdf_render_settings.h" #include "printing/pdf_render_settings.h"
#include "printing/pwg_raster_settings.h" #include "printing/pwg_raster_settings.h"
#if !defined(ENABLE_FULL_PRINTING)
#error "Full printing must be enabled"
#endif
#define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart #define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart
#if defined(ENABLE_FULL_PRINTING)
IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults) IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults)
IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) IPC_STRUCT_TRAITS_MEMBER(printer_capabilities)
IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) IPC_STRUCT_TRAITS_MEMBER(caps_mime_type)
...@@ -85,17 +83,6 @@ IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults, ...@@ -85,17 +83,6 @@ IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults,
IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults, IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults,
std::string /* printer name */) std::string /* printer name */)
#if defined(OS_WIN)
// Tell the utility process to render the given PDF into a metafile.
// The metafile path will have ".%d" inserted where the %d is the page number.
// If no page range is specified, all pages will be converted.
IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToMetafiles,
IPC::PlatformFileForTransit, // PDF file
base::FilePath, // Base location for output metafile
printing::PdfRenderSettings, // PDF render settings
std::vector<printing::PageRange>)
#endif // OS_WIN
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Utility process host messages: // Utility process host messages:
// These are messages from the utility process to the browser. // These are messages from the utility process to the browser.
...@@ -130,7 +117,18 @@ IPC_MESSAGE_CONTROL1( ...@@ -130,7 +117,18 @@ IPC_MESSAGE_CONTROL1(
ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed, ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed,
std::string /* printer name */) std::string /* printer name */)
#endif // ENABLE_FULL_PRINTING
#if defined(OS_WIN) #if defined(OS_WIN)
// Tell the utility process to render the given PDF into a metafile.
// The metafile path will have ".%d" inserted where the %d is the page number.
// If no page range is specified, all pages will be converted.
IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToMetafiles,
IPC::PlatformFileForTransit, // PDF file
base::FilePath, // Base location for output metafile
printing::PdfRenderSettings, // PDF render settings
std::vector<printing::PageRange>)
// Reply when the utility process has succeeded in rendering the PDF. // Reply when the utility process has succeeded in rendering the PDF.
IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_Succeeded, IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_Succeeded,
std::vector<printing::PageRange>, // Pages rendered std::vector<printing::PageRange>, // Pages rendered
...@@ -138,4 +136,5 @@ IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_Succeeded, ...@@ -138,4 +136,5 @@ IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_Succeeded,
// Reply when an error occurred rendering the PDF. // Reply when an error occurred rendering the PDF.
IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToMetafile_Failed) IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToMetafile_Failed)
#endif // OS_WIN #endif // OS_WIN
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
#endif #endif
#if defined(ENABLE_FULL_PRINTING) #if defined(ENABLE_FULL_PRINTING)
#include "chrome/common/chrome_utility_printing_messages.h"
#include "chrome/common/service_messages.h" #include "chrome/common/service_messages.h"
#endif #endif
#if defined(ENABLE_PRINTING) #if defined(ENABLE_PRINTING)
#include "chrome/common/chrome_utility_printing_messages.h"
#include "chrome/common/print_messages.h" #include "chrome/common/print_messages.h"
#endif #endif
......
...@@ -221,7 +221,6 @@ const char kChromeUIProfileSigninConfirmationHost[] = ...@@ -221,7 +221,6 @@ const char kChromeUIProfileSigninConfirmationHost[] =
"profile-signin-confirmation"; "profile-signin-confirmation";
const char kChromeUIUserManagerHost[] = "user-manager"; const char kChromeUIUserManagerHost[] = "user-manager";
const char kChromeUIPredictorsHost[] = "predictors"; const char kChromeUIPredictorsHost[] = "predictors";
const char kChromeUIPrintHost[] = "print";
const char kChromeUIProfilerHost[] = "profiler"; const char kChromeUIProfilerHost[] = "profiler";
const char kChromeUIQuotaInternalsHost[] = "quota-internals"; const char kChromeUIQuotaInternalsHost[] = "quota-internals";
const char kChromeUIQuitHost[] = "quit"; const char kChromeUIQuitHost[] = "quit";
...@@ -259,6 +258,10 @@ const char kChromeUIWorkersHost[] = "workers"; ...@@ -259,6 +258,10 @@ const char kChromeUIWorkersHost[] = "workers";
const char kChromeUIScreenshotPath[] = "screenshots"; const char kChromeUIScreenshotPath[] = "screenshots";
const char kChromeUIThemePath[] = "theme"; const char kChromeUIThemePath[] = "theme";
#if defined(ENABLE_FULL_PRINTING)
const char kChromeUIPrintHost[] = "print";
#endif // ENABLE_FULL_PRINTING
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
const char kChromeUIWelcomeHost[] = "welcome"; const char kChromeUIWelcomeHost[] = "welcome";
#endif #endif
......
...@@ -208,7 +208,6 @@ extern const char kChromeUIProfileSigninConfirmationHost[]; ...@@ -208,7 +208,6 @@ extern const char kChromeUIProfileSigninConfirmationHost[];
extern const char kChromeUIProvidedFileSystemsHost[]; extern const char kChromeUIProvidedFileSystemsHost[];
extern const char kChromeUIUserManagerHost[]; extern const char kChromeUIUserManagerHost[];
extern const char kChromeUIPredictorsHost[]; extern const char kChromeUIPredictorsHost[];
extern const char kChromeUIPrintHost[];
extern const char kChromeUIProfilerHost[]; extern const char kChromeUIProfilerHost[];
extern const char kChromeUIQuotaInternalsHost[]; extern const char kChromeUIQuotaInternalsHost[];
extern const char kChromeUIQuitHost[]; extern const char kChromeUIQuitHost[];
...@@ -246,6 +245,10 @@ extern const char kChromeUIWorkersHost[]; ...@@ -246,6 +245,10 @@ extern const char kChromeUIWorkersHost[];
extern const char kChromeUIScreenshotPath[]; extern const char kChromeUIScreenshotPath[];
extern const char kChromeUIThemePath[]; extern const char kChromeUIThemePath[];
#if defined(ENABLE_FULL_PRINTING)
extern const char kChromeUIPrintHost[];
#endif // ENABLE_FULL_PRINTING
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
extern const char kChromeUIWelcomeHost[]; extern const char kChromeUIWelcomeHost[];
#endif #endif
......
...@@ -266,7 +266,7 @@ bool TestingBrowserProcess::IsShuttingDown() { ...@@ -266,7 +266,7 @@ bool TestingBrowserProcess::IsShuttingDown() {
} }
printing::PrintJobManager* TestingBrowserProcess::print_job_manager() { printing::PrintJobManager* TestingBrowserProcess::print_job_manager() {
#if defined(ENABLE_FULL_PRINTING) #if defined(ENABLE_PRINTING)
if (!print_job_manager_.get()) if (!print_job_manager_.get())
print_job_manager_.reset(new printing::PrintJobManager()); print_job_manager_.reset(new printing::PrintJobManager());
return print_job_manager_.get(); return print_job_manager_.get();
......
...@@ -155,8 +155,11 @@ class TestingBrowserProcess : public BrowserProcess { ...@@ -155,8 +155,11 @@ class TestingBrowserProcess : public BrowserProcess {
scoped_ptr<ProfileManager> profile_manager_; scoped_ptr<ProfileManager> profile_manager_;
scoped_ptr<NotificationUIManager> notification_ui_manager_; scoped_ptr<NotificationUIManager> notification_ui_manager_;
#if defined(ENABLE_FULL_PRINTING) #if defined(ENABLE_PRINTING)
scoped_ptr<printing::PrintJobManager> print_job_manager_; scoped_ptr<printing::PrintJobManager> print_job_manager_;
#endif
#if defined(ENABLE_FULL_PRINTING)
scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_;
scoped_refptr<printing::PrintPreviewDialogController> scoped_refptr<printing::PrintPreviewDialogController>
print_preview_dialog_controller_; print_preview_dialog_controller_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment