Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: chrome/browser/ui/webui/print_preview_handler.cc

Issue 7574002: Be able to print items that do window.print(); window.close() (airline tix e.g.) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 void PrintPreviewHandler::FileSelectionCanceled(void* params) { 871 void PrintPreviewHandler::FileSelectionCanceled(void* params) {
872 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(web_ui_); 872 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(web_ui_);
873 print_preview_ui->OnFileSelectionCancelled(); 873 print_preview_ui->OnFileSelectionCancelled();
874 } 874 }
875 875
876 void PrintPreviewHandler::HidePreviewTab() { 876 void PrintPreviewHandler::HidePreviewTab() {
877 TabContentsWrapper* preview_tab_wrapper = 877 TabContentsWrapper* preview_tab_wrapper =
878 TabContentsWrapper::GetCurrentWrapperForContents(preview_tab()); 878 TabContentsWrapper::GetCurrentWrapperForContents(preview_tab());
879 if (GetBackgroundPrintingManager()->HasTabContents(preview_tab_wrapper)) 879 if (GetBackgroundPrintingManager()->HasTabContents(preview_tab_wrapper))
880 return; 880 return;
881 GetBackgroundPrintingManager()->OwnTabContents(preview_tab_wrapper); 881 GetBackgroundPrintingManager()->OwnPreviewTabContents(preview_tab_wrapper);
882 } 882 }
883 883
884 void PrintPreviewHandler::ClearInitiatorTabDetails() { 884 void PrintPreviewHandler::ClearInitiatorTabDetails() {
885 TabContents* initiator_tab = GetInitiatorTab(); 885 TabContents* initiator_tab = GetInitiatorTab();
886 if (!initiator_tab) 886 if (!initiator_tab)
887 return; 887 return;
888 888
889 // We no longer require the initiator tab details. Remove those details 889 // We no longer require the initiator tab details. Remove those details
890 // associated with the preview tab to allow the initiator tab to create 890 // associated with the preview tab to allow the initiator tab to create
891 // another preview tab. 891 // another preview tab.
892 printing::PrintPreviewTabController* tab_controller = 892 printing::PrintPreviewTabController* tab_controller =
893 printing::PrintPreviewTabController::GetInstance(); 893 printing::PrintPreviewTabController::GetInstance();
894 if (tab_controller) 894 if (tab_controller) {
895 TabContentsWrapper* initiator_wrapper =
896 TabContentsWrapper::GetCurrentWrapperForContents(initiator_tab);
895 tab_controller->EraseInitiatorTabInfo(preview_tab()); 897 tab_controller->EraseInitiatorTabInfo(preview_tab());
898 g_browser_process->background_printing_manager()->
899 ReleaseInitiatorTabContents(initiator_wrapper);
900 }
896 } 901 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698