| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 TabContentsWrapper* PrintPreviewTabController::CreatePrintPreviewTab( | 407 TabContentsWrapper* PrintPreviewTabController::CreatePrintPreviewTab( |
| 408 TabContentsWrapper* initiator_tab) { | 408 TabContentsWrapper* initiator_tab) { |
| 409 AutoReset<bool> auto_reset(&is_creating_print_preview_tab_, true); | 409 AutoReset<bool> auto_reset(&is_creating_print_preview_tab_, true); |
| 410 WebContents* web_contents = initiator_tab->web_contents(); | 410 WebContents* web_contents = initiator_tab->web_contents(); |
| 411 Browser* current_browser = | 411 Browser* current_browser = |
| 412 BrowserList::FindBrowserWithWebContents(web_contents); | 412 BrowserList::FindBrowserWithWebContents(web_contents); |
| 413 if (!current_browser) { | 413 if (!current_browser) { |
| 414 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame)) { | 414 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame)) { |
| 415 Profile* profile = | 415 Profile* profile = |
| 416 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 416 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 417 current_browser = Browser::CreateForType(Browser::TYPE_POPUP, profile); | 417 current_browser = Browser::CreateWithParams( |
| 418 Browser::CreateParams(Browser::TYPE_POPUP, profile)); |
| 418 if (!current_browser) { | 419 if (!current_browser) { |
| 419 NOTREACHED() << "Failed to create popup browser window"; | 420 NOTREACHED() << "Failed to create popup browser window"; |
| 420 return NULL; | 421 return NULL; |
| 421 } | 422 } |
| 422 } else { | 423 } else { |
| 423 return NULL; | 424 return NULL; |
| 424 } | 425 } |
| 425 } | 426 } |
| 426 | 427 |
| 427 // |html_dialog_ui_delegate| deletes itself in | 428 // |html_dialog_ui_delegate| deletes itself in |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( | 539 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( |
| 539 preview_tab->web_contents()->GetWebUI()->GetController()); | 540 preview_tab->web_contents()->GetWebUI()->GetController()); |
| 540 if (print_preview_ui) | 541 if (print_preview_ui) |
| 541 print_preview_ui->OnTabDestroyed(); | 542 print_preview_ui->OnTabDestroyed(); |
| 542 | 543 |
| 543 preview_tab_map_.erase(preview_tab); | 544 preview_tab_map_.erase(preview_tab); |
| 544 RemoveObservers(preview_tab); | 545 RemoveObservers(preview_tab); |
| 545 } | 546 } |
| 546 | 547 |
| 547 } // namespace printing | 548 } // namespace printing |
| OLD | NEW |