| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/info_map.h" | 5 #include "extensions/browser/info_map.h" |
| 6 | 6 |
| 7 #include "chrome/common/extensions/extension.h" | 7 #include "chrome/common/extensions/extension.h" |
| 8 #include "chrome/common/extensions/extension_set.h" | 8 #include "chrome/common/extensions/extension_set.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "extensions/common/constants.h" | 10 #include "extensions/common/constants.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 | 78 |
| 79 base::Time InfoMap::GetInstallTime(const std::string& extension_id) const { | 79 base::Time InfoMap::GetInstallTime(const std::string& extension_id) const { |
| 80 ExtraDataMap::const_iterator iter = extra_data_.find(extension_id); | 80 ExtraDataMap::const_iterator iter = extra_data_.find(extension_id); |
| 81 if (iter != extra_data_.end()) | 81 if (iter != extra_data_.end()) |
| 82 return iter->second.install_time; | 82 return iter->second.install_time; |
| 83 return base::Time(); | 83 return base::Time(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool InfoMap::IsIncognitoEnabled(const std::string& extension_id) const { | 86 bool InfoMap::IsIncognitoEnabled(const std::string& extension_id) const { |
| 87 // Keep in sync with duplicate in extension_process_manager.cc. | 87 // Keep in sync with duplicate in extensions/browser/process_manager.cc. |
| 88 ExtraDataMap::const_iterator iter = extra_data_.find(extension_id); | 88 ExtraDataMap::const_iterator iter = extra_data_.find(extension_id); |
| 89 if (iter != extra_data_.end()) | 89 if (iter != extra_data_.end()) |
| 90 return iter->second.incognito_enabled; | 90 return iter->second.incognito_enabled; |
| 91 return false; | 91 return false; |
| 92 } | 92 } |
| 93 | 93 |
| 94 bool InfoMap::CanCrossIncognito(const Extension* extension) const { | 94 bool InfoMap::CanCrossIncognito(const Extension* extension) const { |
| 95 // This is duplicated from ExtensionService :(. | 95 // This is duplicated from ExtensionService :(. |
| 96 return IsIncognitoEnabled(extension->id()) && | 96 return IsIncognitoEnabled(extension->id()) && |
| 97 !IncognitoInfo::IsSplitMode(extension); | 97 !IncognitoInfo::IsSplitMode(extension); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 172 } |
| 173 | 173 |
| 174 InfoMap::~InfoMap() { | 174 InfoMap::~InfoMap() { |
| 175 if (quota_service_) { | 175 if (quota_service_) { |
| 176 BrowserThread::DeleteSoon( | 176 BrowserThread::DeleteSoon( |
| 177 BrowserThread::IO, FROM_HERE, quota_service_.release()); | 177 BrowserThread::IO, FROM_HERE, quota_service_.release()); |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace extensions | 181 } // namespace extensions |
| OLD | NEW |