| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_EXTENSION_WEB_CONTENTS_OBSERVER_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_WEB_CONTENTS_OBSERVER_H_ |
| 6 #define EXTENSIONS_BROWSER_EXTENSION_WEB_CONTENTS_OBSERVER_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_WEB_CONTENTS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 explicit ExtensionWebContentsObserver(content::WebContents* web_contents); | 33 explicit ExtensionWebContentsObserver(content::WebContents* web_contents); |
| 34 ~ExtensionWebContentsObserver() override; | 34 ~ExtensionWebContentsObserver() override; |
| 35 | 35 |
| 36 content::BrowserContext* browser_context() { return browser_context_; } | 36 content::BrowserContext* browser_context() { return browser_context_; } |
| 37 | 37 |
| 38 // content::WebContentsObserver overrides. | 38 // content::WebContentsObserver overrides. |
| 39 | 39 |
| 40 // A subclass should invoke this method to finish extension process setup. | 40 // A subclass should invoke this method to finish extension process setup. |
| 41 void RenderViewCreated(content::RenderViewHost* render_view_host) override; | 41 void RenderViewCreated(content::RenderViewHost* render_view_host) override; |
| 42 | 42 |
| 43 void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; |
| 44 |
| 43 // Returns the extension or app associated with a render view host. Returns | 45 // Returns the extension or app associated with a render view host. Returns |
| 44 // NULL if the render view host is not for a valid extension. | 46 // NULL if the render view host is not for a valid extension. |
| 45 const Extension* GetExtension(content::RenderViewHost* render_view_host); | 47 const Extension* GetExtension(content::RenderViewHost* render_view_host); |
| 46 | 48 |
| 47 // Updates ViewType for RenderViewHost based on GetViewType(web_contents()). | 49 // Updates ViewType for RenderViewHost based on GetViewType(web_contents()). |
| 48 void NotifyRenderViewType(content::RenderViewHost* render_view_host); | 50 void NotifyRenderViewType(content::RenderViewHost* render_view_host); |
| 49 | 51 |
| 50 // Returns the extension or app ID associated with a render view host. Returns | 52 // Returns the extension or app ID associated with a render view host. Returns |
| 51 // the empty string if the render view host is not for a valid extension. | 53 // the empty string if the render view host is not for a valid extension. |
| 52 static std::string GetExtensionId(content::RenderViewHost* render_view_host); | 54 static std::string GetExtensionId(content::RenderViewHost* render_view_host); |
| 53 | 55 |
| 54 private: | 56 private: |
| 55 // The BrowserContext associated with the WebContents being observed. | 57 // The BrowserContext associated with the WebContents being observed. |
| 56 content::BrowserContext* browser_context_; | 58 content::BrowserContext* browser_context_; |
| 57 | 59 |
| 58 DISALLOW_COPY_AND_ASSIGN(ExtensionWebContentsObserver); | 60 DISALLOW_COPY_AND_ASSIGN(ExtensionWebContentsObserver); |
| 59 }; | 61 }; |
| 60 | 62 |
| 61 } // namespace extensions | 63 } // namespace extensions |
| 62 | 64 |
| 63 #endif // EXTENSIONS_BROWSER_EXTENSION_WEB_CONTENTS_OBSERVER_H_ | 65 #endif // EXTENSIONS_BROWSER_EXTENSION_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |