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 #include "extensions/browser/process_manager.h" | 5 #include "extensions/browser/process_manager.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "content/public/browser/content_browser_client.h" | 8 #include "content/public/browser/content_browser_client.h" |
9 #include "content/public/browser/notification_service.h" | 9 #include "content/public/browser/notification_service.h" |
10 #include "content/public/browser/site_instance.h" | 10 #include "content/public/browser/site_instance.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // A trivial ProcessManagerDelegate. | 40 // A trivial ProcessManagerDelegate. |
41 class TestProcessManagerDelegate : public ProcessManagerDelegate { | 41 class TestProcessManagerDelegate : public ProcessManagerDelegate { |
42 public: | 42 public: |
43 TestProcessManagerDelegate() | 43 TestProcessManagerDelegate() |
44 : is_background_page_allowed_(true), | 44 : is_background_page_allowed_(true), |
45 defer_creating_startup_background_hosts_(false) {} | 45 defer_creating_startup_background_hosts_(false) {} |
46 ~TestProcessManagerDelegate() override {} | 46 ~TestProcessManagerDelegate() override {} |
47 | 47 |
48 // ProcessManagerDelegate implementation. | 48 // ProcessManagerDelegate implementation. |
49 bool IsBackgroundPageAllowed(BrowserContext* context) const override { | 49 bool AreBackgroundPagesAllowedForContext( |
| 50 BrowserContext* context) const override { |
| 51 return is_background_page_allowed_; |
| 52 } |
| 53 bool IsExtensionBackgroundPageAllowed( |
| 54 BrowserContext* context, |
| 55 const Extension& extension) const override { |
50 return is_background_page_allowed_; | 56 return is_background_page_allowed_; |
51 } | 57 } |
52 bool DeferCreatingStartupBackgroundHosts( | 58 bool DeferCreatingStartupBackgroundHosts( |
53 BrowserContext* context) const override { | 59 BrowserContext* context) const override { |
54 return defer_creating_startup_background_hosts_; | 60 return defer_creating_startup_background_hosts_; |
55 } | 61 } |
56 | 62 |
57 bool is_background_page_allowed_; | 63 bool is_background_page_allowed_; |
58 bool defer_creating_startup_background_hosts_; | 64 bool defer_creating_startup_background_hosts_; |
59 }; | 65 }; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 scoped_refptr<SiteInstance> site21 = | 244 scoped_refptr<SiteInstance> site21 = |
239 manager1->GetSiteInstanceForURL(ext2_url1); | 245 manager1->GetSiteInstanceForURL(ext2_url1); |
240 EXPECT_NE(site11, site21); | 246 EXPECT_NE(site11, site21); |
241 | 247 |
242 scoped_refptr<SiteInstance> other_profile_site = | 248 scoped_refptr<SiteInstance> other_profile_site = |
243 manager2->GetSiteInstanceForURL(ext1_url1); | 249 manager2->GetSiteInstanceForURL(ext1_url1); |
244 EXPECT_NE(site11, other_profile_site); | 250 EXPECT_NE(site11, other_profile_site); |
245 } | 251 } |
246 | 252 |
247 } // namespace extensions | 253 } // namespace extensions |
OLD | NEW |