| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // Manages the print commands in relation to a TabContents. TabContents | 26 // Manages the print commands in relation to a TabContents. TabContents |
| 27 // delegates a few printing related commands to this instance. | 27 // delegates a few printing related commands to this instance. |
| 28 class PrintViewManager : public NotificationObserver, | 28 class PrintViewManager : public NotificationObserver, |
| 29 public PrintedPagesSource, | 29 public PrintedPagesSource, |
| 30 public TabContentsObserver { | 30 public TabContentsObserver { |
| 31 public: | 31 public: |
| 32 explicit PrintViewManager(TabContents* tab_contents); | 32 explicit PrintViewManager(TabContents* tab_contents); |
| 33 virtual ~PrintViewManager(); | 33 virtual ~PrintViewManager(); |
| 34 | 34 |
| 35 // Override the title for this PrintViewManager's PrintJobs using the title |
| 36 // in |tab_contents|. |
| 37 void OverrideTitle(TabContents* tab_contents); |
| 38 |
| 35 // PrintedPagesSource implementation. | 39 // PrintedPagesSource implementation. |
| 36 virtual string16 RenderSourceName(); | 40 virtual string16 RenderSourceName(); |
| 37 virtual GURL RenderSourceUrl(); | 41 virtual GURL RenderSourceUrl(); |
| 38 | 42 |
| 39 // NotificationObserver implementation. | 43 // NotificationObserver implementation. |
| 40 virtual void Observe(NotificationType type, | 44 virtual void Observe(NotificationType type, |
| 41 const NotificationSource& source, | 45 const NotificationSource& source, |
| 42 const NotificationDetails& details); | 46 const NotificationDetails& details); |
| 43 | 47 |
| 44 // TabContentsObserver implementation. | 48 // TabContentsObserver implementation. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // Running an inner message loop inside RenderAllMissingPagesNow(). This means | 125 // Running an inner message loop inside RenderAllMissingPagesNow(). This means |
| 122 // we are _blocking_ until all the necessary pages have been rendered or the | 126 // we are _blocking_ until all the necessary pages have been rendered or the |
| 123 // print settings are being loaded. | 127 // print settings are being loaded. |
| 124 bool inside_inner_message_loop_; | 128 bool inside_inner_message_loop_; |
| 125 | 129 |
| 126 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 130 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 127 // Set to true when OnDidPrintPage() should be expecting the first page. | 131 // Set to true when OnDidPrintPage() should be expecting the first page. |
| 128 bool expecting_first_page_; | 132 bool expecting_first_page_; |
| 129 #endif | 133 #endif |
| 130 | 134 |
| 135 // Title override. |
| 136 bool is_title_overridden_; |
| 137 string16 overridden_title_; |
| 138 |
| 131 DISALLOW_COPY_AND_ASSIGN(PrintViewManager); | 139 DISALLOW_COPY_AND_ASSIGN(PrintViewManager); |
| 132 }; | 140 }; |
| 133 | 141 |
| 134 } // namespace printing | 142 } // namespace printing |
| 135 | 143 |
| 136 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ | 144 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ |
| OLD | NEW |