| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_RENDERER_CHROME_MOCK_RENDER_THREAD_H_ | 5 #ifndef CHROME_RENDERER_CHROME_MOCK_RENDER_THREAD_H_ |
| 6 #define CHROME_RENDERER_CHROME_MOCK_RENDER_THREAD_H_ | 6 #define CHROME_RENDERER_CHROME_MOCK_RENDER_THREAD_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // Extends content::MockRenderThread to know about printing and | 26 // Extends content::MockRenderThread to know about printing and |
| 27 // extension messages. | 27 // extension messages. |
| 28 class ChromeMockRenderThread : public content::MockRenderThread { | 28 class ChromeMockRenderThread : public content::MockRenderThread { |
| 29 public: | 29 public: |
| 30 ChromeMockRenderThread(); | 30 ChromeMockRenderThread(); |
| 31 virtual ~ChromeMockRenderThread(); | 31 virtual ~ChromeMockRenderThread(); |
| 32 | 32 |
| 33 // content::RenderThread overrides. | 33 // content::RenderThread overrides. |
| 34 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() | 34 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() |
| 35 OVERRIDE; | 35 override; |
| 36 | 36 |
| 37 ////////////////////////////////////////////////////////////////////////// | 37 ////////////////////////////////////////////////////////////////////////// |
| 38 // The following functions are called by the test itself. | 38 // The following functions are called by the test itself. |
| 39 | 39 |
| 40 // Set IO message loop proxy. | 40 // Set IO message loop proxy. |
| 41 void set_io_message_loop_proxy( | 41 void set_io_message_loop_proxy( |
| 42 const scoped_refptr<base::MessageLoopProxy>& proxy); | 42 const scoped_refptr<base::MessageLoopProxy>& proxy); |
| 43 | 43 |
| 44 #if defined(ENABLE_PRINTING) | 44 #if defined(ENABLE_PRINTING) |
| 45 // Returns the pseudo-printer instance. | 45 // Returns the pseudo-printer instance. |
| 46 MockPrinter* printer(); | 46 MockPrinter* printer(); |
| 47 | 47 |
| 48 // Call with |response| set to true if the user wants to print. | 48 // Call with |response| set to true if the user wants to print. |
| 49 // False if the user decides to cancel. | 49 // False if the user decides to cancel. |
| 50 void set_print_dialog_user_response(bool response); | 50 void set_print_dialog_user_response(bool response); |
| 51 | 51 |
| 52 // Cancel print preview when print preview has |page| remaining pages. | 52 // Cancel print preview when print preview has |page| remaining pages. |
| 53 void set_print_preview_cancel_page_number(int page); | 53 void set_print_preview_cancel_page_number(int page); |
| 54 | 54 |
| 55 // Get the number of pages to generate for print preview. | 55 // Get the number of pages to generate for print preview. |
| 56 int print_preview_pages_remaining() const; | 56 int print_preview_pages_remaining() const; |
| 57 #endif | 57 #endif |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // Overrides base class implementation to add custom handling for | 60 // Overrides base class implementation to add custom handling for |
| 61 // print and extensions. | 61 // print and extensions. |
| 62 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 62 virtual bool OnMessageReceived(const IPC::Message& msg) override; |
| 63 | 63 |
| 64 // The callee expects to be returned a valid channel_id. | 64 // The callee expects to be returned a valid channel_id. |
| 65 void OnOpenChannelToExtension(int routing_id, | 65 void OnOpenChannelToExtension(int routing_id, |
| 66 const ExtensionMsg_ExternalConnectionInfo& info, | 66 const ExtensionMsg_ExternalConnectionInfo& info, |
| 67 const std::string& channel_name, | 67 const std::string& channel_name, |
| 68 bool include_tls_channel_id, | 68 bool include_tls_channel_id, |
| 69 int* port_id); | 69 int* port_id); |
| 70 | 70 |
| 71 #if defined(ENABLE_PRINTING) | 71 #if defined(ENABLE_PRINTING) |
| 72 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) | 72 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // Number of pages to generate for print preview. | 112 // Number of pages to generate for print preview. |
| 113 int print_preview_pages_remaining_; | 113 int print_preview_pages_remaining_; |
| 114 #endif | 114 #endif |
| 115 | 115 |
| 116 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 116 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
| 117 | 117 |
| 118 DISALLOW_COPY_AND_ASSIGN(ChromeMockRenderThread); | 118 DISALLOW_COPY_AND_ASSIGN(ChromeMockRenderThread); |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 #endif // CHROME_RENDERER_CHROME_MOCK_RENDER_THREAD_H_ | 121 #endif // CHROME_RENDERER_CHROME_MOCK_RENDER_THREAD_H_ |
| OLD | NEW |