Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/webui/print_preview_handler.h" | 5 #include "chrome/browser/ui/webui/print_preview_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #if !defined(OS_CHROMEOS) | 10 #if !defined(OS_CHROMEOS) |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 907 void PrintPreviewHandler::FileSelectionCanceled(void* params) { | 907 void PrintPreviewHandler::FileSelectionCanceled(void* params) { |
| 908 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(web_ui_); | 908 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(web_ui_); |
| 909 print_preview_ui->OnFileSelectionCancelled(); | 909 print_preview_ui->OnFileSelectionCancelled(); |
| 910 } | 910 } |
| 911 | 911 |
| 912 void PrintPreviewHandler::HidePreviewTab() { | 912 void PrintPreviewHandler::HidePreviewTab() { |
| 913 TabContentsWrapper* preview_tab_wrapper = | 913 TabContentsWrapper* preview_tab_wrapper = |
| 914 TabContentsWrapper::GetCurrentWrapperForContents(preview_tab()); | 914 TabContentsWrapper::GetCurrentWrapperForContents(preview_tab()); |
| 915 if (GetBackgroundPrintingManager()->HasTabContents(preview_tab_wrapper)) | 915 if (GetBackgroundPrintingManager()->HasTabContents(preview_tab_wrapper)) |
| 916 return; | 916 return; |
| 917 GetBackgroundPrintingManager()->OwnTabContents(preview_tab_wrapper); | 917 GetBackgroundPrintingManager()->OwnPreviewTabContents(preview_tab_wrapper); |
| 918 } | 918 } |
| 919 | 919 |
| 920 void PrintPreviewHandler::ClearInitiatorTabDetails() { | 920 void PrintPreviewHandler::ClearInitiatorTabDetails() { |
| 921 TabContents* initiator_tab = GetInitiatorTab(); | 921 TabContents* initiator_tab = GetInitiatorTab(); |
| 922 if (!initiator_tab) | 922 if (!initiator_tab) |
| 923 return; | 923 return; |
| 924 | 924 |
| 925 // We no longer require the initiator tab details. Remove those details | 925 // We no longer require the initiator tab details. Remove those details |
| 926 // associated with the preview tab to allow the initiator tab to create | 926 // associated with the preview tab to allow the initiator tab to create |
| 927 // another preview tab. | 927 // another preview tab. |
| 928 printing::PrintPreviewTabController* tab_controller = | 928 printing::PrintPreviewTabController* tab_controller = |
| 929 printing::PrintPreviewTabController::GetInstance(); | 929 printing::PrintPreviewTabController::GetInstance(); |
| 930 if (tab_controller) | 930 if (tab_controller) { |
| 931 TabContentsWrapper* initiator_wrapper = | |
| 932 TabContentsWrapper::GetCurrentWrapperForContents(initiator_tab); | |
| 931 tab_controller->EraseInitiatorTabInfo(preview_tab()); | 933 tab_controller->EraseInitiatorTabInfo(preview_tab()); |
| 934 g_browser_process->background_printing_manager()-> | |
|
Lei Zhang
2011/08/26 10:01:54
GetBackgroundPrintingManager() is ever so slightly
Sheridan Rawlins
2011/08/26 23:45:39
Done.
| |
| 935 ReleaseInitiatorTabContents(initiator_wrapper); | |
| 936 } | |
| 932 } | 937 } |
| OLD | NEW |