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 namespace chrome_browser_net { | |
12 class Predictor; | |
13 } | |
14 | |
15 class Extension; | 11 class Extension; |
16 | 12 |
17 // 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 |
18 // same lifetime. | 14 // same lifetime. |
19 class ChromeRenderViewHostObserver : public RenderViewHostObserver { | 15 class ChromeRenderViewHostObserver : public RenderViewHostObserver { |
20 public: | 16 public: |
21 ChromeRenderViewHostObserver(RenderViewHost* render_view_host, | 17 explicit ChromeRenderViewHostObserver(RenderViewHost* render_view_host); |
22 chrome_browser_net::Predictor* predictor); | |
23 virtual ~ChromeRenderViewHostObserver(); | 18 virtual ~ChromeRenderViewHostObserver(); |
24 | 19 |
25 // RenderViewHostObserver overrides. | 20 // RenderViewHostObserver overrides. |
26 virtual void RenderViewHostInitialized() OVERRIDE; | 21 virtual void RenderViewHostInitialized() OVERRIDE; |
27 virtual void Navigate(const ViewMsg_Navigate_Params& params) OVERRIDE; | 22 virtual void Navigate(const ViewMsg_Navigate_Params& params) OVERRIDE; |
28 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 23 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
29 | 24 |
30 private: | 25 private: |
31 // Does extension-specific initialization when a new RenderViewHost is | 26 // Does extension-specific initialization when a new RenderViewHost is |
32 // created. | 27 // created. |
33 void InitRenderViewHostForExtensions(); | 28 void InitRenderViewHostForExtensions(); |
34 // Does extension-specific initialization when a new renderer process is | 29 // Does extension-specific initialization when a new renderer process is |
35 // created by a RenderViewHost. | 30 // created by a RenderViewHost. |
36 void InitRenderViewForExtensions(); | 31 void InitRenderViewForExtensions(); |
37 // Gets the extension or app (if any) that is associated with the RVH. | 32 // Gets the extension or app (if any) that is associated with the RVH. |
38 const Extension* GetExtension(); | 33 const Extension* GetExtension(); |
39 | 34 |
40 void OnDomOperationResponse(const std::string& json_string, | 35 void OnDomOperationResponse(const std::string& json_string, |
41 int automation_id); | 36 int automation_id); |
42 | 37 |
43 chrome_browser_net::Predictor* predictor_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewHostObserver); | 38 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewHostObserver); |
46 }; | 39 }; |
47 | 40 |
48 #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 |