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/api/webstore_private/webstore_private_api.h" | 5 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" |
6 | 6 |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 if (params_->contents.empty()) | 607 if (params_->contents.empty()) |
608 return RespondNow(Error(kInvalidBundleError)); | 608 return RespondNow(Error(kInvalidBundleError)); |
609 | 609 |
610 if (params_->details.icon_url) { | 610 if (params_->details.icon_url) { |
611 GURL icon_url = source_url().Resolve(*params_->details.icon_url); | 611 GURL icon_url = source_url().Resolve(*params_->details.icon_url); |
612 if (!icon_url.is_valid()) | 612 if (!icon_url.is_valid()) |
613 return RespondNow(Error(kInvalidIconUrlError)); | 613 return RespondNow(Error(kInvalidIconUrlError)); |
614 | 614 |
615 // The bitmap fetcher will call us back via OnFetchComplete. | 615 // The bitmap fetcher will call us back via OnFetchComplete. |
616 icon_fetcher_.reset(new chrome::BitmapFetcher(icon_url, this)); | 616 icon_fetcher_.reset(new chrome::BitmapFetcher(icon_url, this)); |
617 icon_fetcher_->Start( | 617 icon_fetcher_->Init( |
618 browser_context()->GetRequestContext(), std::string(), | 618 browser_context()->GetRequestContext(), std::string(), |
619 net::URLRequest::CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, | 619 net::URLRequest::CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, |
620 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES); | 620 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES); |
| 621 icon_fetcher_->Start(); |
621 } else { | 622 } else { |
622 base::ThreadTaskRunnerHandle::Get()->PostTask( | 623 base::ThreadTaskRunnerHandle::Get()->PostTask( |
623 FROM_HERE, | 624 FROM_HERE, |
624 base::Bind(&WebstorePrivateInstallBundleFunction::OnFetchComplete, | 625 base::Bind(&WebstorePrivateInstallBundleFunction::OnFetchComplete, |
625 this, GURL(), nullptr)); | 626 this, GURL(), nullptr)); |
626 } | 627 } |
627 | 628 |
628 AddRef(); // Balanced in OnFetchComplete. | 629 AddRef(); // Balanced in OnFetchComplete. |
629 | 630 |
630 // The response is sent asynchronously in OnFetchComplete, OnInstallApproval, | 631 // The response is sent asynchronously in OnFetchComplete, OnInstallApproval, |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 WebstorePrivateGetEphemeralAppsEnabledFunction:: | 868 WebstorePrivateGetEphemeralAppsEnabledFunction:: |
868 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {} | 869 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {} |
869 | 870 |
870 ExtensionFunction::ResponseAction | 871 ExtensionFunction::ResponseAction |
871 WebstorePrivateGetEphemeralAppsEnabledFunction::Run() { | 872 WebstorePrivateGetEphemeralAppsEnabledFunction::Run() { |
872 return RespondNow(ArgumentList(GetEphemeralAppsEnabled::Results::Create( | 873 return RespondNow(ArgumentList(GetEphemeralAppsEnabled::Results::Create( |
873 EphemeralAppLauncher::IsFeatureEnabled()))); | 874 EphemeralAppLauncher::IsFeatureEnabled()))); |
874 } | 875 } |
875 | 876 |
876 } // namespace extensions | 877 } // namespace extensions |
OLD | NEW |