Home | History | Annotate | Download | only in printing
      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 
     18 namespace base {
     19 class FilePath;
     20 }
     21 
     22 namespace content {
     23 class BrowserContext;
     24 }
     25 
     26 namespace user_prefs {
     27 class PrefRegistrySyncable;
     28 }
     29 
     30 namespace print_dialog_cloud {
     31 
     32 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
     33 
     34 // Creates a print dialog to print a file on disk.
     35 // Called on the FILE or UI thread. Even though this may start up a modal
     36 // dialog, it will return immediately. The dialog is handled asynchronously.
     37 // If non-NULL, |modal_parent| specifies a window that the print dialog is modal
     38 // to.
     39 void CreatePrintDialogForFile(content::BrowserContext* browser_context,
     40                               gfx::NativeWindow modal_parent,
     41                               const base::FilePath& path_to_file,
     42                               const string16& print_job_title,
     43                               const string16& print_ticket,
     44                               const std::string& file_type,
     45                               bool delete_on_close);
     46 
     47 // Creates a print dialog to print data in RAM.
     48 // Called on the FILE or UI thread. Even though this may start up a modal
     49 // dialog, it will return immediately. The dialog is handled asynchronously.
     50 // If non-NULL, |modal_parent| specifies a window that the print dialog is modal
     51 // to.
     52 void CreatePrintDialogForBytes(content::BrowserContext* browser_context,
     53                                gfx::NativeWindow modal_parent,
     54                                const base::RefCountedMemory* data,
     55                                const string16& print_job_title,
     56                                const string16& print_ticket,
     57                                const std::string& file_type);
     58 
     59 // Parse switches from command_line and display the print dialog as appropriate.
     60 // Uses the default profile.
     61 bool CreatePrintDialogFromCommandLine(const CommandLine& command_line);
     62 
     63 // Creates a dialog for signing into cloud print.
     64 // The dialog will call |callback| when complete.
     65 // Called on the UI thread. Even though this starts up a modal
     66 // dialog, it will return immediately. The dialog is handled asynchronously.
     67 // If non-NULL, |modal_parent| specifies a window that the print dialog is modal
     68 // to.
     69 void CreateCloudPrintSigninDialog(content::BrowserContext* browser_context,
     70                                   gfx::NativeWindow modal_parent,
     71                                   const base::Closure& callback);
     72 
     73 }  // end namespace
     74 
     75 #endif  // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_
     76