| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // Returns NULL if no preview tab exists for |tab|. | 53 // Returns NULL if no preview tab exists for |tab|. |
| 54 TabContentsWrapper* GetPrintPreviewForTab(TabContentsWrapper* tab) const; | 54 TabContentsWrapper* GetPrintPreviewForTab(TabContentsWrapper* tab) const; |
| 55 | 55 |
| 56 // Returns initiator tab for |preview_tab|. | 56 // Returns initiator tab for |preview_tab|. |
| 57 // Returns NULL if no initiator tab exists for |preview_tab|. | 57 // Returns NULL if no initiator tab exists for |preview_tab|. |
| 58 TabContentsWrapper* GetInitiatorTab(TabContentsWrapper* preview_tab); | 58 TabContentsWrapper* GetInitiatorTab(TabContentsWrapper* preview_tab); |
| 59 | 59 |
| 60 // content::NotificationObserver implementation. | 60 // content::NotificationObserver implementation. |
| 61 virtual void Observe(int type, | 61 virtual void Observe(int type, |
| 62 const content::NotificationSource& source, | 62 const content::NotificationSource& source, |
| 63 const content::NotificationDetails& details); | 63 const content::NotificationDetails& details) OVERRIDE; |
| 64 | 64 |
| 65 // Returns true if |tab| is a print preview tab. | 65 // Returns true if |tab| is a print preview tab. |
| 66 static bool IsPrintPreviewTab(TabContentsWrapper* tab); | 66 static bool IsPrintPreviewTab(TabContentsWrapper* tab); |
| 67 | 67 |
| 68 // Returns true if |url| is a print preview url. | 68 // Returns true if |url| is a print preview url. |
| 69 static bool IsPrintPreviewURL(const GURL& url); | 69 static bool IsPrintPreviewURL(const GURL& url); |
| 70 | 70 |
| 71 // Erase the initiator tab info associated with |preview_tab|. | 71 // Erase the initiator tab info associated with |preview_tab|. |
| 72 void EraseInitiatorTabInfo(TabContentsWrapper* preview_tab); | 72 void EraseInitiatorTabInfo(TabContentsWrapper* preview_tab); |
| 73 | 73 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // Whether the PrintPreviewTabController is in the middle of creating a | 122 // Whether the PrintPreviewTabController is in the middle of creating a |
| 123 // print preview tab. | 123 // print preview tab. |
| 124 bool is_creating_print_preview_tab_; | 124 bool is_creating_print_preview_tab_; |
| 125 | 125 |
| 126 DISALLOW_COPY_AND_ASSIGN(PrintPreviewTabController); | 126 DISALLOW_COPY_AND_ASSIGN(PrintPreviewTabController); |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 } // namespace printing | 129 } // namespace printing |
| 130 | 130 |
| 131 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TAB_CONTROLLER_H_ | 131 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TAB_CONTROLLER_H_ |
| OLD | NEW |