Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_VIEW_MANAGER_BASE_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/prefs/pref_member.h" | 9 #include "base/prefs/pref_member.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 | 49 |
| 50 // Helper method for Print*Now(). | 50 // Helper method for Print*Now(). |
| 51 bool PrintNowInternal(IPC::Message* message); | 51 bool PrintNowInternal(IPC::Message* message); |
| 52 | 52 |
| 53 // Terminates or cancels the print job if one was pending. | 53 // Terminates or cancels the print job if one was pending. |
| 54 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 54 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; |
| 55 | 55 |
| 56 // content::WebContentsObserver implementation. | 56 // content::WebContentsObserver implementation. |
| 57 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 57 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 58 | 58 |
| 59 // IPC Message handlers. | |
| 60 virtual void OnPrintingFailed(int cookie); | |
|
whywhat
2013/08/16 23:31:36
Maybe we should instead observe NOTIFICATION_PRINT
Lei Zhang
2013/08/18 09:56:26
I think other people are trying to kill Notificati
| |
| 61 | |
| 59 private: | 62 private: |
| 60 // content::NotificationObserver implementation. | 63 // content::NotificationObserver implementation. |
| 61 virtual void Observe(int type, | 64 virtual void Observe(int type, |
| 62 const content::NotificationSource& source, | 65 const content::NotificationSource& source, |
| 63 const content::NotificationDetails& details) OVERRIDE; | 66 const content::NotificationDetails& details) OVERRIDE; |
| 64 | 67 |
| 65 // content::WebContentsObserver implementation. | 68 // content::WebContentsObserver implementation. |
| 66 virtual void DidStartLoading( | 69 virtual void DidStartLoading( |
| 67 content::RenderViewHost* render_view_host) OVERRIDE; | 70 content::RenderViewHost* render_view_host) OVERRIDE; |
| 68 | 71 |
| 69 // Cancels the print job. | 72 // Cancels the print job. |
| 70 virtual void StopNavigation() OVERRIDE; | 73 virtual void StopNavigation() OVERRIDE; |
| 71 | 74 |
| 72 // IPC Message handlers. | 75 // IPC Message handlers. |
| 73 void OnDidGetPrintedPagesCount(int cookie, int number_pages); | 76 void OnDidGetPrintedPagesCount(int cookie, int number_pages); |
| 74 void OnDidGetDocumentCookie(int cookie); | 77 void OnDidGetDocumentCookie(int cookie); |
| 75 void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params); | 78 void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params); |
| 76 void OnPrintingFailed(int cookie); | |
| 77 | 79 |
| 78 // Processes a NOTIFY_PRINT_JOB_EVENT notification. | 80 // Processes a NOTIFY_PRINT_JOB_EVENT notification. |
| 79 void OnNotifyPrintJobEvent(const JobEventDetails& event_details); | 81 void OnNotifyPrintJobEvent(const JobEventDetails& event_details); |
| 80 | 82 |
| 81 // Requests the RenderView to render all the missing pages for the print job. | 83 // Requests the RenderView to render all the missing pages for the print job. |
| 82 // No-op if no print job is pending. Returns true if at least one page has | 84 // No-op if no print job is pending. Returns true if at least one page has |
| 83 // been requested to the renderer. | 85 // been requested to the renderer. |
| 84 bool RenderAllMissingPagesNow(); | 86 bool RenderAllMissingPagesNow(); |
| 85 | 87 |
| 86 // Quits the current message loop if these conditions hold true: a document is | 88 // Quits the current message loop if these conditions hold true: a document is |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 | 157 |
| 156 // Whether our content is in blocked state. | 158 // Whether our content is in blocked state. |
| 157 bool tab_content_blocked_; | 159 bool tab_content_blocked_; |
| 158 | 160 |
| 159 DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBase); | 161 DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBase); |
| 160 }; | 162 }; |
| 161 | 163 |
| 162 } // namespace printing | 164 } // namespace printing |
| 163 | 165 |
| 164 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ | 166 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ |
| OLD | NEW |