| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 // Helper function to store the initiator tab(title and url) information | 98 // Helper function to store the initiator tab(title and url) information |
| 99 // in PrintPreviewUI. | 99 // in PrintPreviewUI. |
| 100 void SetInitiatorTabURLAndTitle(TabContents* preview_tab); | 100 void SetInitiatorTabURLAndTitle(TabContents* preview_tab); |
| 101 | 101 |
| 102 // Adds/Removes observers for notifications from |tab|. | 102 // Adds/Removes observers for notifications from |tab|. |
| 103 void AddObservers(TabContents* tab); | 103 void AddObservers(TabContents* tab); |
| 104 void RemoveObservers(TabContents* tab); | 104 void RemoveObservers(TabContents* tab); |
| 105 | 105 |
| 106 // Removes tabs when they close/crash/navigate. | 106 // Removes tabs when they close/crash/navigate. |
| 107 void RemoveInitiatorTab(TabContents* initiator_tab, bool is_navigation); | 107 void RemoveInitiatorTab(TabContents* initiator_tab); |
| 108 void RemovePreviewTab(TabContents* preview_tab); | 108 void RemovePreviewTab(TabContents* preview_tab); |
| 109 | 109 |
| 110 // Mapping between print preview tab and the corresponding initiator tab. | 110 // Mapping between print preview tab and the corresponding initiator tab. |
| 111 PrintPreviewTabMap preview_tab_map_; | 111 PrintPreviewTabMap preview_tab_map_; |
| 112 | 112 |
| 113 // A registrar for listening notifications. | 113 // A registrar for listening notifications. |
| 114 content::NotificationRegistrar registrar_; | 114 content::NotificationRegistrar registrar_; |
| 115 | 115 |
| 116 // True if the controller is waiting for a new preview tab via | 116 // True if the controller is waiting for a new preview tab via |
| 117 // content::NAVIGATION_TYPE_NEW_PAGE. | 117 // content::NAVIGATION_TYPE_NEW_PAGE. |
| 118 bool waiting_for_new_preview_page_; | 118 bool waiting_for_new_preview_page_; |
| 119 | 119 |
| 120 // Whether the PrintPreviewTabController is in the middle of creating a | 120 // Whether the PrintPreviewTabController is in the middle of creating a |
| 121 // print preview tab. | 121 // print preview tab. |
| 122 bool is_creating_print_preview_tab_; | 122 bool is_creating_print_preview_tab_; |
| 123 | 123 |
| 124 DISALLOW_COPY_AND_ASSIGN(PrintPreviewTabController); | 124 DISALLOW_COPY_AND_ASSIGN(PrintPreviewTabController); |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 } // namespace printing | 127 } // namespace printing |
| 128 | 128 |
| 129 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TAB_CONTROLLER_H_ | 129 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TAB_CONTROLLER_H_ |
| OLD | NEW |