| 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_system.h" | 5 #include "chrome/browser/extensions/extension_system.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/extensions/unpacked_installer.h" | 36 #include "chrome/browser/extensions/unpacked_installer.h" |
| 37 #include "chrome/browser/extensions/user_script_master.h" | 37 #include "chrome/browser/extensions/user_script_master.h" |
| 38 #include "chrome/browser/prefs/pref_service.h" | 38 #include "chrome/browser/prefs/pref_service.h" |
| 39 #include "chrome/browser/profiles/profile.h" | 39 #include "chrome/browser/profiles/profile.h" |
| 40 #include "chrome/browser/profiles/profile_manager.h" | 40 #include "chrome/browser/profiles/profile_manager.h" |
| 41 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 41 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 42 #include "chrome/common/chrome_switches.h" | 42 #include "chrome/common/chrome_switches.h" |
| 43 #include "chrome/common/chrome_version_info.h" | 43 #include "chrome/common/chrome_version_info.h" |
| 44 #include "chrome/common/extensions/extension.h" | 44 #include "chrome/common/extensions/extension.h" |
| 45 #include "chrome/common/extensions/features/feature.h" | 45 #include "chrome/common/extensions/features/feature.h" |
| 46 #include "chrome/common/extensions/manifest.h" |
| 46 #include "chrome/common/pref_names.h" | 47 #include "chrome/common/pref_names.h" |
| 47 #include "content/public/browser/browser_thread.h" | 48 #include "content/public/browser/browser_thread.h" |
| 48 #include "content/public/browser/url_data_source.h" | 49 #include "content/public/browser/url_data_source.h" |
| 49 | 50 |
| 50 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
| 51 #include "chrome/browser/chromeos/login/user_manager.h" | 52 #include "chrome/browser/chromeos/login/user_manager.h" |
| 52 #endif | 53 #endif |
| 53 | 54 |
| 54 using content::BrowserThread; | 55 using content::BrowserThread; |
| 55 | 56 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 return shared_->warning_service(); | 425 return shared_->warning_service(); |
| 425 } | 426 } |
| 426 | 427 |
| 427 Blacklist* ExtensionSystemImpl::blacklist() { | 428 Blacklist* ExtensionSystemImpl::blacklist() { |
| 428 return shared_->blacklist(); | 429 return shared_->blacklist(); |
| 429 } | 430 } |
| 430 | 431 |
| 431 void ExtensionSystemImpl::RegisterExtensionWithRequestContexts( | 432 void ExtensionSystemImpl::RegisterExtensionWithRequestContexts( |
| 432 const Extension* extension) { | 433 const Extension* extension) { |
| 433 base::Time install_time; | 434 base::Time install_time; |
| 434 if (extension->location() != Extension::COMPONENT) { | 435 if (extension->location() != Manifest::COMPONENT) { |
| 435 install_time = extension_service()->extension_prefs()-> | 436 install_time = extension_service()->extension_prefs()-> |
| 436 GetInstallTime(extension->id()); | 437 GetInstallTime(extension->id()); |
| 437 } | 438 } |
| 438 bool incognito_enabled = | 439 bool incognito_enabled = |
| 439 extension_service()->IsIncognitoEnabled(extension->id()); | 440 extension_service()->IsIncognitoEnabled(extension->id()); |
| 440 BrowserThread::PostTask( | 441 BrowserThread::PostTask( |
| 441 BrowserThread::IO, FROM_HERE, | 442 BrowserThread::IO, FROM_HERE, |
| 442 base::Bind(&ExtensionInfoMap::AddExtension, info_map(), | 443 base::Bind(&ExtensionInfoMap::AddExtension, info_map(), |
| 443 make_scoped_refptr(extension), install_time, | 444 make_scoped_refptr(extension), install_time, |
| 444 incognito_enabled)); | 445 incognito_enabled)); |
| 445 } | 446 } |
| 446 | 447 |
| 447 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 448 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
| 448 const std::string& extension_id, | 449 const std::string& extension_id, |
| 449 const extension_misc::UnloadedExtensionReason reason) { | 450 const extension_misc::UnloadedExtensionReason reason) { |
| 450 BrowserThread::PostTask( | 451 BrowserThread::PostTask( |
| 451 BrowserThread::IO, FROM_HERE, | 452 BrowserThread::IO, FROM_HERE, |
| 452 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), | 453 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), |
| 453 extension_id, reason)); | 454 extension_id, reason)); |
| 454 } | 455 } |
| 455 | 456 |
| 456 } // namespace extensions | 457 } // namespace extensions |
| OLD | NEW |