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_preview_dialog_controller.h" | 5 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( | 395 WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( |
396 WebContents* initiator_tab) { | 396 WebContents* initiator_tab) { |
397 base::AutoReset<bool> auto_reset(&is_creating_print_preview_dialog_, true); | 397 base::AutoReset<bool> auto_reset(&is_creating_print_preview_dialog_, true); |
398 Profile* profile = | 398 Profile* profile = |
399 Profile::FromBrowserContext(initiator_tab->GetBrowserContext()); | 399 Profile::FromBrowserContext(initiator_tab->GetBrowserContext()); |
400 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame)) { | 400 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame)) { |
401 // Chrome Frame only ever runs on the native desktop, so it is safe to | 401 // Chrome Frame only ever runs on the native desktop, so it is safe to |
402 // create the popup on the native desktop. | 402 // create the popup on the native desktop. |
403 Browser* current_browser = new Browser( | 403 Browser* current_browser = new Browser( |
404 Browser::CreateParams(Browser::TYPE_POPUP, profile, | 404 Browser::CreateParams(Browser::TYPE_POPUP, profile, |
405 chrome::HOST_DESKTOP_TYPE_NATIVE)); | 405 chrome::GetActiveDesktop())); |
406 if (!current_browser) { | 406 if (!current_browser) { |
407 NOTREACHED() << "Failed to create popup browser window"; | 407 NOTREACHED() << "Failed to create popup browser window"; |
408 return NULL; | 408 return NULL; |
409 } | 409 } |
410 } | 410 } |
411 | 411 |
412 // |web_dialog_ui_delegate| deletes itself in | 412 // |web_dialog_ui_delegate| deletes itself in |
413 // PrintPreviewDialogDelegate::OnDialogClosed(). | 413 // PrintPreviewDialogDelegate::OnDialogClosed(). |
414 WebDialogDelegate* web_dialog_delegate = | 414 WebDialogDelegate* web_dialog_delegate = |
415 new PrintPreviewDialogDelegate(initiator_tab); | 415 new PrintPreviewDialogDelegate(initiator_tab); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 PrintPreviewUI* print_preview_ui = | 513 PrintPreviewUI* print_preview_ui = |
514 static_cast<PrintPreviewUI*>(preview_dialog->GetWebUI()->GetController()); | 514 static_cast<PrintPreviewUI*>(preview_dialog->GetWebUI()->GetController()); |
515 if (print_preview_ui) | 515 if (print_preview_ui) |
516 print_preview_ui->OnPrintPreviewDialogDestroyed(); | 516 print_preview_ui->OnPrintPreviewDialogDestroyed(); |
517 | 517 |
518 preview_dialog_map_.erase(preview_dialog); | 518 preview_dialog_map_.erase(preview_dialog); |
519 RemoveObservers(preview_dialog); | 519 RemoveObservers(preview_dialog); |
520 } | 520 } |
521 | 521 |
522 } // namespace printing | 522 } // namespace printing |
OLD | NEW |