summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvitalybuka <vitalybuka@chromium.org>2014-09-08 17:32:22 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-09 00:39:59 +0000
commitf537167a19728b508c8dcf192273d75b3a1726c7 (patch)
tree4765cfbd72baaacba440ddb11e35eccb7e64a355
parent597255e67d2d627ad17d8d313c8aa47d5dc7bd6c (diff)
downloadchromium_src-f537167a19728b508c8dcf192273d75b3a1726c7.zip
chromium_src-f537167a19728b508c8dcf192273d75b3a1726c7.tar.gz
chromium_src-f537167a19728b508c8dcf192273d75b3a1726c7.tar.bz2
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}
-rw-r--r--chrome/browser/apps/app_browsertest.cc7
-rw-r--r--chrome/browser/browser_shutdown.cc8
-rw-r--r--chrome/browser/local_discovery/privet_http.h3
-rw-r--r--chrome/browser/local_discovery/privet_http_impl.cc17
-rw-r--r--chrome/browser/local_discovery/privet_http_impl.h3
-rw-r--r--chrome/browser/local_discovery/privet_http_unittest.cc181
-rw-r--r--chrome/browser/metrics/chrome_metrics_service_client.cc11
-rw-r--r--chrome/browser/task_manager/task_manager.cc2
-rw-r--r--chrome/browser/ui/location_bar/origin_chip_info.cc2
-rw-r--r--chrome/chrome_browser.gypi4
-rw-r--r--chrome/chrome_tests.gypi1
-rw-r--r--chrome/chrome_tests_unit.gypi3
-rw-r--r--chrome/common/chrome_utility_printing_messages.h29
-rw-r--r--chrome/common/common_message_generator.h2
-rw-r--r--chrome/common/url_constants.cc5
-rw-r--r--chrome/common/url_constants.h5
-rw-r--r--chrome/test/base/testing_browser_process.cc2
-rw-r--r--chrome/test/base/testing_browser_process.h5
18 files changed, 166 insertions, 124 deletions
diff --git a/chrome/browser/apps/app_browsertest.cc b/chrome/browser/apps/app_browsertest.cc
index 578c154..5e5f320 100644
--- a/chrome/browser/apps/app_browsertest.cc
+++ b/chrome/browser/apps/app_browsertest.cc
@@ -114,6 +114,7 @@ class TabsAddedNotificationObserver
DISALLOW_COPY_AND_ASSIGN(TabsAddedNotificationObserver);
};
+#if defined(ENABLE_FULL_PRINTING)
class ScopedPreviewTestingDelegate : PrintPreviewUI::TestingDelegate {
public:
explicit ScopedPreviewTestingDelegate(bool auto_cancel)
@@ -169,6 +170,8 @@ class ScopedPreviewTestingDelegate : PrintPreviewUI::TestingDelegate {
gfx::Size dialog_size_;
};
+#endif // ENABLE_FULL_PRINTING
+
#if !defined(OS_CHROMEOS) && !defined(OS_WIN)
bool CopyTestDataAndSetCommandLineArg(
const base::FilePath& test_data_file,
@@ -1110,6 +1113,9 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MAYBE_WebContentsHasFocus) {
->HasFocus());
}
+
+#if defined(ENABLE_FULL_PRINTING)
+
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX)
#define MAYBE_WindowDotPrintShouldBringUpPrintPreview \
DISABLED_WindowDotPrintShouldBringUpPrintPreview
@@ -1159,6 +1165,7 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
minimum_dialog_size.height());
GetFirstAppWindow()->GetBaseWindow()->Close();
}
+#endif // ENABLE_FULL_PRINTING
#if defined(OS_CHROMEOS)
diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc
index a07f691..eaad004 100644
--- a/chrome/browser/browser_shutdown.cc
+++ b/chrome/browser/browser_shutdown.cc
@@ -24,7 +24,6 @@
#include "chrome/browser/first_run/upgrade_util.h"
#include "chrome/browser/lifetime/application_lifetime.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_switches.h"
#include "chrome/common/crash_keys.h"
@@ -47,6 +46,10 @@
#include "chrome/browser/chromeos/boot_times_loader.h"
#endif
+#if defined(ENABLE_FULL_PRINTING)
+#include "chrome/browser/service_process/service_process_control.h"
+#endif
+
using base::Time;
using base::TimeDelta;
using content::BrowserThread;
@@ -140,9 +143,10 @@ bool ShutdownPreThreadsStop() {
chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker(
"BrowserShutdownStarted", false);
#endif
-
+#if defined(ENABLE_FULL_PRINTING)
// Shutdown the IPC channel to the service processes.
ServiceProcessControl::GetInstance()->Disconnect();
+#endif // ENABLE_FULL_PRINTING
// 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,
diff --git a/chrome/browser/local_discovery/privet_http.h b/chrome/browser/local_discovery/privet_http.h
index 6556a67d..e750b1b 100644
--- a/chrome/browser/local_discovery/privet_http.h
+++ b/chrome/browser/local_discovery/privet_http.h
@@ -9,7 +9,6 @@
#include "base/callback.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"
namespace base {
@@ -26,6 +25,7 @@ class PdfRenderSettings;
namespace local_discovery {
+class PWGRasterConverter;
class PrivetHTTPClient;
// Represents a simple request that returns pure JSON.
@@ -208,7 +208,6 @@ class PrivetV1HTTPClient {
// Creates operation to submit print job to local printer.
virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation(
PrivetLocalPrintOperation::Delegate* delegate) = 0;
-
};
} // namespace local_discovery
diff --git a/chrome/browser/local_discovery/privet_http_impl.cc b/chrome/browser/local_discovery/privet_http_impl.cc
index a1db153..5f90ba7 100644
--- a/chrome/browser/local_discovery/privet_http_impl.cc
+++ b/chrome/browser/local_discovery/privet_http_impl.cc
@@ -21,6 +21,10 @@
#include "ui/gfx/text_elider.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;
namespace cloud_print {
@@ -34,6 +38,9 @@ const char kUrlPlaceHolder[] = "http://host/";
const char kPrivetRegisterActionArgName[] = "action";
const char kPrivetRegisterUserArgName[] = "user";
+const int kPrivetCancelationTimeoutSeconds = 3;
+
+#if defined(ENABLE_FULL_PRINTING)
const char kPrivetURLKeyUserName[] = "user_name";
const char kPrivetURLKeyClientName[] = "client_name";
const char kPrivetURLKeyJobname[] = "job_name";
@@ -47,13 +54,11 @@ const char kPrivetContentTypeAny[] = "*/*";
const char kPrivetKeyJobID[] = "job_id";
-const int kPrivetCancelationTimeoutSeconds = 3;
-
const int kPrivetLocalPrintMaxRetries = 2;
-
const int kPrivetLocalPrintDefaultTimeout = 5;
const size_t kPrivetLocalPrintMaxJobNameLength = 64;
+#endif // ENABLE_FULL_PRINTING
GURL CreatePrivetURL(const std::string& path) {
GURL url(kUrlPlaceHolder);
@@ -460,6 +465,7 @@ bool PrivetDataReadOperationImpl::OnRawData(PrivetURLFetcher* fetcher,
return true;
}
+#if defined(ENABLE_FULL_PRINTING)
PrivetLocalPrintOperationImpl::PrivetLocalPrintOperationImpl(
PrivetHTTPClient* privet_client,
PrivetLocalPrintOperation::Delegate* delegate)
@@ -819,6 +825,7 @@ void PrivetLocalPrintOperationImpl::SetPWGRasterConverterForTesting(
scoped_ptr<PWGRasterConverter> pwg_raster_converter) {
pwg_raster_converter_ = pwg_raster_converter.Pass();
}
+#endif // ENABLE_FULL_PRINTING
PrivetHTTPClientImpl::PrivetHTTPClientImpl(
const std::string& name,
@@ -921,8 +928,12 @@ PrivetV1HTTPClientImpl::CreateCapabilitiesOperation(
scoped_ptr<PrivetLocalPrintOperation>
PrivetV1HTTPClientImpl::CreateLocalPrintOperation(
PrivetLocalPrintOperation::Delegate* delegate) {
+#if defined(ENABLE_FULL_PRINTING)
return scoped_ptr<PrivetLocalPrintOperation>(
new PrivetLocalPrintOperationImpl(info_client(), delegate));
+#else
+ return scoped_ptr<PrivetLocalPrintOperation>();
+#endif // ENABLE_FULL_PRINTING
}
} // namespace local_discovery
diff --git a/chrome/browser/local_discovery/privet_http_impl.h b/chrome/browser/local_discovery/privet_http_impl.h
index 99cd93b..0d934f5 100644
--- a/chrome/browser/local_discovery/privet_http_impl.h
+++ b/chrome/browser/local_discovery/privet_http_impl.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_IMPL_H_
#include <string>
+#include <vector>
#include "base/callback.h"
#include "base/files/file_util.h"
@@ -193,6 +194,7 @@ class PrivetDataReadOperationImpl : public PrivetDataReadOperation,
scoped_ptr<PrivetURLFetcher> url_fetcher_;
};
+#if defined(ENABLE_FULL_PRINTING)
class PrivetLocalPrintOperationImpl
: public PrivetLocalPrintOperation,
public PrivetURLFetcher::Delegate {
@@ -282,6 +284,7 @@ class PrivetLocalPrintOperationImpl
base::WeakPtrFactory<PrivetLocalPrintOperationImpl> weak_factory_;
};
+#endif // ENABLE_FULL_PRINTING
class PrivetHTTPClientImpl : public PrivetHTTPClient {
public:
diff --git a/chrome/browser/local_discovery/privet_http_unittest.cc b/chrome/browser/local_discovery/privet_http_unittest.cc
index e19bf1a..94c9bc7 100644
--- a/chrome/browser/local_discovery/privet_http_unittest.cc
+++ b/chrome/browser/local_discovery/privet_http_unittest.cc
@@ -15,6 +15,10 @@
#include "testing/gmock/include/gmock/gmock.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::NiceMock;
@@ -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[] = "{"
"\"user\": \"example@google.com\","
"\"action\": \"start\""
@@ -138,14 +114,6 @@ const char kSampleRegisterCancelResponse[] = "{"
"\"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[] = "{"
"\"version\" : \"1.0\","
"\"printer\" : {"
@@ -156,20 +124,47 @@ const char kSampleCapabilitiesResponse[] = "{"
"}"
"}";
-const char kSampleCapabilitiesResponsePWGOnly[] = "{"
- "\"version\" : \"1.0\","
- "\"printer\" : {"
- " \"supported_content_type\" : ["
- " { \"content_type\" : \"image/pwg-raster\" }"
- " ]"
- "}"
+#if defined(ENABLE_FULL_PRINTING)
+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 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\","
"\"printer\" : {"
" \"supported_content_type\" : ["
- " { \"content_type\" : \"*/*\" },"
" { \"content_type\" : \"image/pwg-raster\" }"
" ]"
"}"
@@ -186,6 +181,16 @@ const char kSampleInvalidDocumentTypeResponse[] = "{"
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 kSampleCapabilitiesResponsePWGSettings[] =
@@ -207,6 +212,7 @@ const char kSampleCJTDuplex[] =
"\"version\" : \"1.0\","
"\"print\": { \"duplex\": {\"type\": \"SHORT_EDGE\"} }"
"}";
+#endif // ENABLE_FULL_PRINTING
// Return the representation of the given JSON that would be outputted by
// JSONWriter. This ensures the same JSON values are represented by the same
@@ -429,35 +435,6 @@ class MockLocalPrintDelegate : public PrivetLocalPrintOperation::Delegate {
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 {
public:
PrivetInfoTest() {}
@@ -489,7 +466,7 @@ TEST_F(PrivetInfoTest, SuccessfulInfo) {
EXPECT_CALL(info_callback_, OnPrivetJSONDoneInternal());
fetcher->delegate()->OnURLFetchComplete(fetcher);
-};
+}
TEST_F(PrivetInfoTest, InfoFailureHTTP) {
info_operation_->Start();
@@ -502,7 +479,7 @@ TEST_F(PrivetInfoTest, InfoFailureHTTP) {
EXPECT_CALL(info_callback_, OnPrivetJSONDoneInternal());
fetcher->delegate()->OnURLFetchComplete(fetcher);
-};
+}
class PrivetRegisterTest : public PrivetHTTPTest {
public:
@@ -726,7 +703,7 @@ TEST_F(PrivetCapabilitiesTest, SuccessfulCapabilities) {
std::string version;
EXPECT_TRUE(capabilities_callback_.value()->GetString("version", &version));
EXPECT_EQ("1.0", version);
-};
+}
TEST_F(PrivetCapabilitiesTest, CacheToken) {
capabilities_operation_->Start();
@@ -751,7 +728,7 @@ TEST_F(PrivetCapabilitiesTest, CacheToken) {
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/capabilities"),
kSampleCapabilitiesResponse));
-};
+}
TEST_F(PrivetCapabilitiesTest, BadToken) {
capabilities_operation_->Start();
@@ -773,6 +750,36 @@ TEST_F(PrivetCapabilitiesTest, BadToken) {
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/capabilities"),
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 {
@@ -832,7 +839,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrint) {
"job_name=Sample+job+name"),
"Sample print data",
kSampleLocalPrintResponse));
-};
+}
TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithAnyMimetype) {
local_print_operation_->SetUsername("sample@gmail.com");
@@ -859,7 +866,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithAnyMimetype) {
"job_name=Sample+job+name"),
"Sample print data",
kSampleLocalPrintResponse));
-};
+}
TEST_F(PrivetLocalPrintTest, SuccessfulPWGLocalPrint) {
local_print_operation_->SetUsername("sample@gmail.com");
@@ -890,7 +897,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulPWGLocalPrint) {
pwg_converter_->bitmap_settings().odd_page_transform);
EXPECT_FALSE(pwg_converter_->bitmap_settings().rotate_all_pages);
EXPECT_FALSE(pwg_converter_->bitmap_settings().reverse_page_order);
-};
+}
TEST_F(PrivetLocalPrintTest, SuccessfulPWGLocalPrintDuplex) {
local_print_operation_->SetUsername("sample@gmail.com");
@@ -927,7 +934,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulPWGLocalPrintDuplex) {
pwg_converter_->bitmap_settings().odd_page_transform);
EXPECT_FALSE(pwg_converter_->bitmap_settings().rotate_all_pages);
EXPECT_TRUE(pwg_converter_->bitmap_settings().reverse_page_order);
-};
+}
TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithCreatejob) {
local_print_operation_->SetUsername("sample@gmail.com");
@@ -959,7 +966,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithCreatejob) {
"job_name=Sample+job+name&job_id=1234"),
"Sample print data",
kSampleLocalPrintResponse));
-};
+}
TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithOverlongName) {
local_print_operation_->SetUsername("sample@gmail.com");
@@ -993,7 +1000,7 @@ TEST_F(PrivetLocalPrintTest, SuccessfulLocalPrintWithOverlongName) {
"%3A123456789%3A123456789%3A&job_id=1234"),
"Sample print data",
kSampleLocalPrintResponse));
-};
+}
TEST_F(PrivetLocalPrintTest, PDFPrintInvalidDocumentTypeRetry) {
local_print_operation_->SetUsername("sample@gmail.com");
@@ -1032,7 +1039,7 @@ TEST_F(PrivetLocalPrintTest, PDFPrintInvalidDocumentTypeRetry) {
"job_name=Sample+job+name&job_id=1234"),
base::FilePath(FILE_PATH_LITERAL("sample/path/test.pdf")),
kSampleLocalPrintResponse));
-};
+}
TEST_F(PrivetLocalPrintTest, LocalPrintRetryOnInvalidJobID) {
local_print_operation_->SetUsername("sample@gmail.com");
@@ -1067,8 +1074,8 @@ TEST_F(PrivetLocalPrintTest, LocalPrintRetryOnInvalidJobID) {
EXPECT_TRUE(SuccessfulResponseToURL(
GURL("http://10.0.0.8:6006/privet/printer/createjob"),
kSampleCreatejobResponse));
-};
-
+}
+#endif // ENABLE_FULL_PRINTING
} // namespace
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc
index 173f622..4db6bcc 100644
--- a/chrome/browser/metrics/chrome_metrics_service_client.cc
+++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
@@ -43,7 +43,9 @@
#if defined(OS_ANDROID)
#include "chrome/browser/metrics/android_metrics_provider.h"
-#else
+#endif
+
+#if defined(ENABLE_FULL_PRINTING)
#include "chrome/browser/service_process/service_process_control.h"
#endif
@@ -394,10 +396,9 @@ void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() {
DCHECK_EQ(num_async_histogram_fetches_in_progress_, 0);
-#if defined(OS_ANDROID)
- // Android has no service process.
+#if !defined(ENABLE_FULL_PRINTING)
num_async_histogram_fetches_in_progress_ = 1;
-#else // OS_ANDROID
+#else // !ENABLE_FULL_PRINTING
num_async_histogram_fetches_in_progress_ = 2;
// Run requests to service and content in parallel.
if (!ServiceProcessControl::GetInstance()->GetHistograms(callback, timeout)) {
@@ -408,7 +409,7 @@ void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() {
// here to make code work even if |GetHistograms()| fired |callback|.
--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
// child processes. |timeout| specifies how long to wait before absolutely
diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc
index 67c5f7e..9919563 100644
--- a/chrome/browser/task_manager/task_manager.cc
+++ b/chrome/browser/task_manager/task_manager.cc
@@ -253,10 +253,12 @@ TaskManagerModel::TaskManagerModel(TaskManager* task_manager)
task_manager,
scoped_ptr<WebContentsInformation>(
new task_manager::TabContentsInformation())));
+#if defined(ENABLE_FULL_PRINTING)
AddResourceProvider(new task_manager::WebContentsResourceProvider(
task_manager,
scoped_ptr<WebContentsInformation>(
new task_manager::PrintingInformation())));
+#endif // ENABLE_FULL_PRINTING
AddResourceProvider(new task_manager::WebContentsResourceProvider(
task_manager,
scoped_ptr<WebContentsInformation>(
diff --git a/chrome/browser/ui/location_bar/origin_chip_info.cc b/chrome/browser/ui/location_bar/origin_chip_info.cc
index 354ce79..715e596 100644
--- a/chrome/browser/ui/location_bar/origin_chip_info.cc
+++ b/chrome/browser/ui/location_bar/origin_chip_info.cc
@@ -69,8 +69,10 @@ int StringForChromeHost(const GURL& url) {
return IDS_PLUGINS_TITLE;
if (host == chrome::kChromeUIPolicyHost)
return IDS_POLICY_TITLE;
+#if defined(ENABLE_FULL_PRINTING)
if (host == chrome::kChromeUIPrintHost)
return IDS_PRINT_PREVIEW_TITLE;
+#endif // ENABLE_FULL_PRINTING
if (host == chrome::kChromeUISettingsHost)
return IDS_SETTINGS_TITLE;
if (host == chrome::kChromeUIVersionHost)
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 13aa270..d241c0a 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1854,8 +1854,6 @@
],
# Used on top of the "basic" sources when enable_printing == 1 (full).
'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.h',
'browser/printing/background_printing_manager.cc',
@@ -2388,6 +2386,8 @@
'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.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.h',
'browser/local_discovery/privet_notifications.cc',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index d5d58f7..8d130f9 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -2078,6 +2078,7 @@
['exclude', '^browser/printing/cloud_print/test/.*'],
['exclude', '^browser/printing/print_preview_dialog_controller_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', '^renderer/printing/print_web_view_helper_browsertest.cc'],
['exclude', '^test/data/webui/print_preview.cc'],
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index 90c8f4d..3bd1c12 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -2268,9 +2268,6 @@
['exclude', '^common/service_'],
['exclude', '^service/'],
],
- 'sources!': [
- 'browser/local_discovery/privet_http_unittest.cc',
- ],
}],
['enable_captive_portal_detection!=1', {
'sources/': [
diff --git a/chrome/common/chrome_utility_printing_messages.h b/chrome/common/chrome_utility_printing_messages.h
index 4858367..d0a964d 100644
--- a/chrome/common/chrome_utility_printing_messages.h
+++ b/chrome/common/chrome_utility_printing_messages.h
@@ -14,12 +14,10 @@
#include "printing/pdf_render_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
+#if defined(ENABLE_FULL_PRINTING)
+
IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults)
IPC_STRUCT_TRAITS_MEMBER(printer_capabilities)
IPC_STRUCT_TRAITS_MEMBER(caps_mime_type)
@@ -85,17 +83,6 @@ IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults,
IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults,
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:
// These are messages from the utility process to the browser.
@@ -130,7 +117,18 @@ IPC_MESSAGE_CONTROL1(
ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed,
std::string /* printer name */)
+#endif // ENABLE_FULL_PRINTING
+
#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.
IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_Succeeded,
std::vector<printing::PageRange>, // Pages rendered
@@ -138,4 +136,5 @@ IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_Succeeded,
// Reply when an error occurred rendering the PDF.
IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToMetafile_Failed)
+
#endif // OS_WIN
diff --git a/chrome/common/common_message_generator.h b/chrome/common/common_message_generator.h
index 216f748..efb658e 100644
--- a/chrome/common/common_message_generator.h
+++ b/chrome/common/common_message_generator.h
@@ -24,11 +24,11 @@
#endif
#if defined(ENABLE_FULL_PRINTING)
-#include "chrome/common/chrome_utility_printing_messages.h"
#include "chrome/common/service_messages.h"
#endif
#if defined(ENABLE_PRINTING)
+#include "chrome/common/chrome_utility_printing_messages.h"
#include "chrome/common/print_messages.h"
#endif
diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc
index 6ac57c5..90f53cf 100644
--- a/chrome/common/url_constants.cc
+++ b/chrome/common/url_constants.cc
@@ -221,7 +221,6 @@ const char kChromeUIProfileSigninConfirmationHost[] =
"profile-signin-confirmation";
const char kChromeUIUserManagerHost[] = "user-manager";
const char kChromeUIPredictorsHost[] = "predictors";
-const char kChromeUIPrintHost[] = "print";
const char kChromeUIProfilerHost[] = "profiler";
const char kChromeUIQuotaInternalsHost[] = "quota-internals";
const char kChromeUIQuitHost[] = "quit";
@@ -259,6 +258,10 @@ const char kChromeUIWorkersHost[] = "workers";
const char kChromeUIScreenshotPath[] = "screenshots";
const char kChromeUIThemePath[] = "theme";
+#if defined(ENABLE_FULL_PRINTING)
+const char kChromeUIPrintHost[] = "print";
+#endif // ENABLE_FULL_PRINTING
+
#if defined(OS_ANDROID)
const char kChromeUIWelcomeHost[] = "welcome";
#endif
diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h
index 0f59363..9b777f9 100644
--- a/chrome/common/url_constants.h
+++ b/chrome/common/url_constants.h
@@ -208,7 +208,6 @@ extern const char kChromeUIProfileSigninConfirmationHost[];
extern const char kChromeUIProvidedFileSystemsHost[];
extern const char kChromeUIUserManagerHost[];
extern const char kChromeUIPredictorsHost[];
-extern const char kChromeUIPrintHost[];
extern const char kChromeUIProfilerHost[];
extern const char kChromeUIQuotaInternalsHost[];
extern const char kChromeUIQuitHost[];
@@ -246,6 +245,10 @@ extern const char kChromeUIWorkersHost[];
extern const char kChromeUIScreenshotPath[];
extern const char kChromeUIThemePath[];
+#if defined(ENABLE_FULL_PRINTING)
+extern const char kChromeUIPrintHost[];
+#endif // ENABLE_FULL_PRINTING
+
#if defined(OS_ANDROID)
extern const char kChromeUIWelcomeHost[];
#endif
diff --git a/chrome/test/base/testing_browser_process.cc b/chrome/test/base/testing_browser_process.cc
index 44b0cf3..8552f05 100644
--- a/chrome/test/base/testing_browser_process.cc
+++ b/chrome/test/base/testing_browser_process.cc
@@ -266,7 +266,7 @@ bool TestingBrowserProcess::IsShuttingDown() {
}
printing::PrintJobManager* TestingBrowserProcess::print_job_manager() {
-#if defined(ENABLE_FULL_PRINTING)
+#if defined(ENABLE_PRINTING)
if (!print_job_manager_.get())
print_job_manager_.reset(new printing::PrintJobManager());
return print_job_manager_.get();
diff --git a/chrome/test/base/testing_browser_process.h b/chrome/test/base/testing_browser_process.h
index 54323e0..bf39038 100644
--- a/chrome/test/base/testing_browser_process.h
+++ b/chrome/test/base/testing_browser_process.h
@@ -155,8 +155,11 @@ class TestingBrowserProcess : public BrowserProcess {
scoped_ptr<ProfileManager> profile_manager_;
scoped_ptr<NotificationUIManager> notification_ui_manager_;
-#if defined(ENABLE_FULL_PRINTING)
+#if defined(ENABLE_PRINTING)
scoped_ptr<printing::PrintJobManager> print_job_manager_;
+#endif
+
+#if defined(ENABLE_FULL_PRINTING)
scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_;
scoped_refptr<printing::PrintPreviewDialogController>
print_preview_dialog_controller_;