| 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 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "content/public/browser/render_view_host_observer.h" | 10 #include "content/public/browser/render_view_host_observer.h" |
| 9 | 11 |
| 10 class Profile; | 12 class Profile; |
| 13 class SkBitmap; |
| 11 | 14 |
| 12 namespace chrome_browser_net { | 15 namespace chrome_browser_net { |
| 13 class Predictor; | 16 class Predictor; |
| 14 } | 17 } |
| 15 | 18 |
| 16 namespace extensions { | 19 namespace extensions { |
| 17 class Extension; | 20 class Extension; |
| 18 } | 21 } |
| 19 | 22 |
| 20 // This class holds the Chrome specific parts of RenderViewHost, and has the | 23 // This class holds the Chrome specific parts of RenderViewHost, and has the |
| 21 // same lifetime. | 24 // same lifetime. |
| 22 class ChromeRenderViewHostObserver : public content::RenderViewHostObserver { | 25 class ChromeRenderViewHostObserver : public content::RenderViewHostObserver { |
| 23 public: | 26 public: |
| 24 ChromeRenderViewHostObserver(content::RenderViewHost* render_view_host, | 27 ChromeRenderViewHostObserver(content::RenderViewHost* render_view_host, |
| 25 chrome_browser_net::Predictor* predictor); | 28 chrome_browser_net::Predictor* predictor); |
| 26 virtual ~ChromeRenderViewHostObserver(); | 29 virtual ~ChromeRenderViewHostObserver(); |
| 27 | 30 |
| 28 // content::RenderViewHostObserver overrides. | 31 // content::RenderViewHostObserver overrides. |
| 29 virtual void RenderViewHostInitialized() OVERRIDE; | 32 virtual void RenderViewHostInitialized() OVERRIDE; |
| 30 virtual void RenderViewHostDestroyed(content::RenderViewHost* rvh) OVERRIDE; | 33 virtual void RenderViewHostDestroyed(content::RenderViewHost* rvh) OVERRIDE; |
| 31 virtual void Navigate(const GURL& url) OVERRIDE; | 34 virtual void Navigate(const GURL& url) OVERRIDE; |
| 32 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 35 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 33 | 36 |
| 34 private: | 37 private: |
| 35 // Does extension-specific initialization when a new renderer process is | 38 // Does extension-specific initialization when a new renderer process is |
| 36 // created by a RenderViewHost. | 39 // created by a RenderViewHost. |
| 37 void InitRenderViewForExtensions(); | 40 void InitRenderViewForExtensions(); |
| 38 // Gets the extension or app (if any) that is associated with the RVH. | 41 // Gets the extension or app (if any) that is associated with the RVH. |
| 39 const extensions::Extension* GetExtension(); | 42 const extensions::Extension* GetExtension(); |
| 40 // Cleans up when a RenderViewHost is removed, or on destruction. | 43 // Cleans up when a RenderViewHost is removed, or on destruction. |
| 41 void RemoveRenderViewHostForExtensions(content::RenderViewHost* rvh); | 44 void RemoveRenderViewHostForExtensions(content::RenderViewHost* rvh); |
| 45 |
| 42 void OnFocusedNodeTouched(bool editable); | 46 void OnFocusedNodeTouched(bool editable); |
| 43 | 47 |
| 48 void OnRequestThumbnailForContextNodeACK(const SkBitmap& bitmap); |
| 49 |
| 44 Profile* profile_; | 50 Profile* profile_; |
| 45 chrome_browser_net::Predictor* predictor_; | 51 chrome_browser_net::Predictor* predictor_; |
| 46 | 52 |
| 47 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewHostObserver); | 53 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewHostObserver); |
| 48 }; | 54 }; |
| 49 | 55 |
| 50 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_VIEW_HOST_OBSERVER_H_ | 56 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RENDER_VIEW_HOST_OBSERVER_H_ |
| OLD | NEW |