| OLD | NEW |
| 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/ui/webui/extensions/extension_settings_browsertest.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_settings_browsertest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 10 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 11 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 12 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
| 13 #include "chrome/browser/extensions/crx_installer.h" | 14 #include "chrome/browser/extensions/crx_installer.h" |
| 14 #include "chrome/browser/extensions/extension_error_reporter.h" | 15 #include "chrome/browser/extensions/extension_error_reporter.h" |
| 15 #include "chrome/browser/extensions/extension_install_prompt.h" | 16 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 16 #include "chrome/browser/extensions/extension_install_prompt_show_params.h" | 17 #include "chrome/browser/extensions/extension_install_prompt_show_params.h" |
| 17 #include "chrome/browser/extensions/extension_service.h" | 18 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 scoped_ptr<ExtensionInstallPrompt> install_ui( | 154 scoped_ptr<ExtensionInstallPrompt> install_ui( |
| 154 new ExtensionInstallPrompt( | 155 new ExtensionInstallPrompt( |
| 155 browser()->tab_strip_model()->GetActiveWebContents())); | 156 browser()->tab_strip_model()->GetActiveWebContents())); |
| 156 | 157 |
| 157 base::FilePath crx_path = path; | 158 base::FilePath crx_path = path; |
| 158 DCHECK(crx_path.Extension() == FILE_PATH_LITERAL(".crx")); | 159 DCHECK(crx_path.Extension() == FILE_PATH_LITERAL(".crx")); |
| 159 if (crx_path.empty()) | 160 if (crx_path.empty()) |
| 160 return nullptr; | 161 return nullptr; |
| 161 | 162 |
| 162 scoped_refptr<extensions::CrxInstaller> installer( | 163 scoped_refptr<extensions::CrxInstaller> installer( |
| 163 extensions::CrxInstaller::Create(service, install_ui.Pass())); | 164 extensions::CrxInstaller::Create(service, std::move(install_ui))); |
| 164 installer->set_expected_id(std::string()); | 165 installer->set_expected_id(std::string()); |
| 165 installer->set_is_gallery_install(false); | 166 installer->set_is_gallery_install(false); |
| 166 installer->set_install_source(extensions::Manifest::INTERNAL); | 167 installer->set_install_source(extensions::Manifest::INTERNAL); |
| 167 installer->set_install_immediately(true); | 168 installer->set_install_immediately(true); |
| 168 installer->set_off_store_install_allow_reason( | 169 installer->set_off_store_install_allow_reason( |
| 169 extensions::CrxInstaller::OffStoreInstallAllowedInTest); | 170 extensions::CrxInstaller::OffStoreInstallAllowedInTest); |
| 170 | 171 |
| 171 observer_->Watch( | 172 observer_->Watch( |
| 172 extensions::NOTIFICATION_CRX_INSTALLER_DONE, | 173 extensions::NOTIFICATION_CRX_INSTALLER_DONE, |
| 173 content::Source<extensions::CrxInstaller>(installer.get())); | 174 content::Source<extensions::CrxInstaller>(installer.get())); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 194 iter != errors->end(); ++iter) | 195 iter != errors->end(); ++iter) |
| 195 VLOG(1) << *iter; | 196 VLOG(1) << *iter; |
| 196 | 197 |
| 197 return nullptr; | 198 return nullptr; |
| 198 } | 199 } |
| 199 | 200 |
| 200 if (!observer_->WaitForExtensionViewsToLoad()) | 201 if (!observer_->WaitForExtensionViewsToLoad()) |
| 201 return nullptr; | 202 return nullptr; |
| 202 return service->GetExtensionById(last_loaded_extension_id(), false); | 203 return service->GetExtensionById(last_loaded_extension_id(), false); |
| 203 } | 204 } |
| OLD | NEW |