| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PROCESS_MANAGER_H_ | 5 #ifndef EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ |
| 6 #define EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ | 6 #define EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 public: | 49 public: |
| 50 using ExtensionHostSet = std::set<extensions::ExtensionHost*>; | 50 using ExtensionHostSet = std::set<extensions::ExtensionHost*>; |
| 51 | 51 |
| 52 static ProcessManager* Get(content::BrowserContext* context); | 52 static ProcessManager* Get(content::BrowserContext* context); |
| 53 ~ProcessManager() override; | 53 ~ProcessManager() override; |
| 54 | 54 |
| 55 void RegisterRenderFrameHost(content::WebContents* web_contents, | 55 void RegisterRenderFrameHost(content::WebContents* web_contents, |
| 56 content::RenderFrameHost* render_frame_host, | 56 content::RenderFrameHost* render_frame_host, |
| 57 const Extension* extension); | 57 const Extension* extension); |
| 58 void UnregisterRenderFrameHost(content::RenderFrameHost* render_frame_host); | 58 void UnregisterRenderFrameHost(content::RenderFrameHost* render_frame_host); |
| 59 void DidNavigateRenderFrameHost(content::RenderFrameHost* render_frame_host); |
| 59 | 60 |
| 60 // Returns the SiteInstance that the given URL belongs to. | 61 // Returns the SiteInstance that the given URL belongs to. |
| 61 // TODO(aa): This only returns correct results for extensions and packaged | 62 // TODO(aa): This only returns correct results for extensions and packaged |
| 62 // apps, not hosted apps. | 63 // apps, not hosted apps. |
| 63 virtual scoped_refptr<content::SiteInstance> GetSiteInstanceForURL( | 64 virtual scoped_refptr<content::SiteInstance> GetSiteInstanceForURL( |
| 64 const GURL& url); | 65 const GURL& url); |
| 65 | 66 |
| 66 using FrameSet = std::set<content::RenderFrameHost*>; | 67 using FrameSet = std::set<content::RenderFrameHost*>; |
| 67 const FrameSet GetAllFrames() const; | 68 const FrameSet GetAllFrames() const; |
| 68 | 69 |
| 69 // Returns all RenderFrameHosts that are registered for the specified | 70 // Returns all RenderFrameHosts that are registered for the specified |
| 70 // extension. | 71 // extension. |
| 71 ProcessManager::FrameSet GetRenderFrameHostsForExtension( | 72 ProcessManager::FrameSet GetRenderFrameHostsForExtension( |
| 72 const std::string& extension_id); | 73 const std::string& extension_id); |
| 73 | 74 |
| 75 bool IsRenderFrameHostRegistered(content::RenderFrameHost* render_frame_host); |
| 76 |
| 74 void AddObserver(ProcessManagerObserver* observer); | 77 void AddObserver(ProcessManagerObserver* observer); |
| 75 void RemoveObserver(ProcessManagerObserver* observer); | 78 void RemoveObserver(ProcessManagerObserver* observer); |
| 76 | 79 |
| 77 // Creates a new UI-less extension instance. Like CreateViewHost, but not | 80 // Creates a new UI-less extension instance. Like CreateViewHost, but not |
| 78 // displayed anywhere. Returns false if no background host can be created, | 81 // displayed anywhere. Returns false if no background host can be created, |
| 79 // for example for hosted apps and extensions that aren't enabled in | 82 // for example for hosted apps and extensions that aren't enabled in |
| 80 // Incognito. | 83 // Incognito. |
| 81 virtual bool CreateBackgroundHost(const Extension* extension, | 84 virtual bool CreateBackgroundHost(const Extension* extension, |
| 82 const GURL& url); | 85 const GURL& url); |
| 83 | 86 |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 326 |
| 324 // Must be last member, see doc on WeakPtrFactory. | 327 // Must be last member, see doc on WeakPtrFactory. |
| 325 base::WeakPtrFactory<ProcessManager> weak_ptr_factory_; | 328 base::WeakPtrFactory<ProcessManager> weak_ptr_factory_; |
| 326 | 329 |
| 327 DISALLOW_COPY_AND_ASSIGN(ProcessManager); | 330 DISALLOW_COPY_AND_ASSIGN(ProcessManager); |
| 328 }; | 331 }; |
| 329 | 332 |
| 330 } // namespace extensions | 333 } // namespace extensions |
| 331 | 334 |
| 332 #endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ | 335 #endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ |
| OLD | NEW |