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

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

Issue 10554008: Move content::URLFetcher static functions to net::URLFetcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win link error Created 8 years, 6 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"
11 #include "chrome/common/chrome_utility_messages.h" 11 #include "chrome/common/chrome_utility_messages.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 #include "content/public/browser/utility_process_host.h" 13 #include "content/public/browser/utility_process_host.h"
14 #include "content/public/common/url_fetcher.h"
15 #include "net/base/load_flags.h" 14 #include "net/base/load_flags.h"
15 #include "net/url_request/url_fetcher.h"
16 #include "net/url_request/url_request_context_getter.h" 16 #include "net/url_request/url_request_context_getter.h"
17 #include "net/url_request/url_request_status.h" 17 #include "net/url_request/url_request_status.h"
18 18
19 using content::BrowserThread; 19 using content::BrowserThread;
20 using content::UtilityProcessHost; 20 using content::UtilityProcessHost;
21 21
22 namespace { 22 namespace {
23 23
24 const char kImageDecodeError[] = "Image decode failed"; 24 const char kImageDecodeError[] = "Image decode failed";
25 25
(...skipping 25 matching lines...) Expand all
51 if (icon_base64_data_.empty() && icon_url_.is_empty()) 51 if (icon_base64_data_.empty() && icon_url_.is_empty())
52 icon_decode_complete_ = true; 52 icon_decode_complete_ = true;
53 53
54 BrowserThread::PostTask( 54 BrowserThread::PostTask(
55 BrowserThread::IO, 55 BrowserThread::IO,
56 FROM_HERE, 56 FROM_HERE,
57 base::Bind(&WebstoreInstallHelper::StartWorkOnIOThread, this)); 57 base::Bind(&WebstoreInstallHelper::StartWorkOnIOThread, this));
58 58
59 if (!icon_url_.is_empty()) { 59 if (!icon_url_.is_empty()) {
60 CHECK(context_getter_); 60 CHECK(context_getter_);
61 url_fetcher_.reset(content::URLFetcher::Create( 61 url_fetcher_.reset(net::URLFetcher::Create(
62 icon_url_, net::URLFetcher::GET, this)); 62 icon_url_, net::URLFetcher::GET, this));
63 url_fetcher_->SetRequestContext(context_getter_); 63 url_fetcher_->SetRequestContext(context_getter_);
64 url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | 64 url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
65 net::LOAD_DO_NOT_SEND_COOKIES); 65 net::LOAD_DO_NOT_SEND_COOKIES);
66 66
67 url_fetcher_->Start(); 67 url_fetcher_->Start();
68 // We'll get called back in OnURLFetchComplete. 68 // We'll get called back in OnURLFetchComplete.
69 } 69 }
70 } 70 }
71 71
(...skipping 116 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_inline_installer.cc ('k') | chrome/browser/feedback/feedback_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698