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 Browser;
     17 class Profile;
     18 
     19 namespace base {
     20 class CommandLine;
     21 class FilePath;
     22 }
     23 
     24 namespace content {
     25 class BrowserContext;
     26 }
     27 
     28 namespace user_prefs {
     29 class PrefRegistrySyncable;
     30 }
     31 
     32 namespace print_dialog_cloud {
     33 
     34 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
     35 
     36 // Creates a print dialog to print a file on disk.
     37 // Called on the FILE or UI thread. Even though this may start up a modal
     38 // dialog, it will return immediately. The dialog is handled asynchronously.
     39 // If non-NULL, |modal_parent| specifies a window that the print dialog is modal
     40 // to.
     41 void CreatePrintDialogForFile(content::BrowserContext* browser_context,
     42                               gfx::NativeWindow modal_parent,
     43                               const base::FilePath& path_to_file,
     44                               const base::string16& print_job_title,
     45                               const base::string16& print_ticket,
     46                               const std::string& file_type);
     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 base::CommandLine& command_line);
     63 
     64 // Creates a tab with Google 'sign in' or 'add account' page, based on
     65 // passed |add_account| value.
     66 // Calls |callback| when complete.
     67 void CreateCloudPrintSigninTab(Browser* browser,
     68                                bool add_account,
     69                                const base::Closure& callback);
     70 
     71 }  // namespace print_dialog_cloud
     72 
     73 #endif  // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_
     74