| 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 #include "chrome/browser/printing/print_view_manager.h" | 5 #include "chrome/browser/printing/print_view_manager.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 if (rfh != print_preview_rfh_) | 213 if (rfh != print_preview_rfh_) |
| 214 return; | 214 return; |
| 215 | 215 |
| 216 PrintPreviewDialogController* dialog_controller = | 216 PrintPreviewDialogController* dialog_controller = |
| 217 PrintPreviewDialogController::GetInstance(); | 217 PrintPreviewDialogController::GetInstance(); |
| 218 if (!dialog_controller) { | 218 if (!dialog_controller) { |
| 219 PrintPreviewDone(); | 219 PrintPreviewDone(); |
| 220 return; | 220 return; |
| 221 } | 221 } |
| 222 | 222 |
| 223 // Running a dialog causes an exit to webpage-initiated fullscreen. |
| 224 // http://crbug.com/728276 |
| 225 if (web_contents()->IsFullscreenForCurrentTab()) |
| 226 web_contents()->ExitFullscreen(true); |
| 227 |
| 223 dialog_controller->PrintPreview(web_contents()); | 228 dialog_controller->PrintPreview(web_contents()); |
| 224 PrintHostMsg_RequestPrintPreview_Params params; | 229 PrintHostMsg_RequestPrintPreview_Params params; |
| 225 params.is_modifiable = source_is_modifiable; | 230 params.is_modifiable = source_is_modifiable; |
| 226 PrintPreviewUI::SetInitialParams( | 231 PrintPreviewUI::SetInitialParams( |
| 227 dialog_controller->GetPrintPreviewForContents(web_contents()), params); | 232 dialog_controller->GetPrintPreviewForContents(web_contents()), params); |
| 228 } | 233 } |
| 229 | 234 |
| 230 void PrintViewManager::OnScriptedPrintPreviewReply(IPC::Message* reply_msg) { | 235 void PrintViewManager::OnScriptedPrintPreviewReply(IPC::Message* reply_msg) { |
| 231 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 236 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 232 print_preview_rfh_->Send(reply_msg); | 237 print_preview_rfh_->Send(reply_msg); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 243 IPC_MESSAGE_HANDLER(PrintHostMsg_ShowScriptedPrintPreview, | 248 IPC_MESSAGE_HANDLER(PrintHostMsg_ShowScriptedPrintPreview, |
| 244 OnShowScriptedPrintPreview) | 249 OnShowScriptedPrintPreview) |
| 245 IPC_MESSAGE_UNHANDLED(handled = false) | 250 IPC_MESSAGE_UNHANDLED(handled = false) |
| 246 IPC_END_MESSAGE_MAP() | 251 IPC_END_MESSAGE_MAP() |
| 247 | 252 |
| 248 return handled || | 253 return handled || |
| 249 PrintViewManagerBase::OnMessageReceived(message, render_frame_host); | 254 PrintViewManagerBase::OnMessageReceived(message, render_frame_host); |
| 250 } | 255 } |
| 251 | 256 |
| 252 } // namespace printing | 257 } // namespace printing |
| OLD | NEW |