| 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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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/extensions/manifest.h" |
| 47 #include "chrome/common/pref_names.h" | 47 #include "chrome/common/pref_names.h" |
| 48 #include "content/public/browser/browser_thread.h" | 48 #include "content/public/browser/browser_thread.h" |
| 49 #include "content/public/browser/url_data_source.h" | 49 #include "content/public/browser/url_data_source.h" |
| 50 | 50 |
| 51 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
| 52 #include "chrome/browser/chromeos/login/user_manager.h" | 52 #include "chrome/browser/chromeos/login/user_manager.h" |
| 53 #include "chromeos/chromeos_switches.h" | |
| 54 #endif | 53 #endif |
| 55 | 54 |
| 56 using content::BrowserThread; | 55 using content::BrowserThread; |
| 57 | 56 |
| 58 namespace extensions { | 57 namespace extensions { |
| 59 | 58 |
| 60 // | 59 // |
| 61 // ExtensionSystem | 60 // ExtensionSystem |
| 62 // | 61 // |
| 63 | 62 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 bool allow_noisy_errors = !command_line->HasSwitch(switches::kNoErrorDialogs); | 133 bool allow_noisy_errors = !command_line->HasSwitch(switches::kNoErrorDialogs); |
| 135 ExtensionErrorReporter::Init(allow_noisy_errors); | 134 ExtensionErrorReporter::Init(allow_noisy_errors); |
| 136 | 135 |
| 137 user_script_master_ = new UserScriptMaster(profile_); | 136 user_script_master_ = new UserScriptMaster(profile_); |
| 138 | 137 |
| 139 bool autoupdate_enabled = true; | 138 bool autoupdate_enabled = true; |
| 140 #if defined(OS_CHROMEOS) | 139 #if defined(OS_CHROMEOS) |
| 141 if (!extensions_enabled) | 140 if (!extensions_enabled) |
| 142 autoupdate_enabled = false; | 141 autoupdate_enabled = false; |
| 143 else | 142 else |
| 144 autoupdate_enabled = | 143 autoupdate_enabled = !command_line->HasSwitch(switches::kGuestSession); |
| 145 !command_line->HasSwitch(chromeos::switches::kGuestSession); | |
| 146 #endif | 144 #endif |
| 147 extension_service_.reset(new ExtensionService( | 145 extension_service_.reset(new ExtensionService( |
| 148 profile_, | 146 profile_, |
| 149 CommandLine::ForCurrentProcess(), | 147 CommandLine::ForCurrentProcess(), |
| 150 profile_->GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), | 148 profile_->GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), |
| 151 extension_prefs_.get(), | 149 extension_prefs_.get(), |
| 152 blacklist_.get(), | 150 blacklist_.get(), |
| 153 autoupdate_enabled, | 151 autoupdate_enabled, |
| 154 extensions_enabled)); | 152 extensions_enabled)); |
| 155 | 153 |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 456 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
| 459 const std::string& extension_id, | 457 const std::string& extension_id, |
| 460 const extension_misc::UnloadedExtensionReason reason) { | 458 const extension_misc::UnloadedExtensionReason reason) { |
| 461 BrowserThread::PostTask( | 459 BrowserThread::PostTask( |
| 462 BrowserThread::IO, FROM_HERE, | 460 BrowserThread::IO, FROM_HERE, |
| 463 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), | 461 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), |
| 464 extension_id, reason)); | 462 extension_id, reason)); |
| 465 } | 463 } |
| 466 | 464 |
| 467 } // namespace extensions | 465 } // namespace extensions |
| OLD | NEW |