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