| 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/webstore_inline_installer.h" | 5 #include "chrome/browser/extensions/webstore_inline_installer.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 OnJSONParseSucceeded) | 94 OnJSONParseSucceeded) |
| 95 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, | 95 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ParseJSON_Failed, |
| 96 OnJSONParseFailed) | 96 OnJSONParseFailed) |
| 97 IPC_MESSAGE_UNHANDLED(handled = false) | 97 IPC_MESSAGE_UNHANDLED(handled = false) |
| 98 IPC_END_MESSAGE_MAP() | 98 IPC_END_MESSAGE_MAP() |
| 99 return handled; | 99 return handled; |
| 100 } | 100 } |
| 101 | 101 |
| 102 void OnJSONParseSucceeded(const ListValue& wrapper) { | 102 void OnJSONParseSucceeded(const ListValue& wrapper) { |
| 103 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 103 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 104 Value* value = NULL; | 104 const Value* value = NULL; |
| 105 CHECK(wrapper.Get(0, &value)); | 105 CHECK(wrapper.Get(0, &value)); |
| 106 if (value->IsType(Value::TYPE_DICTIONARY)) { | 106 if (value->IsType(Value::TYPE_DICTIONARY)) { |
| 107 parsed_webstore_data_.reset( | 107 parsed_webstore_data_.reset( |
| 108 static_cast<DictionaryValue*>(value)->DeepCopy()); | 108 static_cast<const DictionaryValue*>(value)->DeepCopy()); |
| 109 } else { | 109 } else { |
| 110 error_ = kInvalidWebstoreResponseError; | 110 error_ = kInvalidWebstoreResponseError; |
| 111 } | 111 } |
| 112 | 112 |
| 113 ReportResults(); | 113 ReportResults(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 virtual void OnJSONParseFailed(const std::string& error_message) { | 116 virtual void OnJSONParseFailed(const std::string& error_message) { |
| 117 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 117 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 118 error_ = error_message; | 118 error_ = error_message; |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 DLOG(WARNING) << "Could not parse " << verified_site_url << | 454 DLOG(WARNING) << "Could not parse " << verified_site_url << |
| 455 " as URL pattern " << parse_result; | 455 " as URL pattern " << parse_result; |
| 456 return false; | 456 return false; |
| 457 } | 457 } |
| 458 verified_site_pattern.SetScheme("*"); | 458 verified_site_pattern.SetScheme("*"); |
| 459 | 459 |
| 460 return verified_site_pattern.MatchesURL(requestor_url); | 460 return verified_site_pattern.MatchesURL(requestor_url); |
| 461 } | 461 } |
| 462 | 462 |
| 463 } // namespace extensions | 463 } // namespace extensions |
| OLD | NEW |