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

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

Issue 881553003: Ignore the default zoom level for the PDF extension and print preview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
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 10 matching lines...) Expand all
21 #include "chrome/browser/ui/browser_navigator.h" 21 #include "chrome/browser/ui/browser_navigator.h"
22 #include "chrome/browser/ui/browser_window.h" 22 #include "chrome/browser/ui/browser_window.h"
23 #include "chrome/browser/ui/host_desktop.h" 23 #include "chrome/browser/ui/host_desktop.h"
24 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" 24 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h"
25 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" 25 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h"
26 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" 26 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
27 #include "chrome/common/chrome_content_client.h" 27 #include "chrome/common/chrome_content_client.h"
28 #include "chrome/common/chrome_paths.h" 28 #include "chrome/common/chrome_paths.h"
29 #include "chrome/common/url_constants.h" 29 #include "chrome/common/url_constants.h"
30 #include "components/web_modal/web_contents_modal_dialog_host.h" 30 #include "components/web_modal/web_contents_modal_dialog_host.h"
31 #include "content/public/browser/host_zoom_map.h"
31 #include "content/public/browser/navigation_controller.h" 32 #include "content/public/browser/navigation_controller.h"
32 #include "content/public/browser/navigation_details.h" 33 #include "content/public/browser/navigation_details.h"
33 #include "content/public/browser/navigation_entry.h" 34 #include "content/public/browser/navigation_entry.h"
34 #include "content/public/browser/notification_details.h" 35 #include "content/public/browser/notification_details.h"
35 #include "content/public/browser/notification_source.h" 36 #include "content/public/browser/notification_source.h"
36 #include "content/public/browser/plugin_service.h" 37 #include "content/public/browser/plugin_service.h"
37 #include "content/public/browser/render_frame_host.h" 38 #include "content/public/browser/render_frame_host.h"
38 #include "content/public/browser/render_process_host.h" 39 #include "content/public/browser/render_process_host.h"
39 #include "content/public/browser/render_view_host.h" 40 #include "content/public/browser/render_view_host.h"
40 #include "content/public/browser/web_contents.h" 41 #include "content/public/browser/web_contents.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 WebContents* initiator) { 378 WebContents* initiator) {
378 base::AutoReset<bool> auto_reset(&is_creating_print_preview_dialog_, true); 379 base::AutoReset<bool> auto_reset(&is_creating_print_preview_dialog_, true);
379 380
380 // The dialog delegates are deleted when the dialog is closed. 381 // The dialog delegates are deleted when the dialog is closed.
381 ConstrainedWebDialogDelegate* web_dialog_delegate = 382 ConstrainedWebDialogDelegate* web_dialog_delegate =
382 ShowConstrainedWebDialog(initiator->GetBrowserContext(), 383 ShowConstrainedWebDialog(initiator->GetBrowserContext(),
383 new PrintPreviewDialogDelegate(initiator), 384 new PrintPreviewDialogDelegate(initiator),
384 initiator); 385 initiator);
385 386
386 WebContents* preview_dialog = web_dialog_delegate->GetWebContents(); 387 WebContents* preview_dialog = web_dialog_delegate->GetWebContents();
388 GURL print_url(chrome::kChromeUIPrintURL);
389 content::HostZoomMap::Get(preview_dialog->GetSiteInstance())
390 ->SetZoomLevelForHostAndScheme(print_url.scheme(), print_url.host(), 0);
387 EnableInternalPDFPluginForContents(preview_dialog); 391 EnableInternalPDFPluginForContents(preview_dialog);
388 PrintViewManager::CreateForWebContents(preview_dialog); 392 PrintViewManager::CreateForWebContents(preview_dialog);
389 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( 393 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents(
390 preview_dialog); 394 preview_dialog);
391 395
392 // Add an entry to the map. 396 // Add an entry to the map.
393 preview_dialog_map_[preview_dialog] = initiator; 397 preview_dialog_map_[preview_dialog] = initiator;
394 waiting_for_new_preview_page_ = true; 398 waiting_for_new_preview_page_ = true;
395 399
396 AddObservers(initiator); 400 AddObservers(initiator);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 static_cast<PrintPreviewUI*>(web_ui->GetController()); 485 static_cast<PrintPreviewUI*>(web_ui->GetController());
482 if (print_preview_ui) 486 if (print_preview_ui)
483 print_preview_ui->OnPrintPreviewDialogDestroyed(); 487 print_preview_ui->OnPrintPreviewDialogDestroyed();
484 } 488 }
485 489
486 preview_dialog_map_.erase(preview_dialog); 490 preview_dialog_map_.erase(preview_dialog);
487 RemoveObservers(preview_dialog); 491 RemoveObservers(preview_dialog);
488 } 492 }
489 493
490 } // namespace printing 494 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698