Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: chrome/browser/extensions/webstore_install_helper.cc

Issue 10386063: Move URLFetcherDelegate to net/ and split URLFetcher between net/ and content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to head, fix win component build Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 utility_host_->StartBatchMode(); 77 utility_host_->StartBatchMode();
78 78
79 if (!icon_base64_data_.empty()) 79 if (!icon_base64_data_.empty())
80 utility_host_->Send( 80 utility_host_->Send(
81 new ChromeUtilityMsg_DecodeImageBase64(icon_base64_data_)); 81 new ChromeUtilityMsg_DecodeImageBase64(icon_base64_data_));
82 82
83 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_)); 83 utility_host_->Send(new ChromeUtilityMsg_ParseJSON(manifest_));
84 } 84 }
85 85
86 void WebstoreInstallHelper::OnURLFetchComplete( 86 void WebstoreInstallHelper::OnURLFetchComplete(
87 const content::URLFetcher* source) { 87 const net::URLFetcher* source) {
88 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 88 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
89 CHECK(source == url_fetcher_.get()); 89 CHECK(source == url_fetcher_.get());
90 if (source->GetStatus().status() != net::URLRequestStatus::SUCCESS || 90 if (source->GetStatus().status() != net::URLRequestStatus::SUCCESS ||
91 source->GetResponseCode() != 200) { 91 source->GetResponseCode() != 200) {
92 BrowserThread::PostTask( 92 BrowserThread::PostTask(
93 BrowserThread::IO, 93 BrowserThread::IO,
94 FROM_HERE, 94 FROM_HERE,
95 base::Bind(&WebstoreInstallHelper::OnDecodeImageFailed, this)); 95 base::Bind(&WebstoreInstallHelper::OnDecodeImageFailed, this));
96 } else { 96 } else {
97 std::string response_data; 97 std::string response_data;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 base::Bind(&WebstoreInstallHelper::ReportResultFromUIThread, this)); 188 base::Bind(&WebstoreInstallHelper::ReportResultFromUIThread, this));
189 } 189 }
190 190
191 void WebstoreInstallHelper::ReportResultFromUIThread() { 191 void WebstoreInstallHelper::ReportResultFromUIThread() {
192 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 192 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
193 if (error_.empty() && parsed_manifest_.get()) 193 if (error_.empty() && parsed_manifest_.get())
194 delegate_->OnWebstoreParseSuccess(id_, icon_, parsed_manifest_.release()); 194 delegate_->OnWebstoreParseSuccess(id_, icon_, parsed_manifest_.release());
195 else 195 else
196 delegate_->OnWebstoreParseFailure(id_, parse_error_, error_); 196 delegate_->OnWebstoreParseFailure(id_, parse_error_, error_);
197 } 197 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_install_helper.h ('k') | chrome/browser/feedback/feedback_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698