| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(content::URLFetcher::Create( |
| 62 icon_url_, content::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 |
| 72 void WebstoreInstallHelper::StartWorkOnIOThread() { | 72 void WebstoreInstallHelper::StartWorkOnIOThread() { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |