OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // TODO(aa): Also support expected version? | 117 // TODO(aa): Also support expected version? |
118 if (!expected_id_.empty() && expected_id_ != extension->id()) { | 118 if (!expected_id_.empty() && expected_id_ != extension->id()) { |
119 ReportFailureFromFileThread(StringPrintf( | 119 ReportFailureFromFileThread(StringPrintf( |
120 "ID in new extension manifest (%s) does not match expected id (%s)", | 120 "ID in new extension manifest (%s) does not match expected id (%s)", |
121 extension->id().c_str(), | 121 extension->id().c_str(), |
122 expected_id_.c_str())); | 122 expected_id_.c_str())); |
123 return; | 123 return; |
124 } | 124 } |
125 | 125 |
126 if (client_.get()) { | 126 if (client_.get()) { |
127 DecodeInstallIcon(extension_->GetIconPath(Extension::EXTENSION_ICON_LARGE), | 127 FilePath icon_path = |
128 &install_icon_); | 128 extension_->GetIconPath(Extension::EXTENSION_ICON_LARGE).GetFilePath(); |
| 129 DecodeInstallIcon(icon_path, &install_icon_); |
129 } | 130 } |
130 ui_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, | 131 ui_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, |
131 &CrxInstaller::ConfirmInstall)); | 132 &CrxInstaller::ConfirmInstall)); |
132 } | 133 } |
133 | 134 |
134 // static | 135 // static |
135 void CrxInstaller::DecodeInstallIcon(const FilePath& large_icon_path, | 136 void CrxInstaller::DecodeInstallIcon(const FilePath& large_icon_path, |
136 scoped_ptr<SkBitmap>* result) { | 137 scoped_ptr<SkBitmap>* result) { |
137 if (large_icon_path.empty()) | 138 if (large_icon_path.empty()) |
138 return; | 139 return; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 client_->OnInstallSuccess(extension_.get()); | 305 client_->OnInstallSuccess(extension_.get()); |
305 | 306 |
306 // Tell the frontend about the installation and hand off ownership of | 307 // Tell the frontend about the installation and hand off ownership of |
307 // extension_ to it. | 308 // extension_ to it. |
308 frontend_->OnExtensionInstalled(extension_.release(), | 309 frontend_->OnExtensionInstalled(extension_.release(), |
309 allow_privilege_increase_); | 310 allow_privilege_increase_); |
310 | 311 |
311 // We're done. We don't post any more tasks to ourselves so we are deleted | 312 // We're done. We don't post any more tasks to ourselves so we are deleted |
312 // soon. | 313 // soon. |
313 } | 314 } |
OLD | NEW |