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

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

Issue 282103003: Moved IS_EPHEMERAL flag to extension prefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix up file header Created 6 years, 7 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
OLDNEW
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 "chrome/browser/extensions/extension_util.h" 5 #include "chrome/browser/extensions/extension_util.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 return false; 164 return false;
165 165
166 content::SiteInstance* site_instance = process_manager->GetSiteInstanceForURL( 166 content::SiteInstance* site_instance = process_manager->GetSiteInstanceForURL(
167 Extension::GetBaseURLFromExtensionId(extension_id)); 167 Extension::GetBaseURLFromExtensionId(extension_id));
168 if (site_instance && site_instance->HasProcess()) 168 if (site_instance && site_instance->HasProcess())
169 return false; 169 return false;
170 170
171 return process_manager->GetRenderViewHostsForExtension(extension_id).empty(); 171 return process_manager->GetRenderViewHostsForExtension(extension_id).empty();
172 } 172 }
173 173
174 bool IsExtensionInstalledPermanently(const std::string& extension_id,
175 content::BrowserContext* context) {
176 const Extension* extension = ExtensionRegistry::Get(context)->
177 GetExtensionById(extension_id, ExtensionRegistry::EVERYTHING);
178 return extension && !extension->is_ephemeral();
179 }
180
181 GURL GetSiteForExtensionId(const std::string& extension_id, 174 GURL GetSiteForExtensionId(const std::string& extension_id,
182 content::BrowserContext* context) { 175 content::BrowserContext* context) {
183 return content::SiteInstance::GetSiteForURL( 176 return content::SiteInstance::GetSiteForURL(
184 context, Extension::GetBaseURLFromExtensionId(extension_id)); 177 context, Extension::GetBaseURLFromExtensionId(extension_id));
185 } 178 }
186 179
187 scoped_ptr<base::DictionaryValue> GetExtensionInfo(const Extension* extension) { 180 scoped_ptr<base::DictionaryValue> GetExtensionInfo(const Extension* extension) {
188 DCHECK(extension); 181 DCHECK(extension);
189 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue); 182 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
190 183
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 IDR_APP_DEFAULT_ICON); 240 IDR_APP_DEFAULT_ICON);
248 } 241 }
249 242
250 const gfx::ImageSkia& GetDefaultExtensionIcon() { 243 const gfx::ImageSkia& GetDefaultExtensionIcon() {
251 return *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 244 return *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
252 IDR_EXTENSION_DEFAULT_ICON); 245 IDR_EXTENSION_DEFAULT_ICON);
253 } 246 }
254 247
255 } // namespace util 248 } // namespace util
256 } // namespace extensions 249 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_util.h ('k') | chrome/browser/extensions/shared_module_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698