Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(742)

Unified Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.h

Issue 2804793002: Print Preview: Fix failure to save with long page title (Closed)
Patch Set: Remove unused line Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/print_preview/print_preview_handler.h
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.h b/chrome/browser/ui/webui/print_preview/print_preview_handler.h
index fcfc22f2c8709f88fb58a0d926c45f146ea77ea5..8da4f1c4b641f2453569d33b04495b461774e556 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.h
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.h
@@ -105,6 +105,18 @@ class PrintPreviewHandler
// Sets |pdf_file_saved_closure_| to |closure|.
void SetPdfSavedClosureForTesting(const base::Closure& closure);
+ protected:
+ // If |prompt_user| is true, displays a modal dialog, prompting the user to
+ // select a file. Otherwise, just accept |default_path| and uniquify it.
+ // Protected so unit tests can access.
+ virtual void SelectFile(const base::FilePath& default_path, bool prompt_user);
+
+ // Handles printing to PDF. Protected to expose to unit tests.
+ void PrintToPdf();
+
+ // The underlying dialog object. Protected to expose to unit tests.
+ scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
+
private:
friend class PrintPreviewPdfGeneratedBrowserTest;
FRIEND_TEST_ALL_PREFIXES(PrintPreviewPdfGeneratedBrowserTest,
@@ -237,9 +249,6 @@ class PrintPreviewHandler
// Send the PDF data to the cloud to print.
void SendCloudPrintJob(const base::RefCountedBytes* data);
- // Handles printing to PDF.
- void PrintToPdf();
-
// Gets the initiator for the print preview dialog.
content::WebContents* GetInitiator() const;
@@ -261,10 +270,6 @@ class PrintPreviewHandler
bool GetPreviewDataAndTitle(scoped_refptr<base::RefCountedBytes>* data,
base::string16* title) const;
- // If |prompt_user| is true, displays a modal dialog, prompting the user to
- // select a file. Otherwise, just accept |default_path| and uniquify it.
- void SelectFile(const base::FilePath& default_path, bool prompt_user);
-
// Helper for getting a unique file name for SelectFile() without prompting
// the user. Just an adaptor for FileSelected().
void OnGotUniqueFileName(const base::FilePath& path);
@@ -344,9 +349,6 @@ class PrintPreviewHandler
void RegisterForGaiaCookieChanges();
void UnregisterForGaiaCookieChanges();
- // The underlying dialog object.
- scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
-
// A count of how many requests received to regenerate preview data.
// Initialized to 0 then incremented and emitted to a histogram.
int regenerate_preview_request_count_;
« no previous file with comments | « no previous file | chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698