| 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/extension_webstore_private_api.h" | 5 #include "chrome/browser/extensions/extension_webstore_private_api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 &SafeBeginInstallHelper::StartWorkOnIOThread)); | 177 &SafeBeginInstallHelper::StartWorkOnIOThread)); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void StartWorkOnIOThread() { | 180 void StartWorkOnIOThread() { |
| 181 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 181 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 182 utility_host_ = new UtilityProcessHost(this, BrowserThread::IO); | 182 utility_host_ = new UtilityProcessHost(this, BrowserThread::IO); |
| 183 utility_host_->StartBatchMode(); | 183 utility_host_->StartBatchMode(); |
| 184 if (icon_data_.empty()) | 184 if (icon_data_.empty()) |
| 185 icon_decode_complete_ = true; | 185 icon_decode_complete_ = true; |
| 186 else | 186 else |
| 187 utility_host_->Send(new UtilityMsg_DecodeImageBase64(icon_data_)); | 187 utility_host_->Send(new ChromeUtilityMsg_DecodeImageBase64(icon_data_)); |
| 188 utility_host_->Send(new UtilityMsg_ParseJSON(manifest_)); | 188 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); |
| 189 } | 189 } |
| 190 | 190 |
| 191 // Implementing pieces of the UtilityProcessHost::Client interface. | 191 // Implementing pieces of the UtilityProcessHost::Client interface. |
| 192 virtual bool OnMessageReceived(const IPC::Message& message) { | 192 virtual bool OnMessageReceived(const IPC::Message& message) { |
| 193 bool handled = true; | 193 bool handled = true; |
| 194 IPC_BEGIN_MESSAGE_MAP(SafeBeginInstallHelper, message) | 194 IPC_BEGIN_MESSAGE_MAP(SafeBeginInstallHelper, message) |
| 195 IPC_MESSAGE_HANDLER(UtilityHostMsg_DecodeImage_Succeeded, | 195 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_DecodeImage_Succeeded, |
| 196 OnDecodeImageSucceeded) | 196 OnDecodeImageSucceeded) |
| 197 IPC_MESSAGE_HANDLER(UtilityHostMsg_DecodeImage_Failed, | 197 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_DecodeImage_Failed, |
| 198 OnDecodeImageFailed) | 198 OnDecodeImageFailed) |
| 199 IPC_MESSAGE_HANDLER(UtilityHostMsg_ParseJSON_Succeeded, | 199 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Succeeded, |
| 200 OnJSONParseSucceeded) | 200 OnJSONParseSucceeded) |
| 201 IPC_MESSAGE_HANDLER(UtilityHostMsg_ParseJSON_Failed, OnJSONParseFailed) | 201 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, |
| 202 OnJSONParseFailed) |
| 202 IPC_MESSAGE_UNHANDLED(handled = false) | 203 IPC_MESSAGE_UNHANDLED(handled = false) |
| 203 IPC_END_MESSAGE_MAP() | 204 IPC_END_MESSAGE_MAP() |
| 204 return handled; | 205 return handled; |
| 205 } | 206 } |
| 206 | 207 |
| 207 void OnDecodeImageSucceeded(const SkBitmap& decoded_image) { | 208 void OnDecodeImageSucceeded(const SkBitmap& decoded_image) { |
| 208 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 209 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 209 icon_ = decoded_image; | 210 icon_ = decoded_image; |
| 210 icon_decode_complete_ = true; | 211 icon_decode_complete_ = true; |
| 211 ReportResultsIfComplete(); | 212 ReportResultsIfComplete(); |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 } | 677 } |
| 677 | 678 |
| 678 DCHECK(waiting_for_token_); | 679 DCHECK(waiting_for_token_); |
| 679 | 680 |
| 680 result_.reset(CreateLoginResult(profile_->GetOriginalProfile())); | 681 result_.reset(CreateLoginResult(profile_->GetOriginalProfile())); |
| 681 SendResponse(true); | 682 SendResponse(true); |
| 682 | 683 |
| 683 // Matches the AddRef in RunImpl(). | 684 // Matches the AddRef in RunImpl(). |
| 684 Release(); | 685 Release(); |
| 685 } | 686 } |
| OLD | NEW |