Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(711)

Side by Side Diff: chrome/browser/extensions/extension_info_map.cc

Issue 10831008: Refactor and fix declarative webRequest API permissions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed license headers Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_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 "chrome/common/extensions/extension_set.h" 8 #include "chrome/common/extensions/extension_set.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 bool ExtensionInfoMap::IsIncognitoEnabled( 87 bool ExtensionInfoMap::IsIncognitoEnabled(
88 const std::string& extension_id) const { 88 const std::string& extension_id) const {
89 // Keep in sync with duplicate in extension_process_manager.cc. 89 // Keep in sync with duplicate in extension_process_manager.cc.
90 ExtraDataMap::const_iterator iter = extra_data_.find(extension_id); 90 ExtraDataMap::const_iterator iter = extra_data_.find(extension_id);
91 if (iter != extra_data_.end()) 91 if (iter != extra_data_.end())
92 return iter->second.incognito_enabled; 92 return iter->second.incognito_enabled;
93 return false; 93 return false;
94 } 94 }
95 95
96 bool ExtensionInfoMap::CanCrossIncognito(const Extension* extension) { 96 bool ExtensionInfoMap::CanCrossIncognito(const Extension* extension) const {
97 // This is duplicated from ExtensionService :(. 97 // This is duplicated from ExtensionService :(.
98 return IsIncognitoEnabled(extension->id()) && 98 return IsIncognitoEnabled(extension->id()) &&
99 !extension->incognito_split_mode(); 99 !extension->incognito_split_mode();
100 } 100 }
101 101
102 void ExtensionInfoMap::RegisterExtensionProcess(const std::string& extension_id, 102 void ExtensionInfoMap::RegisterExtensionProcess(const std::string& extension_id,
103 int process_id, 103 int process_id,
104 int site_instance_id) { 104 int site_instance_id) {
105 if (!process_map_.Insert(extension_id, process_id, site_instance_id)) { 105 if (!process_map_.Insert(extension_id, process_id, site_instance_id)) {
106 NOTREACHED() << "Duplicate extension process registration for: " 106 NOTREACHED() << "Duplicate extension process registration for: "
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 quota_service_.reset(new ExtensionsQuotaService()); 150 quota_service_.reset(new ExtensionsQuotaService());
151 return quota_service_.get(); 151 return quota_service_.get();
152 } 152 }
153 153
154 ExtensionInfoMap::~ExtensionInfoMap() { 154 ExtensionInfoMap::~ExtensionInfoMap() {
155 if (quota_service_.get()) { 155 if (quota_service_.get()) {
156 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, 156 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE,
157 quota_service_.release()); 157 quota_service_.release());
158 } 158 }
159 } 159 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_info_map.h ('k') | chrome/browser/extensions/extension_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698