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

Unified Diff: chrome/browser/printing/print_preview_dialog_controller.cc

Issue 2108833002: Remove Simplify Page option from Print Preview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mark histogram entries as unused Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/printing/print_preview_dialog_controller.cc
diff --git a/chrome/browser/printing/print_preview_dialog_controller.cc b/chrome/browser/printing/print_preview_dialog_controller.cc
index 6d91353345ed72778feaa3e7c48a3efc2f73a490..35635e61855c9432880f8c7a5f695ef1024f7361 100644
--- a/chrome/browser/printing/print_preview_dialog_controller.cc
+++ b/chrome/browser/printing/print_preview_dialog_controller.cc
@@ -179,25 +179,16 @@ WebContents* PrintPreviewDialogController::GetOrCreatePreviewDialog(
// Get the print preview dialog for |initiator|.
WebContents* preview_dialog = GetPrintPreviewForContents(initiator);
- if (preview_dialog) {
- // Show the initiator holding the existing preview dialog.
- initiator->GetDelegate()->ActivateContents(initiator);
- return preview_dialog;
- }
-
- // We should only create a dialog if the initiator has not been proxied.
- if (GetProxyDialogTarget(initiator) == initiator)
+ if (!preview_dialog)
return CreatePrintPreviewDialog(initiator);
- return nullptr;
+ // Show the initiator holding the existing preview dialog.
+ initiator->GetDelegate()->ActivateContents(initiator);
+ return preview_dialog;
}
WebContents* PrintPreviewDialogController::GetPrintPreviewForContents(
WebContents* contents) const {
- // If this WebContents relies on another for its preview dialog, we
- // need to act as if we are looking for the proxied content's dialog.
- contents = GetProxyDialogTarget(contents);
-
// |preview_dialog_map_| is keyed by the preview dialog, so if find()
// succeeds, then |contents| is the preview dialog.
PrintPreviewDialogMap::const_iterator it = preview_dialog_map_.find(contents);
@@ -395,24 +386,6 @@ WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog(
return preview_dialog;
}
-void PrintPreviewDialogController::AddProxyDialogForWebContents(
- WebContents* source,
- WebContents* target) {
- proxied_dialog_map_[source] = target;
-}
-
-void PrintPreviewDialogController::RemoveProxyDialogForWebContents(
- WebContents* source) {
- proxied_dialog_map_.erase(source);
-}
-
-WebContents* PrintPreviewDialogController::GetProxyDialogTarget(
- WebContents* source) const {
- PrintPreviewDialogMap::const_iterator proxied =
- proxied_dialog_map_.find(source);
- return proxied == proxied_dialog_map_.end() ? source : proxied->second;
-}
-
void PrintPreviewDialogController::SaveInitiatorTitle(
WebContents* preview_dialog) {
WebContents* initiator = GetInitiator(preview_dialog);

Powered by Google App Engine
This is Rietveld 408576698