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 "chrome/browser/extensions/extension_process_manager.h" | 5 #include "chrome/browser/extensions/extension_process_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 using extensions::BackgroundManifestHandler; | 56 using extensions::BackgroundManifestHandler; |
57 using extensions::Extension; | 57 using extensions::Extension; |
58 using extensions::ExtensionHost; | 58 using extensions::ExtensionHost; |
59 | 59 |
60 namespace { | 60 namespace { |
61 | 61 |
62 std::string GetExtensionID(RenderViewHost* render_view_host) { | 62 std::string GetExtensionID(RenderViewHost* render_view_host) { |
63 // This works for both apps and extensions because the site has been | 63 // This works for both apps and extensions because the site has been |
64 // normalized to the extension URL for apps. | 64 // normalized to the extension URL for apps. |
65 if (!render_view_host->GetSiteInstance()) | 65 if (!render_view_host->GetSiteInstance()) |
66 return ""; | 66 return std::string(); |
67 | 67 |
68 return render_view_host->GetSiteInstance()->GetSiteURL().host(); | 68 return render_view_host->GetSiteInstance()->GetSiteURL().host(); |
69 } | 69 } |
70 | 70 |
71 // Incognito profiles use this process manager. It is mostly a shim that decides | 71 // Incognito profiles use this process manager. It is mostly a shim that decides |
72 // whether to fall back on the original profile's ExtensionProcessManager based | 72 // whether to fall back on the original profile's ExtensionProcessManager based |
73 // on whether a given extension uses "split" or "spanning" incognito behavior. | 73 // on whether a given extension uses "split" or "spanning" incognito behavior. |
74 class IncognitoExtensionProcessManager : public ExtensionProcessManager { | 74 class IncognitoExtensionProcessManager : public ExtensionProcessManager { |
75 public: | 75 public: |
76 explicit IncognitoExtensionProcessManager(Profile* profile); | 76 explicit IncognitoExtensionProcessManager(Profile* profile); |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 if (service && service->is_ready()) | 909 if (service && service->is_ready()) |
910 CreateBackgroundHostsForProfileStartup(); | 910 CreateBackgroundHostsForProfileStartup(); |
911 } | 911 } |
912 break; | 912 break; |
913 } | 913 } |
914 default: | 914 default: |
915 ExtensionProcessManager::Observe(type, source, details); | 915 ExtensionProcessManager::Observe(type, source, details); |
916 break; | 916 break; |
917 } | 917 } |
918 } | 918 } |
OLD | NEW |