| 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 IsBackgroundPageAllowed(BrowserContext* context, |
| 50 const Extension* extension) const override { |
| 50 return is_background_page_allowed_; | 51 return is_background_page_allowed_; |
| 51 } | 52 } |
| 52 bool DeferCreatingStartupBackgroundHosts( | 53 bool DeferCreatingStartupBackgroundHosts( |
| 53 BrowserContext* context) const override { | 54 BrowserContext* context) const override { |
| 54 return defer_creating_startup_background_hosts_; | 55 return defer_creating_startup_background_hosts_; |
| 55 } | 56 } |
| 56 | 57 |
| 57 bool is_background_page_allowed_; | 58 bool is_background_page_allowed_; |
| 58 bool defer_creating_startup_background_hosts_; | 59 bool defer_creating_startup_background_hosts_; |
| 59 }; | 60 }; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 scoped_refptr<SiteInstance> site21 = | 239 scoped_refptr<SiteInstance> site21 = |
| 239 manager1->GetSiteInstanceForURL(ext2_url1); | 240 manager1->GetSiteInstanceForURL(ext2_url1); |
| 240 EXPECT_NE(site11, site21); | 241 EXPECT_NE(site11, site21); |
| 241 | 242 |
| 242 scoped_refptr<SiteInstance> other_profile_site = | 243 scoped_refptr<SiteInstance> other_profile_site = |
| 243 manager2->GetSiteInstanceForURL(ext1_url1); | 244 manager2->GetSiteInstanceForURL(ext1_url1); |
| 244 EXPECT_NE(site11, other_profile_site); | 245 EXPECT_NE(site11, other_profile_site); |
| 245 } | 246 } |
| 246 | 247 |
| 247 } // namespace extensions | 248 } // namespace extensions |
| OLD | NEW |