OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/apps/drive/drive_app_converter.h" | 5 #include "chrome/browser/apps/drive/drive_app_converter.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 public: | 37 public: |
38 IconFetcher(DriveAppConverter* converter, | 38 IconFetcher(DriveAppConverter* converter, |
39 const GURL& icon_url, | 39 const GURL& icon_url, |
40 int expected_size) | 40 int expected_size) |
41 : converter_(converter), | 41 : converter_(converter), |
42 icon_url_(icon_url), | 42 icon_url_(icon_url), |
43 expected_size_(expected_size) {} | 43 expected_size_(expected_size) {} |
44 ~IconFetcher() override {} | 44 ~IconFetcher() override {} |
45 | 45 |
46 void Start() { | 46 void Start() { |
47 fetcher_.reset( | 47 fetcher_ = net::URLFetcher::Create(icon_url_, net::URLFetcher::GET, this); |
48 net::URLFetcher::Create(icon_url_, net::URLFetcher::GET, this)); | |
49 fetcher_->SetRequestContext(converter_->profile_->GetRequestContext()); | 48 fetcher_->SetRequestContext(converter_->profile_->GetRequestContext()); |
50 fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES); | 49 fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES); |
51 fetcher_->Start(); | 50 fetcher_->Start(); |
52 } | 51 } |
53 | 52 |
54 const GURL& icon_url() const { return icon_url_; } | 53 const GURL& icon_url() const { return icon_url_; } |
55 const SkBitmap& icon() const { return icon_; } | 54 const SkBitmap& icon() const { return icon_; } |
56 | 55 |
57 private: | 56 private: |
58 // net::URLFetcherDelegate overrides: | 57 // net::URLFetcherDelegate overrides: |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 return; | 194 return; |
196 } | 195 } |
197 | 196 |
198 extension_ = crx_installer_->extension(); | 197 extension_ = crx_installer_->extension(); |
199 is_new_install_ = success && crx_installer_->current_version().empty(); | 198 is_new_install_ = success && crx_installer_->current_version().empty(); |
200 PostInstallCleanUp(); | 199 PostInstallCleanUp(); |
201 | 200 |
202 base::ResetAndReturn(&finished_callback_).Run(this, success); | 201 base::ResetAndReturn(&finished_callback_).Run(this, success); |
203 // |finished_callback_| could delete this. | 202 // |finished_callback_| could delete this. |
204 } | 203 } |
OLD | NEW |