| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/string_tokenizer.h" | 10 #include "base/string_tokenizer.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/extensions/extension_pref_value_map_factory.h" | 24 #include "chrome/browser/extensions/extension_pref_value_map_factory.h" |
| 25 #include "chrome/browser/extensions/extension_process_manager.h" | 25 #include "chrome/browser/extensions/extension_process_manager.h" |
| 26 #include "chrome/browser/extensions/extension_service.h" | 26 #include "chrome/browser/extensions/extension_service.h" |
| 27 #include "chrome/browser/extensions/extension_system_factory.h" | 27 #include "chrome/browser/extensions/extension_system_factory.h" |
| 28 #include "chrome/browser/extensions/lazy_background_task_queue.h" | 28 #include "chrome/browser/extensions/lazy_background_task_queue.h" |
| 29 #include "chrome/browser/extensions/unpacked_installer.h" | 29 #include "chrome/browser/extensions/unpacked_installer.h" |
| 30 #include "chrome/browser/extensions/user_script_master.h" | 30 #include "chrome/browser/extensions/user_script_master.h" |
| 31 #include "chrome/browser/prefs/pref_service.h" | 31 #include "chrome/browser/prefs/pref_service.h" |
| 32 #include "chrome/browser/profiles/profile.h" | 32 #include "chrome/browser/profiles/profile.h" |
| 33 #include "chrome/browser/profiles/profile_manager.h" | 33 #include "chrome/browser/profiles/profile_manager.h" |
| 34 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 34 #include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h" |
| 35 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 35 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 36 #include "chrome/common/chrome_switches.h" | 36 #include "chrome/common/chrome_switches.h" |
| 37 #include "chrome/common/extensions/extension.h" | 37 #include "chrome/common/extensions/extension.h" |
| 38 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
| 39 #include "content/public/browser/browser_thread.h" | 39 #include "content/public/browser/browser_thread.h" |
| 40 | 40 |
| 41 using content::BrowserThread; | 41 using content::BrowserThread; |
| 42 | 42 |
| 43 // | 43 // |
| 44 // ExtensionSystem | 44 // ExtensionSystem |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 FILE_PATH_LITERAL(",")); | 145 FILE_PATH_LITERAL(",")); |
| 146 scoped_refptr<extensions::UnpackedInstaller> installer = | 146 scoped_refptr<extensions::UnpackedInstaller> installer = |
| 147 extensions::UnpackedInstaller::Create(extension_service_.get()); | 147 extensions::UnpackedInstaller::Create(extension_service_.get()); |
| 148 while (t.GetNext()) { | 148 while (t.GetNext()) { |
| 149 installer->LoadFromCommandLine(FilePath(t.token())); | 149 installer->LoadFromCommandLine(FilePath(t.token())); |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 // Make the chrome://extension-icon/ resource available. | 154 // Make the chrome://extension-icon/ resource available. |
| 155 profile_->GetChromeURLDataManager()->AddDataSource( | 155 ChromeURLDataManagerFactory::GetForProfile(profile_)-> |
| 156 new ExtensionIconSource(profile_)); | 156 AddDataSource(new ExtensionIconSource(profile_)); |
| 157 | 157 |
| 158 // Initialize extension event routers. Note that on Chrome OS, this will | 158 // Initialize extension event routers. Note that on Chrome OS, this will |
| 159 // not succeed if the user has not logged in yet, in which case the | 159 // not succeed if the user has not logged in yet, in which case the |
| 160 // event routers are initialized in LoginUtilsImpl::CompleteLogin instead. | 160 // event routers are initialized in LoginUtilsImpl::CompleteLogin instead. |
| 161 // The InitEventRouters call used to be in BrowserMain, because when bookmark | 161 // The InitEventRouters call used to be in BrowserMain, because when bookmark |
| 162 // import happened on first run, the bookmark bar was not being correctly | 162 // import happened on first run, the bookmark bar was not being correctly |
| 163 // initialized (see issue 40144). Now that bookmarks aren't imported and | 163 // initialized (see issue 40144). Now that bookmarks aren't imported and |
| 164 // the event routers need to be initialized for every profile individually, | 164 // the event routers need to be initialized for every profile individually, |
| 165 // initialize them with the extension service. | 165 // initialize them with the extension service. |
| 166 // If this profile is being created as part of the import process, never | 166 // If this profile is being created as part of the import process, never |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 } | 313 } |
| 314 | 314 |
| 315 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 315 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
| 316 const std::string& extension_id, | 316 const std::string& extension_id, |
| 317 const extension_misc::UnloadedExtensionReason reason) { | 317 const extension_misc::UnloadedExtensionReason reason) { |
| 318 BrowserThread::PostTask( | 318 BrowserThread::PostTask( |
| 319 BrowserThread::IO, FROM_HERE, | 319 BrowserThread::IO, FROM_HERE, |
| 320 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), | 320 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), |
| 321 extension_id, reason)); | 321 extension_id, reason)); |
| 322 } | 322 } |
| OLD | NEW |