| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; | 43 void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; |
| 44 | 44 |
| 45 // Per the documentation in WebContentsObserver, these two methods are | 45 // Per the documentation in WebContentsObserver, these two methods are |
| 46 // appropriate to track the set of current RenderFrameHosts. | 46 // appropriate to track the set of current RenderFrameHosts. |
| 47 // NOTE: FrameDeleted() != RenderFrameDeleted(). | 47 // NOTE: FrameDeleted() != RenderFrameDeleted(). |
| 48 void FrameDeleted(content::RenderFrameHost* render_frame_host) override; | 48 void FrameDeleted(content::RenderFrameHost* render_frame_host) override; |
| 49 void RenderFrameHostChanged(content::RenderFrameHost* old_host, | 49 void RenderFrameHostChanged(content::RenderFrameHost* old_host, |
| 50 content::RenderFrameHost* new_host) override; | 50 content::RenderFrameHost* new_host) override; |
| 51 | 51 |
| 52 // Per the documentation in WebContentsObserver, these two methods are invoked |
| 53 // when a Pepper plugin instance is attached/detached in the page DOM. |
| 54 void PepperInstanceCreated() override; |
| 55 void PepperInstanceDeleted() override; |
| 56 |
| 52 // Returns the extension or app associated with a render view host. Returns | 57 // Returns the extension or app associated with a render view host. Returns |
| 53 // NULL if the render view host is not for a valid extension. | 58 // NULL if the render view host is not for a valid extension. |
| 54 const Extension* GetExtension(content::RenderViewHost* render_view_host); | 59 const Extension* GetExtension(content::RenderViewHost* render_view_host); |
| 55 | 60 |
| 56 // Updates ViewType for RenderViewHost based on GetViewType(web_contents()). | 61 // Updates ViewType for RenderViewHost based on GetViewType(web_contents()). |
| 57 void NotifyRenderViewType(content::RenderViewHost* render_view_host); | 62 void NotifyRenderViewType(content::RenderViewHost* render_view_host); |
| 58 | 63 |
| 59 // Returns the extension or app ID associated with a render view host. Returns | 64 // Returns the extension or app ID associated with a render view host. Returns |
| 60 // the empty string if the render view host is not for a valid extension. | 65 // the empty string if the render view host is not for a valid extension. |
| 61 static std::string GetExtensionId(content::RenderViewHost* render_view_host); | 66 static std::string GetExtensionId(content::RenderViewHost* render_view_host); |
| 62 | 67 |
| 63 private: | 68 private: |
| 64 // The BrowserContext associated with the WebContents being observed. | 69 // The BrowserContext associated with the WebContents being observed. |
| 65 content::BrowserContext* browser_context_; | 70 content::BrowserContext* browser_context_; |
| 66 | 71 |
| 67 DISALLOW_COPY_AND_ASSIGN(ExtensionWebContentsObserver); | 72 DISALLOW_COPY_AND_ASSIGN(ExtensionWebContentsObserver); |
| 68 }; | 73 }; |
| 69 | 74 |
| 70 } // namespace extensions | 75 } // namespace extensions |
| 71 | 76 |
| 72 #endif // EXTENSIONS_BROWSER_EXTENSION_WEB_CONTENTS_OBSERVER_H_ | 77 #endif // EXTENSIONS_BROWSER_EXTENSION_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |