1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_ 6 #define CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_ 7 8 #include <string> 9 10 #include "base/basictypes.h" 11 #include "base/callback.h" 12 #include "base/memory/ref_counted_memory.h" 13 #include "base/strings/string16.h" 14 #include "ui/gfx/native_widget_types.h" 15 16 class CommandLine; 17 class Profile; 18 19 namespace base { 20 class FilePath; 21 } 22 23 namespace content { 24 class BrowserContext; 25 } 26 27 namespace user_prefs { 28 class PrefRegistrySyncable; 29 } 30 31 namespace print_dialog_cloud { 32 33 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 34 35 // Creates a print dialog to print a file on disk. 36 // Called on the FILE or UI thread. Even though this may start up a modal 37 // dialog, it will return immediately. The dialog is handled asynchronously. 38 // If non-NULL, |modal_parent| specifies a window that the print dialog is modal 39 // to. 40 void CreatePrintDialogForFile(content::BrowserContext* browser_context, 41 gfx::NativeWindow modal_parent, 42 const base::FilePath& path_to_file, 43 const base::string16& print_job_title, 44 const base::string16& print_ticket, 45 const std::string& file_type, 46 bool delete_on_close); 47 48 // Creates a print dialog to print data in RAM. 49 // Called on the FILE or UI thread. Even though this may start up a modal 50 // dialog, it will return immediately. The dialog is handled asynchronously. 51 // If non-NULL, |modal_parent| specifies a window that the print dialog is modal 52 // to. 53 void CreatePrintDialogForBytes(content::BrowserContext* browser_context, 54 gfx::NativeWindow modal_parent, 55 const base::RefCountedMemory* data, 56 const base::string16& print_job_title, 57 const base::string16& print_ticket, 58 const std::string& file_type); 59 60 // Parse switches from command_line and display the print dialog as appropriate. 61 bool CreatePrintDialogFromCommandLine(Profile* profile, 62 const CommandLine& command_line); 63 64 // Creates a dialog for signing into cloud print. 65 // The dialog will call |callback| when complete. 66 // Called on the UI thread. Even though this starts up a modal 67 // dialog, it will return immediately. The dialog is handled asynchronously. 68 // If non-NULL, |modal_parent| specifies a window that the print dialog is modal 69 // to. 70 void CreateCloudPrintSigninDialog(content::BrowserContext* browser_context, 71 gfx::NativeWindow modal_parent, 72 const base::Closure& callback); 73 74 } // namespace print_dialog_cloud 75 76 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_ 77