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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 : WebContentsObserver(dialog) { | 51 : WebContentsObserver(dialog) { |
52 } | 52 } |
53 ~RequestPrintPreviewObserver() override {} | 53 ~RequestPrintPreviewObserver() override {} |
54 | 54 |
55 void set_quit_closure(const base::Closure& quit_closure) { | 55 void set_quit_closure(const base::Closure& quit_closure) { |
56 quit_closure_ = quit_closure; | 56 quit_closure_ = quit_closure; |
57 } | 57 } |
58 | 58 |
59 private: | 59 private: |
60 // content::WebContentsObserver implementation. | 60 // content::WebContentsObserver implementation. |
61 bool OnMessageReceived(const IPC::Message& message, | 61 bool OnMessageReceived(const IPC::Message& message) override { |
62 content::RenderFrameHost* render_frame_host) override { | |
63 IPC_BEGIN_MESSAGE_MAP(RequestPrintPreviewObserver, message) | 62 IPC_BEGIN_MESSAGE_MAP(RequestPrintPreviewObserver, message) |
64 IPC_MESSAGE_HANDLER(PrintHostMsg_RequestPrintPreview, | 63 IPC_MESSAGE_HANDLER(PrintHostMsg_RequestPrintPreview, |
65 OnRequestPrintPreview) | 64 OnRequestPrintPreview) |
66 IPC_MESSAGE_UNHANDLED(break) | 65 IPC_MESSAGE_UNHANDLED(break) |
67 IPC_END_MESSAGE_MAP() | 66 IPC_END_MESSAGE_MAP() |
68 return false; // Report not handled so the real handler receives it. | 67 return false; // Report not handled so the real handler receives it. |
69 } | 68 } |
70 | 69 |
71 void OnRequestPrintPreview( | 70 void OnRequestPrintPreview( |
72 const PrintHostMsg_RequestPrintPreview_Params& /* params */) { | 71 const PrintHostMsg_RequestPrintPreview_Params& /* params */) { |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 content::BrowserAccessibilityState::GetInstance()->EnableAccessibility(); | 396 content::BrowserAccessibilityState::GetInstance()->EnableAccessibility(); |
398 ui_test_utils::NavigateToURL(browser(), GURL("data:text/html,HelloWorld")); | 397 ui_test_utils::NavigateToURL(browser(), GURL("data:text/html,HelloWorld")); |
399 PrintPreview(); | 398 PrintPreview(); |
400 WebContents* preview_dialog = GetPrintPreviewDialog(); | 399 WebContents* preview_dialog = GetPrintPreviewDialog(); |
401 WaitForAccessibilityTreeToContainNodeWithName(preview_dialog, "HelloWorld"); | 400 WaitForAccessibilityTreeToContainNodeWithName(preview_dialog, "HelloWorld"); |
402 } | 401 } |
403 | 402 |
404 } // namespace | 403 } // namespace |
405 | 404 |
406 #endif // defined(ENABLE_TASK_MANAGER) | 405 #endif // defined(ENABLE_TASK_MANAGER) |
OLD | NEW |