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 { |
| 13 class ResourceContext; |
| 14 } |
| 15 |
12 namespace extensions { | 16 namespace extensions { |
13 | 17 |
14 class BrowserPermissionsPolicyDelegate; | 18 class BrowserPermissionsPolicyDelegate; |
15 | 19 |
16 // Implements the extensions portion of ChromeContentBrowserClient. | 20 // Implements the extensions portion of ChromeContentBrowserClient. |
17 class ChromeContentBrowserClientExtensionsPart | 21 class ChromeContentBrowserClientExtensionsPart |
18 : public ChromeContentBrowserClientParts { | 22 : public ChromeContentBrowserClientParts { |
19 public: | 23 public: |
20 ChromeContentBrowserClientExtensionsPart(); | 24 ChromeContentBrowserClientExtensionsPart(); |
21 virtual ~ChromeContentBrowserClientExtensionsPart(); | 25 virtual ~ChromeContentBrowserClientExtensionsPart(); |
22 | 26 |
| 27 // Corresponds to the ChromeContentBrowserClient function of the same name. |
| 28 static GURL GetEffectiveURL(Profile* profile, const GURL& url); |
| 29 static bool ShouldUseProcessPerSite(Profile* profile, |
| 30 const GURL& effective_url); |
| 31 static bool CanCommitURL(content::RenderProcessHost* process_host, |
| 32 const GURL& url); |
| 33 static bool IsSuitableHost(Profile* profile, |
| 34 content::RenderProcessHost* process_host, |
| 35 const GURL& site_url); |
| 36 static bool ShouldTryToUseExistingProcessHost(Profile* profile, |
| 37 const GURL& url); |
| 38 static bool ShouldSwapBrowsingInstancesForNavigation( |
| 39 content::SiteInstance* site_instance, |
| 40 const GURL& current_url, |
| 41 const GURL& new_url); |
| 42 static bool ShouldSwapProcessesForRedirect( |
| 43 content::ResourceContext* resource_context, |
| 44 const GURL& current_url, |
| 45 const GURL& new_url); |
| 46 static std::string GetWorkerProcessTitle(const GURL& url, |
| 47 content::ResourceContext* context); |
| 48 |
| 49 // Similiar to ChromeContentBrowserClient::ShouldAllowOpenURL(), but the |
| 50 // return value indicates whether to use |result| or not. |
| 51 static bool ShouldAllowOpenURL(content::SiteInstance* site_instance, |
| 52 const GURL& from_url, |
| 53 const GURL& to_url, |
| 54 bool* result); |
| 55 |
| 56 // Helper function to call InfoMap::SetSigninProcess(). |
| 57 static void SetSigninProcess(content::SiteInstance* site_instance); |
| 58 |
23 private: | 59 private: |
24 // ChromeContentBrowserClientParts: | 60 // ChromeContentBrowserClientParts: |
25 virtual void RenderProcessWillLaunch( | 61 virtual void RenderProcessWillLaunch( |
26 content::RenderProcessHost* host) OVERRIDE; | 62 content::RenderProcessHost* host) OVERRIDE; |
27 virtual void SiteInstanceGotProcess( | 63 virtual void SiteInstanceGotProcess( |
28 content::SiteInstance* site_instance) OVERRIDE; | 64 content::SiteInstance* site_instance) OVERRIDE; |
29 virtual void SiteInstanceDeleting( | 65 virtual void SiteInstanceDeleting( |
30 content::SiteInstance* site_instance) OVERRIDE; | 66 content::SiteInstance* site_instance) OVERRIDE; |
31 virtual void WorkerProcessCreated(content::SiteInstance* site_instance, | 67 virtual void WorkerProcessCreated(content::SiteInstance* site_instance, |
32 int worker_process_id) OVERRIDE; | 68 int worker_process_id) OVERRIDE; |
(...skipping 10 matching lines...) Expand all Loading... |
43 std::vector<fileapi::URLRequestAutoMountHandler>* handlers) OVERRIDE; | 79 std::vector<fileapi::URLRequestAutoMountHandler>* handlers) OVERRIDE; |
44 virtual void GetAdditionalFileSystemBackends( | 80 virtual void GetAdditionalFileSystemBackends( |
45 content::BrowserContext* browser_context, | 81 content::BrowserContext* browser_context, |
46 const base::FilePath& storage_partition_path, | 82 const base::FilePath& storage_partition_path, |
47 ScopedVector<fileapi::FileSystemBackend>* additional_backends) OVERRIDE; | 83 ScopedVector<fileapi::FileSystemBackend>* additional_backends) OVERRIDE; |
48 virtual void AppendExtraRendererCommandLineSwitches( | 84 virtual void AppendExtraRendererCommandLineSwitches( |
49 base::CommandLine* command_line, | 85 base::CommandLine* command_line, |
50 content::RenderProcessHost* process, | 86 content::RenderProcessHost* process, |
51 Profile* profile) OVERRIDE; | 87 Profile* profile) OVERRIDE; |
52 | 88 |
| 89 scoped_ptr<BrowserPermissionsPolicyDelegate> permissions_policy_delegate_; |
| 90 |
53 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientExtensionsPart); | 91 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientExtensionsPart); |
54 }; | 92 }; |
55 | 93 |
56 } // namespace extensions | 94 } // namespace extensions |
57 | 95 |
58 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PA
RT_H_ | 96 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PA
RT_H_ |
59 | 97 |
OLD | NEW |