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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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/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" | |
53 #include "chromeos/chromeos_switches.h" | 52 #include "chromeos/chromeos_switches.h" |
| 53 #include "chromeos/login/login_state.h" |
54 #endif | 54 #endif |
55 | 55 |
56 using content::BrowserThread; | 56 using content::BrowserThread; |
57 | 57 |
58 namespace extensions { | 58 namespace extensions { |
59 | 59 |
60 // | 60 // |
61 // ExtensionSystem | 61 // ExtensionSystem |
62 // | 62 // |
63 | 63 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // These services must be registered before the ExtensionService tries to | 156 // These services must be registered before the ExtensionService tries to |
157 // load any extensions. | 157 // load any extensions. |
158 { | 158 { |
159 management_policy_.reset(new ManagementPolicy); | 159 management_policy_.reset(new ManagementPolicy); |
160 RegisterManagementPolicyProviders(); | 160 RegisterManagementPolicyProviders(); |
161 } | 161 } |
162 | 162 |
163 bool skip_session_extensions = false; | 163 bool skip_session_extensions = false; |
164 #if defined(OS_CHROMEOS) | 164 #if defined(OS_CHROMEOS) |
165 // Skip loading session extensions if we are not in a user session. | 165 // Skip loading session extensions if we are not in a user session. |
166 skip_session_extensions = !chromeos::UserManager::Get()->IsUserLoggedIn(); | 166 skip_session_extensions = !chromeos::LoginState::Get()->IsUserLoggedIn(); |
167 #endif | 167 #endif |
168 extension_service_->component_loader()->AddDefaultComponentExtensions( | 168 extension_service_->component_loader()->AddDefaultComponentExtensions( |
169 skip_session_extensions); | 169 skip_session_extensions); |
170 if (command_line->HasSwitch(switches::kLoadComponentExtension)) { | 170 if (command_line->HasSwitch(switches::kLoadComponentExtension)) { |
171 CommandLine::StringType path_list = command_line->GetSwitchValueNative( | 171 CommandLine::StringType path_list = command_line->GetSwitchValueNative( |
172 switches::kLoadComponentExtension); | 172 switches::kLoadComponentExtension); |
173 base::StringTokenizerT<CommandLine::StringType, | 173 base::StringTokenizerT<CommandLine::StringType, |
174 CommandLine::StringType::const_iterator> t(path_list, | 174 CommandLine::StringType::const_iterator> t(path_list, |
175 FILE_PATH_LITERAL(",")); | 175 FILE_PATH_LITERAL(",")); |
176 while (t.GetNext()) { | 176 while (t.GetNext()) { |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 458 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
459 const std::string& extension_id, | 459 const std::string& extension_id, |
460 const extension_misc::UnloadedExtensionReason reason) { | 460 const extension_misc::UnloadedExtensionReason reason) { |
461 BrowserThread::PostTask( | 461 BrowserThread::PostTask( |
462 BrowserThread::IO, FROM_HERE, | 462 BrowserThread::IO, FROM_HERE, |
463 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), | 463 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), |
464 extension_id, reason)); | 464 extension_id, reason)); |
465 } | 465 } |
466 | 466 |
467 } // namespace extensions | 467 } // namespace extensions |
OLD | NEW |