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

Side by Side Diff: chrome/browser/printing/print_preview_dialog_controller.cc

Issue 754953002: Enable AutoResize for Constrained Web Dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_dialog_controller.h" 5 #include "chrome/browser/printing/print_preview_dialog_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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 363
364 RemoveInitiator(contents); 364 RemoveInitiator(contents);
365 } 365 }
366 366
367 WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( 367 WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog(
368 WebContents* initiator) { 368 WebContents* initiator) {
369 base::AutoReset<bool> auto_reset(&is_creating_print_preview_dialog_, true); 369 base::AutoReset<bool> auto_reset(&is_creating_print_preview_dialog_, true);
370 370
371 // The dialog delegates are deleted when the dialog is closed. 371 // The dialog delegates are deleted when the dialog is closed.
372 ConstrainedWebDialogDelegate* web_dialog_delegate = 372 ConstrainedWebDialogDelegate* web_dialog_delegate =
373 CreateConstrainedWebDialog(initiator->GetBrowserContext(), 373 ShowConstrainedWebDialog(initiator->GetBrowserContext(),
374 new PrintPreviewDialogDelegate(initiator), 374 new PrintPreviewDialogDelegate(initiator),
375 initiator); 375 initiator);
376 376
377 WebContents* preview_dialog = web_dialog_delegate->GetWebContents(); 377 WebContents* preview_dialog = web_dialog_delegate->GetWebContents();
378 EnableInternalPDFPluginForContents(preview_dialog); 378 EnableInternalPDFPluginForContents(preview_dialog);
379 PrintViewManager::CreateForWebContents(preview_dialog); 379 PrintViewManager::CreateForWebContents(preview_dialog);
380 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( 380 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents(
381 preview_dialog); 381 preview_dialog);
382 382
383 // Add an entry to the map. 383 // Add an entry to the map.
384 preview_dialog_map_[preview_dialog] = initiator; 384 preview_dialog_map_[preview_dialog] = initiator;
385 waiting_for_new_preview_page_ = true; 385 waiting_for_new_preview_page_ = true;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 static_cast<PrintPreviewUI*>(web_ui->GetController()); 472 static_cast<PrintPreviewUI*>(web_ui->GetController());
473 if (print_preview_ui) 473 if (print_preview_ui)
474 print_preview_ui->OnPrintPreviewDialogDestroyed(); 474 print_preview_ui->OnPrintPreviewDialogDestroyed();
475 } 475 }
476 476
477 preview_dialog_map_.erase(preview_dialog); 477 preview_dialog_map_.erase(preview_dialog);
478 RemoveObservers(preview_dialog); 478 RemoveObservers(preview_dialog);
479 } 479 }
480 480
481 } // namespace printing 481 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698