| 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 // For print preview, a print preview (PP) tab is linked with the initiator tab | 5 // For print preview, a print preview (PP) tab is linked with the initiator tab |
| 6 // that initiated the printing operation. If the tab initiates a second | 6 // that initiated the printing operation. If the tab initiates a second |
| 7 // printing operation while the first print preview tab is still open, that PP | 7 // printing operation while the first print preview tab is still open, that PP |
| 8 // tab is focused/activated. There may be more than one PP tab open. There is a | 8 // tab is focused/activated. There may be more than one PP tab open. There is a |
| 9 // 1:1 relationship between PP tabs and initiating tabs. This class manages PP | 9 // 1:1 relationship between PP tabs and initiating tabs. This class manages PP |
| 10 // tabs and initiator tabs. | 10 // tabs and initiator tabs. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // Returns preview tab for |tab|. | 46 // Returns preview tab for |tab|. |
| 47 // Returns |tab| if |tab| is a preview tab. | 47 // Returns |tab| if |tab| is a preview tab. |
| 48 // Returns NULL if no preview tab exists for |tab|. | 48 // Returns NULL if no preview tab exists for |tab|. |
| 49 TabContents* GetPrintPreviewForTab(TabContents* tab) const; | 49 TabContents* GetPrintPreviewForTab(TabContents* tab) const; |
| 50 | 50 |
| 51 // Returns initiator tab for |preview_tab|. | 51 // Returns initiator tab for |preview_tab|. |
| 52 // Returns NULL if no initiator tab exists for |preview_tab|. | 52 // Returns NULL if no initiator tab exists for |preview_tab|. |
| 53 TabContents* GetInitiatorTab(TabContents* preview_tab); | 53 TabContents* GetInitiatorTab(TabContents* preview_tab); |
| 54 | 54 |
| 55 // Notification observer implementation. | 55 // Notification observer implementation. |
| 56 virtual void Observe(NotificationType type, | 56 virtual void Observe(int type, |
| 57 const NotificationSource& source, | 57 const NotificationSource& source, |
| 58 const NotificationDetails& details); | 58 const NotificationDetails& details); |
| 59 | 59 |
| 60 // Returns true if |tab| is a print preview tab. | 60 // Returns true if |tab| is a print preview tab. |
| 61 static bool IsPrintPreviewTab(TabContents* tab); | 61 static bool IsPrintPreviewTab(TabContents* tab); |
| 62 | 62 |
| 63 // Erase the initiator tab info associated with |preview_tab|. | 63 // Erase the initiator tab info associated with |preview_tab|. |
| 64 void EraseInitiatorTabInfo(TabContents* preview_tab); | 64 void EraseInitiatorTabInfo(TabContents* preview_tab); |
| 65 | 65 |
| 66 private: | 66 private: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 86 // True if the controller is waiting for a new preview tab via | 86 // True if the controller is waiting for a new preview tab via |
| 87 // NavigationType::NEW_PAGE. | 87 // NavigationType::NEW_PAGE. |
| 88 bool waiting_for_new_preview_page_; | 88 bool waiting_for_new_preview_page_; |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(PrintPreviewTabController); | 90 DISALLOW_COPY_AND_ASSIGN(PrintPreviewTabController); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace printing | 93 } // namespace printing |
| 94 | 94 |
| 95 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TAB_CONTROLLER_H_ | 95 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TAB_CONTROLLER_H_ |
| OLD | NEW |