| 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 #ifndef CONTENT_SHELL_SHELL_RENDER_PROCESS_OBSERVER_H_ | 5 #ifndef CONTENT_SHELL_SHELL_RENDER_PROCESS_OBSERVER_H_ |
| 6 #define CONTENT_SHELL_SHELL_RENDER_PROCESS_OBSERVER_H_ | 6 #define CONTENT_SHELL_SHELL_RENDER_PROCESS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "content/public/renderer/render_process_observer.h" | 12 #include "content/public/renderer/render_process_observer.h" |
| 13 #include "ipc/ipc_platform_file.h" | 13 #include "ipc/ipc_platform_file.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 class WebFrame; | 16 class WebFrame; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace WebTestRunner { | |
| 20 class WebTestDelegate; | |
| 21 class WebTestInterfaces; | |
| 22 } | |
| 23 | |
| 24 namespace content { | 19 namespace content { |
| 25 | 20 |
| 26 class RenderView; | 21 class RenderView; |
| 27 class WebKitTestRunner; | 22 class WebKitTestRunner; |
| 23 class WebTestDelegate; |
| 24 class WebTestInterfaces; |
| 28 | 25 |
| 29 class ShellRenderProcessObserver : public RenderProcessObserver { | 26 class ShellRenderProcessObserver : public RenderProcessObserver { |
| 30 public: | 27 public: |
| 31 static ShellRenderProcessObserver* GetInstance(); | 28 static ShellRenderProcessObserver* GetInstance(); |
| 32 | 29 |
| 33 ShellRenderProcessObserver(); | 30 ShellRenderProcessObserver(); |
| 34 virtual ~ShellRenderProcessObserver(); | 31 virtual ~ShellRenderProcessObserver(); |
| 35 | 32 |
| 36 void SetTestDelegate(WebTestRunner::WebTestDelegate* delegate); | 33 void SetTestDelegate(WebTestDelegate* delegate); |
| 37 void SetMainWindow(RenderView* view); | 34 void SetMainWindow(RenderView* view); |
| 38 | 35 |
| 39 // RenderProcessObserver implementation. | 36 // RenderProcessObserver implementation. |
| 40 virtual void WebKitInitialized() OVERRIDE; | 37 virtual void WebKitInitialized() OVERRIDE; |
| 41 virtual void OnRenderProcessShutdown() OVERRIDE; | 38 virtual void OnRenderProcessShutdown() OVERRIDE; |
| 42 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | 39 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
| 43 | 40 |
| 44 WebTestRunner::WebTestDelegate* test_delegate() const { | 41 WebTestDelegate* test_delegate() const { |
| 45 return test_delegate_; | 42 return test_delegate_; |
| 46 } | 43 } |
| 47 WebTestRunner::WebTestInterfaces* test_interfaces() const { | 44 WebTestInterfaces* test_interfaces() const { |
| 48 return test_interfaces_.get(); | 45 return test_interfaces_.get(); |
| 49 } | 46 } |
| 50 WebKitTestRunner* main_test_runner() const { return main_test_runner_; } | 47 WebKitTestRunner* main_test_runner() const { return main_test_runner_; } |
| 51 const base::FilePath& webkit_source_dir() const { return webkit_source_dir_; } | 48 const base::FilePath& webkit_source_dir() const { return webkit_source_dir_; } |
| 52 | 49 |
| 53 private: | 50 private: |
| 54 // Message handlers. | 51 // Message handlers. |
| 55 void OnResetAll(); | 52 void OnResetAll(); |
| 56 void OnSetWebKitSourceDir(const base::FilePath& webkit_source_dir); | 53 void OnSetWebKitSourceDir(const base::FilePath& webkit_source_dir); |
| 57 | 54 |
| 58 WebKitTestRunner* main_test_runner_; | 55 WebKitTestRunner* main_test_runner_; |
| 59 WebTestRunner::WebTestDelegate* test_delegate_; | 56 WebTestDelegate* test_delegate_; |
| 60 scoped_ptr<WebTestRunner::WebTestInterfaces> test_interfaces_; | 57 scoped_ptr<WebTestInterfaces> test_interfaces_; |
| 61 | 58 |
| 62 base::FilePath webkit_source_dir_; | 59 base::FilePath webkit_source_dir_; |
| 63 | 60 |
| 64 DISALLOW_COPY_AND_ASSIGN(ShellRenderProcessObserver); | 61 DISALLOW_COPY_AND_ASSIGN(ShellRenderProcessObserver); |
| 65 }; | 62 }; |
| 66 | 63 |
| 67 } // namespace content | 64 } // namespace content |
| 68 | 65 |
| 69 #endif // CONTENT_SHELL_SHELL_RENDER_PROCESS_OBSERVER_H_ | 66 #endif // CONTENT_SHELL_SHELL_RENDER_PROCESS_OBSERVER_H_ |
| OLD | NEW |