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/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 68 matching lines...) Loading... |
79 profile_(frontend_weak->profile()), | 79 profile_(frontend_weak->profile()), |
80 client_(client), | 80 client_(client), |
81 apps_require_extension_mime_type_(false), | 81 apps_require_extension_mime_type_(false), |
82 allow_silent_install_(false), | 82 allow_silent_install_(false), |
83 install_cause_(extension_misc::INSTALL_CAUSE_UNSET), | 83 install_cause_(extension_misc::INSTALL_CAUSE_UNSET), |
84 creation_flags_(Extension::NO_FLAGS) { | 84 creation_flags_(Extension::NO_FLAGS) { |
85 if (!approval) | 85 if (!approval) |
86 return; | 86 return; |
87 | 87 |
88 CHECK(profile_->IsSameProfile(approval->profile)); | 88 CHECK(profile_->IsSameProfile(approval->profile)); |
89 | |
90 client_->set_use_app_installed_bubble(approval->use_app_installed_bubble); | 89 client_->set_use_app_installed_bubble(approval->use_app_installed_bubble); |
91 client_->set_skip_post_install_ui(approval->skip_post_install_ui); | 90 client_->set_skip_post_install_ui(approval->skip_post_install_ui); |
92 | 91 |
93 // Mark the extension as approved, but save the expected manifest and ID | 92 if (approval->skip_install_dialog) { |
94 // so we can check that they match the CRX's. | 93 // Mark the extension as approved, but save the expected manifest and ID |
95 approved_ = true; | 94 // so we can check that they match the CRX's. |
96 expected_manifest_.reset(approval->parsed_manifest->DeepCopy()); | 95 approved_ = true; |
97 expected_id_ = approval->extension_id; | 96 expected_manifest_.reset(approval->parsed_manifest->DeepCopy()); |
| 97 expected_id_ = approval->extension_id; |
| 98 } |
98 } | 99 } |
99 | 100 |
100 CrxInstaller::~CrxInstaller() { | 101 CrxInstaller::~CrxInstaller() { |
101 // Delete the temp directory and crx file as necessary. Note that the | 102 // Delete the temp directory and crx file as necessary. Note that the |
102 // destructor might be called on any thread, so we post a task to the file | 103 // destructor might be called on any thread, so we post a task to the file |
103 // thread to make sure the delete happens there. This is a best effort | 104 // thread to make sure the delete happens there. This is a best effort |
104 // operation since the browser can be shutting down so there might not | 105 // operation since the browser can be shutting down so there might not |
105 // be a file thread to post to. | 106 // be a file thread to post to. |
106 if (!temp_dir_.value().empty()) { | 107 if (!temp_dir_.value().empty()) { |
107 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 108 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
(...skipping 441 matching lines...) Loading... |
549 // Some users (such as the download shelf) need to know when a | 550 // Some users (such as the download shelf) need to know when a |
550 // CRXInstaller is done. Listening for the EXTENSION_* events | 551 // CRXInstaller is done. Listening for the EXTENSION_* events |
551 // is problematic because they don't know anything about the | 552 // is problematic because they don't know anything about the |
552 // extension before it is unpacked, so they cannot filter based | 553 // extension before it is unpacked, so they cannot filter based |
553 // on the extension. | 554 // on the extension. |
554 content::NotificationService::current()->Notify( | 555 content::NotificationService::current()->Notify( |
555 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 556 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
556 content::Source<CrxInstaller>(this), | 557 content::Source<CrxInstaller>(this), |
557 content::Details<const Extension>(extension)); | 558 content::Details<const Extension>(extension)); |
558 } | 559 } |
OLD | NEW |