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