Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 | 59 |
| 60 return render_view_host->GetSiteInstance()->GetSiteURL().host(); | 60 return render_view_host->GetSiteInstance()->GetSiteURL().host(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 // Incognito profiles use this process manager. It is mostly a shim that decides | 63 // Incognito profiles use this process manager. It is mostly a shim that decides |
| 64 // whether to fall back on the original profile's ExtensionProcessManager based | 64 // whether to fall back on the original profile's ExtensionProcessManager based |
| 65 // on whether a given extension uses "split" or "spanning" incognito behavior. | 65 // on whether a given extension uses "split" or "spanning" incognito behavior. |
| 66 class IncognitoExtensionProcessManager : public ExtensionProcessManager { | 66 class IncognitoExtensionProcessManager : public ExtensionProcessManager { |
| 67 public: | 67 public: |
| 68 explicit IncognitoExtensionProcessManager(Profile* profile); | 68 explicit IncognitoExtensionProcessManager(Profile* profile); |
| 69 virtual ~IncognitoExtensionProcessManager() {} | 69 virtual ~IncognitoExtensionProcessManager(); |
| 70 virtual ExtensionHost* CreateViewHost( | 70 virtual ExtensionHost* CreateViewHost( |
| 71 const Extension* extension, | 71 const Extension* extension, |
| 72 const GURL& url, | 72 const GURL& url, |
| 73 Browser* browser, | 73 Browser* browser, |
| 74 chrome::ViewType view_type) OVERRIDE; | 74 chrome::ViewType view_type) OVERRIDE; |
| 75 virtual void CreateBackgroundHost(const Extension* extension, | 75 virtual void CreateBackgroundHost(const Extension* extension, |
| 76 const GURL& url); | 76 const GURL& url); |
| 77 virtual SiteInstance* GetSiteInstanceForURL(const GURL& url); | 77 virtual SiteInstance* GetSiteInstanceForURL(const GURL& url); |
| 78 | 78 |
| 79 private: | 79 private: |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 815 CreateBackgroundHostsForProfileStartup(GetProfile(), | 815 CreateBackgroundHostsForProfileStartup(GetProfile(), |
| 816 this, service->extensions()); | 816 this, service->extensions()); |
| 817 } | 817 } |
| 818 break; | 818 break; |
| 819 } | 819 } |
| 820 default: | 820 default: |
| 821 ExtensionProcessManager::Observe(type, source, details); | 821 ExtensionProcessManager::Observe(type, source, details); |
| 822 break; | 822 break; |
| 823 } | 823 } |
| 824 } | 824 } |
| 825 | |
| 826 IncognitoExtensionProcessManager::~IncognitoExtensionProcessManager() { | |
|
Yoyo Zhou
2012/10/29 22:23:40
Please keep the function definitions in the same o
Joe Thomas
2012/10/29 23:04:42
Done.
Apparently there are other functions in Ext
| |
| 827 // TODO(yoz): This cleanup code belongs in the MenuManager. | |
| 828 // Remove "incognito" "split" mode context menu items. | |
| 829 ExtensionService* service = | |
| 830 extensions::ExtensionSystem::Get(GetProfile())->extension_service(); | |
| 831 service->menu_manager()->RemoveAllIncognitoContextItems(); | |
| 832 } | |
| OLD | NEW |