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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 error_ = std::string(kImageDecodeError); | 217 error_ = std::string(kImageDecodeError); |
218 parse_error_ = BeginInstallWithManifestFunction::ICON_ERROR; | 218 parse_error_ = BeginInstallWithManifestFunction::ICON_ERROR; |
219 ReportResultsIfComplete(); | 219 ReportResultsIfComplete(); |
220 } | 220 } |
221 | 221 |
222 void OnJSONParseSucceeded(const ListValue& wrapper) { | 222 void OnJSONParseSucceeded(const ListValue& wrapper) { |
223 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 223 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
224 manifest_parse_complete_ = true; | 224 manifest_parse_complete_ = true; |
225 Value* value = NULL; | 225 Value* value = NULL; |
226 CHECK(wrapper.Get(0, &value)); | 226 CHECK(wrapper.Get(0, &value)); |
227 if (value->IsType(Value::TYPE_DICTIONARY)) { | 227 if (value->IsDictionary()) { |
228 parsed_manifest_.reset( | 228 parsed_manifest_.reset( |
229 static_cast<DictionaryValue*>(value)->DeepCopy()); | 229 static_cast<DictionaryValue*>(value)->DeepCopy()); |
230 } else { | 230 } else { |
231 parse_error_ = BeginInstallWithManifestFunction::MANIFEST_ERROR; | 231 parse_error_ = BeginInstallWithManifestFunction::MANIFEST_ERROR; |
232 } | 232 } |
233 ReportResultsIfComplete(); | 233 ReportResultsIfComplete(); |
234 } | 234 } |
235 | 235 |
236 virtual void OnJSONParseFailed(const std::string& error_message) { | 236 virtual void OnJSONParseFailed(const std::string& error_message) { |
237 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 237 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 } | 676 } |
677 | 677 |
678 DCHECK(waiting_for_token_); | 678 DCHECK(waiting_for_token_); |
679 | 679 |
680 result_.reset(CreateLoginResult(profile_->GetOriginalProfile())); | 680 result_.reset(CreateLoginResult(profile_->GetOriginalProfile())); |
681 SendResponse(true); | 681 SendResponse(true); |
682 | 682 |
683 // Matches the AddRef in RunImpl(). | 683 // Matches the AddRef in RunImpl(). |
684 Release(); | 684 Release(); |
685 } | 685 } |
OLD | NEW |