OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 | 379 |
380 // This is lame, but we must reload the extension because absolute paths | 380 // This is lame, but we must reload the extension because absolute paths |
381 // inside the content scripts are established inside InitFromValue() and we | 381 // inside the content scripts are established inside InitFromValue() and we |
382 // just moved the extension. | 382 // just moved the extension. |
383 // TODO(aa): All paths to resources inside extensions should be created | 383 // TODO(aa): All paths to resources inside extensions should be created |
384 // lazily and based on the Extension's root path at that moment. | 384 // lazily and based on the Extension's root path at that moment. |
385 std::string error; | 385 std::string error; |
386 extension_ = extension_file_util::LoadExtension( | 386 extension_ = extension_file_util::LoadExtension( |
387 version_dir, | 387 version_dir, |
388 install_source_, | 388 install_source_, |
389 true, // Require key | 389 Extension::REQUIRE_KEY, |
390 false, // Disable strict error checks | |
391 &error); | 390 &error); |
392 CHECK(error.empty()) << error; | 391 CHECK(error.empty()) << error; |
393 | 392 |
394 ReportSuccessFromFileThread(); | 393 ReportSuccessFromFileThread(); |
395 } | 394 } |
396 | 395 |
397 void CrxInstaller::ReportFailureFromFileThread(const std::string& error) { | 396 void CrxInstaller::ReportFailureFromFileThread(const std::string& error) { |
398 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 397 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
399 BrowserThread::PostTask( | 398 BrowserThread::PostTask( |
400 BrowserThread::UI, FROM_HERE, | 399 BrowserThread::UI, FROM_HERE, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 client_->OnInstallSuccess(extension_.get(), install_icon_.get()); | 434 client_->OnInstallSuccess(extension_.get(), install_icon_.get()); |
436 | 435 |
437 // Tell the frontend about the installation and hand off ownership of | 436 // Tell the frontend about the installation and hand off ownership of |
438 // extension_ to it. | 437 // extension_ to it. |
439 frontend_->OnExtensionInstalled(extension_); | 438 frontend_->OnExtensionInstalled(extension_); |
440 extension_ = NULL; | 439 extension_ = NULL; |
441 | 440 |
442 // We're done. We don't post any more tasks to ourselves so we are deleted | 441 // We're done. We don't post any more tasks to ourselves so we are deleted |
443 // soon. | 442 // soon. |
444 } | 443 } |
OLD | NEW |