OLD | NEW |
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 |
11 #include "base/auto_reset.h" | 11 #include "base/auto_reset.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
15 #include "chrome/browser/chrome_notification_types.h" | 15 #include "chrome/browser/chrome_notification_types.h" |
16 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 16 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
17 #include "chrome/browser/printing/print_view_manager.h" | 17 #include "chrome/browser/printing/print_view_manager.h" |
18 #include "chrome/browser/task_management/web_contents_tags.h" | 18 #include "chrome/browser/task_management/web_contents_tags.h" |
19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
20 #include "chrome/browser/ui/browser_finder.h" | 20 #include "chrome/browser/ui/browser_finder.h" |
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" | |
24 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" | 23 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h" |
25 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" | 24 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" |
26 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" | 25 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" |
27 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
28 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
29 #include "components/guest_view/browser/guest_view_base.h" | 28 #include "components/guest_view/browser/guest_view_base.h" |
30 #include "components/web_modal/web_contents_modal_dialog_host.h" | 29 #include "components/web_modal/web_contents_modal_dialog_host.h" |
31 #include "content/public/browser/host_zoom_map.h" | 30 #include "content/public/browser/host_zoom_map.h" |
32 #include "content/public/browser/navigation_controller.h" | 31 #include "content/public/browser/navigation_controller.h" |
33 #include "content/public/browser/navigation_details.h" | 32 #include "content/public/browser/navigation_details.h" |
34 #include "content/public/browser/navigation_entry.h" | 33 #include "content/public/browser/navigation_entry.h" |
35 #include "content/public/browser/notification_details.h" | 34 #include "content/public/browser/notification_details.h" |
36 #include "content/public/browser/notification_source.h" | 35 #include "content/public/browser/notification_source.h" |
37 #include "content/public/browser/render_view_host.h" | 36 #include "content/public/browser/render_view_host.h" |
38 #include "content/public/browser/web_contents.h" | 37 #include "content/public/browser/web_contents.h" |
39 #include "content/public/browser/web_contents_delegate.h" | 38 #include "content/public/browser/web_contents_delegate.h" |
| 39 #include "ui/gfx/host_desktop_type.h" |
40 #include "ui/web_dialogs/web_dialog_delegate.h" | 40 #include "ui/web_dialogs/web_dialog_delegate.h" |
41 | 41 |
42 using content::NavigationController; | 42 using content::NavigationController; |
43 using content::WebContents; | 43 using content::WebContents; |
44 using content::WebUIMessageHandler; | 44 using content::WebUIMessageHandler; |
45 | 45 |
46 namespace { | 46 namespace { |
47 | 47 |
48 // A ui::WebDialogDelegate that specifies the print preview dialog appearance. | 48 // A ui::WebDialogDelegate that specifies the print preview dialog appearance. |
49 class PrintPreviewDialogDelegate : public ui::WebDialogDelegate { | 49 class PrintPreviewDialogDelegate : public ui::WebDialogDelegate { |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 static_cast<PrintPreviewUI*>(web_ui->GetController()); | 479 static_cast<PrintPreviewUI*>(web_ui->GetController()); |
480 if (print_preview_ui) | 480 if (print_preview_ui) |
481 print_preview_ui->OnPrintPreviewDialogDestroyed(); | 481 print_preview_ui->OnPrintPreviewDialogDestroyed(); |
482 } | 482 } |
483 | 483 |
484 preview_dialog_map_.erase(preview_dialog); | 484 preview_dialog_map_.erase(preview_dialog); |
485 RemoveObservers(preview_dialog); | 485 RemoveObservers(preview_dialog); |
486 } | 486 } |
487 | 487 |
488 } // namespace printing | 488 } // namespace printing |
OLD | NEW |