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 CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PART_
H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PART_
H_ |
6 #define CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PART_
H_ | 6 #define CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PART_
H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "chrome/browser/chrome_content_browser_client_parts.h" | 10 #include "chrome/browser/chrome_content_browser_client_parts.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 class ResourceContext; | 13 class ResourceContext; |
14 class VpnServiceProxy; | 14 class VpnServiceProxy; |
15 } | 15 } |
16 | 16 |
17 namespace extensions { | 17 namespace extensions { |
18 | 18 |
| 19 class Extension; |
| 20 class InfoMap; |
| 21 |
19 // Implements the extensions portion of ChromeContentBrowserClient. | 22 // Implements the extensions portion of ChromeContentBrowserClient. |
20 class ChromeContentBrowserClientExtensionsPart | 23 class ChromeContentBrowserClientExtensionsPart |
21 : public ChromeContentBrowserClientParts { | 24 : public ChromeContentBrowserClientParts { |
22 public: | 25 public: |
23 ChromeContentBrowserClientExtensionsPart(); | 26 ChromeContentBrowserClientExtensionsPart(); |
24 ~ChromeContentBrowserClientExtensionsPart() override; | 27 ~ChromeContentBrowserClientExtensionsPart() override; |
25 | 28 |
26 // Corresponds to the ChromeContentBrowserClient function of the same name. | 29 // Corresponds to the ChromeContentBrowserClient function of the same name. |
27 static GURL GetEffectiveURL(Profile* profile, const GURL& url); | 30 static GURL GetEffectiveURL(Profile* profile, const GURL& url); |
28 static bool ShouldUseProcessPerSite(Profile* profile, | 31 static bool ShouldUseProcessPerSite(Profile* profile, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 bool* result); | 67 bool* result); |
65 | 68 |
66 // Helper function to call InfoMap::SetSigninProcess(). | 69 // Helper function to call InfoMap::SetSigninProcess(). |
67 static void SetSigninProcess(content::SiteInstance* site_instance); | 70 static void SetSigninProcess(content::SiteInstance* site_instance); |
68 | 71 |
69 // Creates a new VpnServiceProxy. The caller owns the returned value. It's | 72 // Creates a new VpnServiceProxy. The caller owns the returned value. It's |
70 // valid to return nullptr. | 73 // valid to return nullptr. |
71 static std::unique_ptr<content::VpnServiceProxy> GetVpnServiceProxy( | 74 static std::unique_ptr<content::VpnServiceProxy> GetVpnServiceProxy( |
72 content::BrowserContext* browser_context); | 75 content::BrowserContext* browser_context); |
73 | 76 |
| 77 // Updates the ResourceDispatcherHost instance with the extension origin |
| 78 // access information. |
| 79 static void AddExtension(const content::ResourceContext* context, |
| 80 const Extension* extension); |
| 81 |
| 82 // Removes the extension origin access information from the |
| 83 // ResourceDispatcherHost instance. |
| 84 static void RemoveExtension(const content::ResourceContext* context, |
| 85 const std::string& extension_id); |
| 86 |
74 private: | 87 private: |
75 // ChromeContentBrowserClientParts: | 88 // ChromeContentBrowserClientParts: |
76 void RenderProcessWillLaunch(content::RenderProcessHost* host) override; | 89 void RenderProcessWillLaunch(content::RenderProcessHost* host) override; |
77 void SiteInstanceGotProcess(content::SiteInstance* site_instance) override; | 90 void SiteInstanceGotProcess(content::SiteInstance* site_instance) override; |
78 void SiteInstanceDeleting(content::SiteInstance* site_instance) override; | 91 void SiteInstanceDeleting(content::SiteInstance* site_instance) override; |
79 void OverrideWebkitPrefs(content::RenderViewHost* rvh, | 92 void OverrideWebkitPrefs(content::RenderViewHost* rvh, |
80 content::WebPreferences* web_prefs) override; | 93 content::WebPreferences* web_prefs) override; |
81 void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override; | 94 void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override; |
82 void GetAdditionalAllowedSchemesForFileSystem( | 95 void GetAdditionalAllowedSchemesForFileSystem( |
83 std::vector<std::string>* additional_allowed_schemes) override; | 96 std::vector<std::string>* additional_allowed_schemes) override; |
84 void GetURLRequestAutoMountHandlers( | 97 void GetURLRequestAutoMountHandlers( |
85 std::vector<storage::URLRequestAutoMountHandler>* handlers) override; | 98 std::vector<storage::URLRequestAutoMountHandler>* handlers) override; |
86 void GetAdditionalFileSystemBackends( | 99 void GetAdditionalFileSystemBackends( |
87 content::BrowserContext* browser_context, | 100 content::BrowserContext* browser_context, |
88 const base::FilePath& storage_partition_path, | 101 const base::FilePath& storage_partition_path, |
89 ScopedVector<storage::FileSystemBackend>* additional_backends) override; | 102 ScopedVector<storage::FileSystemBackend>* additional_backends) override; |
90 void AppendExtraRendererCommandLineSwitches( | 103 void AppendExtraRendererCommandLineSwitches( |
91 base::CommandLine* command_line, | 104 base::CommandLine* command_line, |
92 content::RenderProcessHost* process, | 105 content::RenderProcessHost* process, |
93 Profile* profile) override; | 106 Profile* profile) override; |
94 | 107 |
| 108 // Helper functions to register and unregister an extension process. Invoked |
| 109 // on the IO thread. |
| 110 static void RegisterExtensionProcessHelper( |
| 111 InfoMap* info_map, |
| 112 const Extension* extension, |
| 113 int process_id, |
| 114 int site_instance_id, |
| 115 const content::ResourceContext* context); |
| 116 |
| 117 static void UnregisterExtensionProcessHelper( |
| 118 InfoMap* info_map, |
| 119 const Extension* extension, |
| 120 int process_id, |
| 121 int site_instance_id, |
| 122 const content::ResourceContext* context); |
| 123 |
95 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientExtensionsPart); | 124 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientExtensionsPart); |
96 }; | 125 }; |
97 | 126 |
98 } // namespace extensions | 127 } // namespace extensions |
99 | 128 |
100 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PA
RT_H_ | 129 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PA
RT_H_ |
101 | 130 |
OLD | NEW |