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_BROWSER_RENDERER_HOST_CHROME_RENDER_VIEW_HOST_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_VIEW_HOST_OBSERVER_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_VIEW_HOST_OBSERVER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_VIEW_HOST_OBSERVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/browser/renderer_host/render_view_host_observer.h" | 9 #include "content/browser/renderer_host/render_view_host_observer.h" |
10 | 10 |
| 11 class Extension; |
| 12 |
11 // This class holds the Chrome specific parts of RenderViewHost, and has the | 13 // This class holds the Chrome specific parts of RenderViewHost, and has the |
12 // same lifetime. | 14 // same lifetime. |
13 class ChromeRenderViewHostObserver : public RenderViewHostObserver { | 15 class ChromeRenderViewHostObserver : public RenderViewHostObserver { |
14 public: | 16 public: |
15 explicit ChromeRenderViewHostObserver(RenderViewHost* render_view_host); | 17 explicit ChromeRenderViewHostObserver(RenderViewHost* render_view_host); |
16 virtual ~ChromeRenderViewHostObserver(); | 18 virtual ~ChromeRenderViewHostObserver(); |
17 | 19 |
18 // RenderViewHostObserver overrides. | 20 // RenderViewHostObserver overrides. |
| 21 virtual void RenderViewHostInitialized() OVERRIDE; |
19 virtual void Navigate(const ViewMsg_Navigate_Params& params) OVERRIDE; | 22 virtual void Navigate(const ViewMsg_Navigate_Params& params) OVERRIDE; |
20 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 23 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
21 | 24 |
22 private: | 25 private: |
| 26 // Does extension-specific initialization when a new RenderViewHost is |
| 27 // created. |
| 28 void InitRenderViewHostForExtensions(); |
| 29 // Does extension-specific initialization when a new renderer process is |
| 30 // created by a RenderViewHost. |
| 31 void InitRenderViewForExtensions(); |
| 32 // Gets the extension or app (if any) that is associated with the RVH. |
| 33 const Extension* GetExtension(); |
| 34 |
23 void OnDomOperationResponse(const std::string& json_string, | 35 void OnDomOperationResponse(const std::string& json_string, |
24 int automation_id); | 36 int automation_id); |
25 | 37 |
26 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewHostObserver); | 38 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewHostObserver); |
27 }; | 39 }; |
28 | 40 |
29 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_VIEW_HOST_OBSERVER_H_ | 41 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_VIEW_HOST_OBSERVER_H_ |
OLD | NEW |