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_tab_controller.h" | 5 #include "chrome/browser/printing/print_preview_tab_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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 RemoveInitiatorTab(tab, true); | 415 RemoveInitiatorTab(tab, true); |
416 } | 416 } |
417 | 417 |
418 TabContents* PrintPreviewTabController::CreatePrintPreviewTab( | 418 TabContents* PrintPreviewTabController::CreatePrintPreviewTab( |
419 TabContents* initiator_tab) { | 419 TabContents* initiator_tab) { |
420 AutoReset<bool> auto_reset(&is_creating_print_preview_tab_, true); | 420 AutoReset<bool> auto_reset(&is_creating_print_preview_tab_, true); |
421 WebContents* web_contents = initiator_tab->web_contents(); | 421 WebContents* web_contents = initiator_tab->web_contents(); |
422 Profile* profile = | 422 Profile* profile = |
423 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 423 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
424 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame)) { | 424 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame)) { |
425 Browser* current_browser = Browser::CreateWithParams( | 425 Browser* current_browser = new Browser( |
426 Browser::CreateParams(Browser::TYPE_POPUP, profile)); | 426 Browser::CreateParams(Browser::TYPE_POPUP, profile)); |
427 if (!current_browser) { | 427 if (!current_browser) { |
428 NOTREACHED() << "Failed to create popup browser window"; | 428 NOTREACHED() << "Failed to create popup browser window"; |
429 return NULL; | 429 return NULL; |
430 } | 430 } |
431 } | 431 } |
432 | 432 |
433 // |web_dialog_ui_delegate| deletes itself in | 433 // |web_dialog_ui_delegate| deletes itself in |
434 // PrintPreviewTabDelegate::OnDialogClosed(). | 434 // PrintPreviewTabDelegate::OnDialogClosed(). |
435 WebDialogDelegate* web_dialog_delegate = | 435 WebDialogDelegate* web_dialog_delegate = |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( | 544 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( |
545 preview_tab->web_contents()->GetWebUI()->GetController()); | 545 preview_tab->web_contents()->GetWebUI()->GetController()); |
546 if (print_preview_ui) | 546 if (print_preview_ui) |
547 print_preview_ui->OnTabDestroyed(); | 547 print_preview_ui->OnTabDestroyed(); |
548 | 548 |
549 preview_tab_map_.erase(preview_tab); | 549 preview_tab_map_.erase(preview_tab); |
550 RemoveObservers(preview_tab); | 550 RemoveObservers(preview_tab); |
551 } | 551 } |
552 | 552 |
553 } // namespace printing | 553 } // namespace printing |
OLD | NEW |