OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_info_map.h" | 5 #include "chrome/browser/extensions/extension_info_map.h" |
6 | 6 |
7 #include "chrome/common/extensions/extension.h" | 7 #include "chrome/common/extensions/extension.h" |
8 #include "content/browser/browser_thread.h" | 8 #include "content/browser/browser_thread.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 return iter->second.incognito_enabled; | 88 return iter->second.incognito_enabled; |
89 return false; | 89 return false; |
90 } | 90 } |
91 | 91 |
92 bool ExtensionInfoMap::CanCrossIncognito(const Extension* extension) { | 92 bool ExtensionInfoMap::CanCrossIncognito(const Extension* extension) { |
93 // This is duplicated from ExtensionService :(. | 93 // This is duplicated from ExtensionService :(. |
94 return IsIncognitoEnabled(extension->id()) && | 94 return IsIncognitoEnabled(extension->id()) && |
95 !extension->incognito_split_mode(); | 95 !extension->incognito_split_mode(); |
96 } | 96 } |
97 | 97 |
98 // These are duplicated from ExtensionProcessManager :(. | 98 // These are duplicated from ExtensionProcessManager so that we can have the |
99 void ExtensionInfoMap::BindingsEnabledForProcess(int host_id) { | 99 // information on the IO thread :(. |
100 extension_bindings_process_ids_.insert(host_id); | 100 void ExtensionInfoMap::BindingsEnabledForProcess(int render_process_id) { |
| 101 extension_bindings_process_ids_.insert(render_process_id); |
101 } | 102 } |
102 | 103 |
103 void ExtensionInfoMap::BindingsDisabledForProcess(int host_id) { | 104 void ExtensionInfoMap::BindingsDisabledForProcess(int render_process_id) { |
104 extension_bindings_process_ids_.erase(host_id); | 105 extension_bindings_process_ids_.erase(render_process_id); |
105 } | 106 } |
106 | 107 |
107 bool ExtensionInfoMap::AreBindingsEnabledForProcess(int host_id) const { | 108 bool ExtensionInfoMap::AreBindingsEnabledForProcess( |
108 return extension_bindings_process_ids_.find(host_id) != | 109 int render_process_id) const { |
| 110 return extension_bindings_process_ids_.find(render_process_id) != |
109 extension_bindings_process_ids_.end(); | 111 extension_bindings_process_ids_.end(); |
110 } | 112 } |
OLD | NEW |