[go: nahoru, domu]

Refactor the code that starts printing into a common location.

Previously, browser_commands.cc and render_view_context_menu.cc
duplicated the logic for when to start a print preview and when to start
a print using the system UI. This CL refactors those into a common
location.

BUG=435420

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

Cr-Commit-Position: refs/heads/master@{#305494}
diff --git a/chrome/browser/printing/print_view_manager_common.h b/chrome/browser/printing/print_view_manager_common.h
new file mode 100644
index 0000000..6e10640
--- /dev/null
+++ b/chrome/browser/printing/print_view_manager_common.h
@@ -0,0 +1,26 @@
+// Copyright 2014 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.
+
+#ifndef CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_
+#define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_
+
+namespace content {
+class WebContents;
+}
+
+namespace printing {
+
+// Start printing using the appropriate PrintViewManagerBase subclass.
+void StartPrint(content::WebContents* web_contents,
+                bool print_preview_disabled,
+                bool selection_only);
+
+#if defined(ENABLE_BASIC_PRINTING)
+// Start printing using the system print dialog.
+void StartBasicPrint(content::WebContents* contents);
+#endif
+
+}  // namespace printing
+
+#endif  // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_