| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | |
| 9 #include <algorithm> | 8 #include <algorithm> |
| 10 #include <set> | 9 #include <set> |
| 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "chrome/browser/extensions/crx_installer.h" | 17 #include "chrome/browser/extensions/crx_installer.h" |
| 18 #include "chrome/browser/extensions/install_tracker.h" | 18 #include "chrome/browser/extensions/install_tracker.h" |
| 19 #include "chrome/browser/image_decoder.h" | 19 #include "chrome/browser/image_decoder.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 fetcher_->Start(); | 53 fetcher_->Start(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 const GURL& icon_url() const { return icon_url_; } | 56 const GURL& icon_url() const { return icon_url_; } |
| 57 const SkBitmap& icon() const { return icon_; } | 57 const SkBitmap& icon() const { return icon_; } |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // net::URLFetcherDelegate overrides: | 60 // net::URLFetcherDelegate overrides: |
| 61 void OnURLFetchComplete(const net::URLFetcher* source) override { | 61 void OnURLFetchComplete(const net::URLFetcher* source) override { |
| 62 CHECK_EQ(fetcher_.get(), source); | 62 CHECK_EQ(fetcher_.get(), source); |
| 63 scoped_ptr<net::URLFetcher> fetcher(fetcher_.Pass()); | 63 scoped_ptr<net::URLFetcher> fetcher(std::move(fetcher_)); |
| 64 | 64 |
| 65 if (!fetcher->GetStatus().is_success() || | 65 if (!fetcher->GetStatus().is_success() || |
| 66 fetcher->GetResponseCode() != net::HTTP_OK) { | 66 fetcher->GetResponseCode() != net::HTTP_OK) { |
| 67 converter_->OnIconFetchComplete(this); | 67 converter_->OnIconFetchComplete(this); |
| 68 return; | 68 return; |
| 69 } | 69 } |
| 70 | 70 |
| 71 std::string unsafe_icon_data; | 71 std::string unsafe_icon_data; |
| 72 fetcher->GetResponseAsString(&unsafe_icon_data); | 72 fetcher->GetResponseAsString(&unsafe_icon_data); |
| 73 | 73 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 return; | 192 return; |
| 193 } | 193 } |
| 194 | 194 |
| 195 extension_ = crx_installer_->extension(); | 195 extension_ = crx_installer_->extension(); |
| 196 is_new_install_ = success && !crx_installer_->current_version().IsValid(); | 196 is_new_install_ = success && !crx_installer_->current_version().IsValid(); |
| 197 PostInstallCleanUp(); | 197 PostInstallCleanUp(); |
| 198 | 198 |
| 199 base::ResetAndReturn(&finished_callback_).Run(this, success); | 199 base::ResetAndReturn(&finished_callback_).Run(this, success); |
| 200 // |finished_callback_| could delete this. | 200 // |finished_callback_| could delete this. |
| 201 } | 201 } |
| OLD | NEW |