| 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/startup_helper.h" | 5 #include "chrome/browser/extensions/startup_helper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 this)); | 137 this)); |
| 138 } | 138 } |
| 139 | 139 |
| 140 protected: | 140 protected: |
| 141 virtual ~ValidateCrxHelper() {} | 141 virtual ~ValidateCrxHelper() {} |
| 142 | 142 |
| 143 virtual void OnUnpackSuccess(const base::FilePath& temp_dir, | 143 virtual void OnUnpackSuccess(const base::FilePath& temp_dir, |
| 144 const base::FilePath& extension_root, | 144 const base::FilePath& extension_root, |
| 145 const base::DictionaryValue* original_manifest, | 145 const base::DictionaryValue* original_manifest, |
| 146 const Extension* extension, | 146 const Extension* extension, |
| 147 const SkBitmap& install_icon) OVERRIDE { | 147 const SkBitmap& install_icon) override { |
| 148 finished_ = true; | 148 finished_ = true; |
| 149 success_ = true; | 149 success_ = true; |
| 150 BrowserThread::PostTask(BrowserThread::UI, | 150 BrowserThread::PostTask(BrowserThread::UI, |
| 151 FROM_HERE, | 151 FROM_HERE, |
| 152 base::Bind(&ValidateCrxHelper::FinishOnUIThread, | 152 base::Bind(&ValidateCrxHelper::FinishOnUIThread, |
| 153 this)); | 153 this)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 virtual void OnUnpackFailure(const base::string16& error) OVERRIDE { | 156 virtual void OnUnpackFailure(const base::string16& error) override { |
| 157 finished_ = true; | 157 finished_ = true; |
| 158 success_ = false; | 158 success_ = false; |
| 159 error_ = error; | 159 error_ = error; |
| 160 BrowserThread::PostTask(BrowserThread::UI, | 160 BrowserThread::PostTask(BrowserThread::UI, |
| 161 FROM_HERE, | 161 FROM_HERE, |
| 162 base::Bind(&ValidateCrxHelper::FinishOnUIThread, | 162 base::Bind(&ValidateCrxHelper::FinishOnUIThread, |
| 163 this)); | 163 this)); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void FinishOnUIThread() { | 166 void FinishOnUIThread() { |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 LOG(ERROR) << "InstallFromWebstore failed with error: " << helper.error(); | 323 LOG(ERROR) << "InstallFromWebstore failed with error: " << helper.error(); |
| 324 return helper.success(); | 324 return helper.success(); |
| 325 } | 325 } |
| 326 | 326 |
| 327 StartupHelper::~StartupHelper() { | 327 StartupHelper::~StartupHelper() { |
| 328 if (pack_job_.get()) | 328 if (pack_job_.get()) |
| 329 pack_job_->ClearClient(); | 329 pack_job_->ClearClient(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 } // namespace extensions | 332 } // namespace extensions |
| OLD | NEW |