Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: chrome/browser/printing/print_preview_tab_controller.h

Issue 8515017: Print Preview: Properly handle window.print(). (Closed)
Patch Set: fail instead of crash when 2 views both do window.print() Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 // Helper function to store the initiator tab(title and url) information 100 // Helper function to store the initiator tab(title and url) information
101 // in PrintPreviewUI. 101 // in PrintPreviewUI.
102 void SetInitiatorTabURLAndTitle(TabContentsWrapper* preview_tab); 102 void SetInitiatorTabURLAndTitle(TabContentsWrapper* preview_tab);
103 103
104 // Adds/Removes observers for notifications from |tab|. 104 // Adds/Removes observers for notifications from |tab|.
105 void AddObservers(TabContentsWrapper* tab); 105 void AddObservers(TabContentsWrapper* tab);
106 void RemoveObservers(TabContentsWrapper* tab); 106 void RemoveObservers(TabContentsWrapper* tab);
107 107
108 // Removes tabs when they close/crash/navigate. 108 // Removes tabs when they close/crash/navigate.
109 void RemoveInitiatorTab(TabContentsWrapper* initiator_tab); 109 void RemoveInitiatorTab(TabContentsWrapper* initiator_tab,
110 bool is_navigation);
110 void RemovePreviewTab(TabContentsWrapper* preview_tab); 111 void RemovePreviewTab(TabContentsWrapper* preview_tab);
111 112
112 // Mapping between print preview tab and the corresponding initiator tab. 113 // Mapping between print preview tab and the corresponding initiator tab.
113 PrintPreviewTabMap preview_tab_map_; 114 PrintPreviewTabMap preview_tab_map_;
114 115
115 // A registrar for listening notifications. 116 // A registrar for listening notifications.
116 content::NotificationRegistrar registrar_; 117 content::NotificationRegistrar registrar_;
117 118
118 // True if the controller is waiting for a new preview tab via 119 // True if the controller is waiting for a new preview tab via
119 // content::NAVIGATION_TYPE_NEW_PAGE. 120 // content::NAVIGATION_TYPE_NEW_PAGE.
120 bool waiting_for_new_preview_page_; 121 bool waiting_for_new_preview_page_;
121 122
122 // Whether the PrintPreviewTabController is in the middle of creating a 123 // Whether the PrintPreviewTabController is in the middle of creating a
123 // print preview tab. 124 // print preview tab.
124 bool is_creating_print_preview_tab_; 125 bool is_creating_print_preview_tab_;
125 126
126 DISALLOW_COPY_AND_ASSIGN(PrintPreviewTabController); 127 DISALLOW_COPY_AND_ASSIGN(PrintPreviewTabController);
127 }; 128 };
128 129
129 } // namespace printing 130 } // namespace printing
130 131
131 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TAB_CONTROLLER_H_ 132 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_TAB_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_preview_message_handler.cc ('k') | chrome/browser/printing/print_preview_tab_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698