| 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 527 |
| 528 void PrintPreviewTabController::RemovePreviewTab( | 528 void PrintPreviewTabController::RemovePreviewTab( |
| 529 TabContentsWrapper* preview_tab) { | 529 TabContentsWrapper* preview_tab) { |
| 530 // Remove the initiator tab's observers before erasing the mapping. | 530 // Remove the initiator tab's observers before erasing the mapping. |
| 531 TabContentsWrapper* initiator_tab = GetInitiatorTab(preview_tab); | 531 TabContentsWrapper* initiator_tab = GetInitiatorTab(preview_tab); |
| 532 if (initiator_tab) { | 532 if (initiator_tab) { |
| 533 RemoveObservers(initiator_tab); | 533 RemoveObservers(initiator_tab); |
| 534 initiator_tab->print_view_manager()->PrintPreviewDone(); | 534 initiator_tab->print_view_manager()->PrintPreviewDone(); |
| 535 } | 535 } |
| 536 | 536 |
| 537 // Print preview TabContents is destroyed. Notify |PrintPreviewUI| to abort | 537 // Print preview WebContents is destroyed. Notify |PrintPreviewUI| to abort |
| 538 // the initiator tab preview request. | 538 // the initiator tab preview request. |
| 539 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( | 539 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( |
| 540 preview_tab->web_contents()->GetWebUI()->GetController()); | 540 preview_tab->web_contents()->GetWebUI()->GetController()); |
| 541 if (print_preview_ui) | 541 if (print_preview_ui) |
| 542 print_preview_ui->OnTabDestroyed(); | 542 print_preview_ui->OnTabDestroyed(); |
| 543 | 543 |
| 544 preview_tab_map_.erase(preview_tab); | 544 preview_tab_map_.erase(preview_tab); |
| 545 RemoveObservers(preview_tab); | 545 RemoveObservers(preview_tab); |
| 546 } | 546 } |
| 547 | 547 |
| 548 } // namespace printing | 548 } // namespace printing |
| OLD | NEW |