| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_PREVIEW_TAB_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TAB_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TAB_CONTROLLER_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TAB_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // Get/Create the print preview tab for |initiator_tab|. | 36 // Get/Create the print preview tab for |initiator_tab|. |
| 37 // |browser_window_id| is the browser window containing |initiator_tab|. | 37 // |browser_window_id| is the browser window containing |initiator_tab|. |
| 38 TabContents* GetOrCreatePreviewTab( | 38 TabContents* GetOrCreatePreviewTab( |
| 39 TabContents* initiator_tab, int browser_window_id); | 39 TabContents* initiator_tab, int browser_window_id); |
| 40 | 40 |
| 41 // Notification observer implementation. | 41 // Notification observer implementation. |
| 42 virtual void Observe(NotificationType type, | 42 virtual void Observe(NotificationType type, |
| 43 const NotificationSource& source, | 43 const NotificationSource& source, |
| 44 const NotificationDetails& details); | 44 const NotificationDetails& details); |
| 45 | 45 |
| 46 // Returns true if |tab| is a print preview tab. |
| 47 static bool IsPrintPreviewTab(TabContents* tab); |
| 48 |
| 46 private: | 49 private: |
| 47 friend class base::RefCounted<PrintPreviewTabController>; | 50 friend class base::RefCounted<PrintPreviewTabController>; |
| 48 | 51 |
| 49 // Returns true if |tab| is a print preview tab. | |
| 50 bool IsPrintPreviewTab(TabContents* tab); | |
| 51 | |
| 52 // Returns initiator tab for |preview_tab|. | 52 // Returns initiator tab for |preview_tab|. |
| 53 // Returns NULL if no initiator tab exists for |preview_tab|. | 53 // Returns NULL if no initiator tab exists for |preview_tab|. |
| 54 TabContents* GetInitiatorTab(TabContents* preview_tab); | 54 TabContents* GetInitiatorTab(TabContents* preview_tab); |
| 55 | 55 |
| 56 // Returns preview tab for |tab|. | 56 // Returns preview tab for |tab|. |
| 57 // Returns |tab| if |tab| is a preview tab. | 57 // Returns |tab| if |tab| is a preview tab. |
| 58 // Returns NULL if no preview tab exists for |tab|. | 58 // Returns NULL if no preview tab exists for |tab|. |
| 59 TabContents* GetPrintPreviewForTab(TabContents* tab); | 59 TabContents* GetPrintPreviewForTab(TabContents* tab); |
| 60 | 60 |
| 61 // Creates a new print preview tab. | 61 // Creates a new print preview tab. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 78 // True if the controller is waiting for a new preview tab via | 78 // True if the controller is waiting for a new preview tab via |
| 79 // NavigationType::NEW_PAGE. | 79 // NavigationType::NEW_PAGE. |
| 80 bool waiting_for_new_preview_page_; | 80 bool waiting_for_new_preview_page_; |
| 81 | 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(PrintPreviewTabController); | 82 DISALLOW_COPY_AND_ASSIGN(PrintPreviewTabController); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace printing | 85 } // namespace printing |
| 86 | 86 |
| 87 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TAB_CONTROLLER_H_ | 87 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TAB_CONTROLLER_H_ |
| OLD | NEW |