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_install_helper.h" | 5 #include "chrome/browser/extensions/webstore_install_helper.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | | 66 url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | |
67 net::LOAD_DO_NOT_SEND_COOKIES); | 67 net::LOAD_DO_NOT_SEND_COOKIES); |
68 | 68 |
69 url_fetcher_->Start(); | 69 url_fetcher_->Start(); |
70 // We'll get called back in OnURLFetchComplete. | 70 // We'll get called back in OnURLFetchComplete. |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 void WebstoreInstallHelper::StartWorkOnIOThread() { | 74 void WebstoreInstallHelper::StartWorkOnIOThread() { |
75 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 75 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
76 utility_host_ = | 76 utility_host_ = UtilityProcessHost::Create( |
77 UtilityProcessHost::Create( | 77 this, base::MessageLoopProxy::current().get())->AsWeakPtr(); |
78 this, base::MessageLoopProxy::current())->AsWeakPtr(); | |
79 utility_host_->EnableZygote(); | 78 utility_host_->EnableZygote(); |
80 utility_host_->StartBatchMode(); | 79 utility_host_->StartBatchMode(); |
81 | 80 |
82 if (!icon_base64_data_.empty()) | 81 if (!icon_base64_data_.empty()) |
83 utility_host_->Send( | 82 utility_host_->Send( |
84 new ChromeUtilityMsg_DecodeImageBase64(icon_base64_data_)); | 83 new ChromeUtilityMsg_DecodeImageBase64(icon_base64_data_)); |
85 | 84 |
86 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); | 85 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); |
87 } | 86 } |
88 | 87 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 192 |
194 void WebstoreInstallHelper::ReportResultFromUIThread() { | 193 void WebstoreInstallHelper::ReportResultFromUIThread() { |
195 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 194 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
196 if (error_.empty() && parsed_manifest_) | 195 if (error_.empty() && parsed_manifest_) |
197 delegate_->OnWebstoreParseSuccess(id_, icon_, parsed_manifest_.release()); | 196 delegate_->OnWebstoreParseSuccess(id_, icon_, parsed_manifest_.release()); |
198 else | 197 else |
199 delegate_->OnWebstoreParseFailure(id_, parse_error_, error_); | 198 delegate_->OnWebstoreParseFailure(id_, parse_error_, error_); |
200 } | 199 } |
201 | 200 |
202 } // namespace extensions | 201 } // namespace extensions |
OLD | NEW |