Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / webstore_install_helper.cc
index 323cba4..47926c6 100644 (file)
@@ -9,6 +9,7 @@
 #include "base/bind.h"
 #include "base/values.h"
 #include "chrome/common/chrome_utility_messages.h"
+#include "chrome/common/extensions/chrome_utility_extensions_messages.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/utility_process_host.h"
 #include "net/base/load_flags.h"
@@ -75,7 +76,6 @@ void WebstoreInstallHelper::StartWorkOnIOThread() {
   CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   utility_host_ = UtilityProcessHost::Create(
       this, base::MessageLoopProxy::current().get())->AsWeakPtr();
-  utility_host_->EnableZygote();
   utility_host_->StartBatchMode();
 
   if (!icon_base64_data_.empty())
@@ -89,8 +89,10 @@ void WebstoreInstallHelper::OnURLFetchComplete(
     const net::URLFetcher* source) {
   CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   CHECK(source == url_fetcher_.get());
-  if (source->GetStatus().status() != net::URLRequestStatus::SUCCESS ||
-      source->GetResponseCode() != 200) {
+  int response_code =
+      source->GetStatus().is_success() ? source->GetResponseCode() : 0;
+  if (!source->GetStatus().is_success() ||
+      response_code / 100 == 4 || response_code / 100 == 5) {
     BrowserThread::PostTask(
         BrowserThread::IO,
         FROM_HERE,
@@ -112,7 +114,8 @@ void WebstoreInstallHelper::OnURLFetchComplete(
 void WebstoreInstallHelper::StartFetchedImageDecode() {
   CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   CHECK(utility_host_.get());
-  utility_host_->Send(new ChromeUtilityMsg_DecodeImage(fetched_icon_data_));
+  utility_host_->Send(new ChromeUtilityMsg_DecodeImage(fetched_icon_data_,
+                                                       false));
 }
 
 
@@ -153,11 +156,11 @@ void WebstoreInstallHelper::OnJSONParseSucceeded(
     const base::ListValue& wrapper) {
   CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   manifest_parse_complete_ = true;
-  const Value* value = NULL;
+  const base::Value* value = NULL;
   CHECK(wrapper.Get(0, &value));
-  if (value->IsType(Value::TYPE_DICTIONARY)) {
+  if (value->IsType(base::Value::TYPE_DICTIONARY)) {
     parsed_manifest_.reset(
-        static_cast<const DictionaryValue*>(value)->DeepCopy());
+        static_cast<const base::DictionaryValue*>(value)->DeepCopy());
   } else {
     parse_error_ = Delegate::MANIFEST_ERROR;
   }