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

Side by Side Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc

Issue 1097383005: Add possibility to define data callback to BitmapFetcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@r479598_extensions_content_verifier_directories_fail
Patch Set: Another approach - split Start to Init and Start Created 5 years, 8 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
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/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/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 if (params_->contents.empty()) 609 if (params_->contents.empty())
610 return RespondNow(Error(kInvalidBundleError)); 610 return RespondNow(Error(kInvalidBundleError));
611 611
612 if (params_->details.icon_url) { 612 if (params_->details.icon_url) {
613 GURL icon_url = source_url().Resolve(*params_->details.icon_url); 613 GURL icon_url = source_url().Resolve(*params_->details.icon_url);
614 if (!icon_url.is_valid()) 614 if (!icon_url.is_valid())
615 return RespondNow(Error(kInvalidIconUrlError)); 615 return RespondNow(Error(kInvalidIconUrlError));
616 616
617 // The bitmap fetcher will call us back via OnFetchComplete. 617 // The bitmap fetcher will call us back via OnFetchComplete.
618 icon_fetcher_.reset(new chrome::BitmapFetcher(icon_url, this)); 618 icon_fetcher_.reset(new chrome::BitmapFetcher(icon_url, this));
619 icon_fetcher_->Start( 619 icon_fetcher_->Init(
620 browser_context()->GetRequestContext(), std::string(), 620 browser_context()->GetRequestContext(), std::string(),
621 net::URLRequest::CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, 621 net::URLRequest::CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
622 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES); 622 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES);
623 icon_fetcher_->Start();
623 } else { 624 } else {
624 base::MessageLoopProxy::current()->PostTask( 625 base::MessageLoopProxy::current()->PostTask(
625 FROM_HERE, 626 FROM_HERE,
626 base::Bind(&WebstorePrivateInstallBundleFunction::OnFetchComplete, 627 base::Bind(&WebstorePrivateInstallBundleFunction::OnFetchComplete,
627 this, GURL(), nullptr)); 628 this, GURL(), nullptr));
628 } 629 }
629 630
630 AddRef(); // Balanced in OnFetchComplete. 631 AddRef(); // Balanced in OnFetchComplete.
631 632
632 // The response is sent asynchronously in OnFetchComplete, OnInstallApproval, 633 // The response is sent asynchronously in OnFetchComplete, OnInstallApproval,
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 WebstorePrivateGetEphemeralAppsEnabledFunction:: 870 WebstorePrivateGetEphemeralAppsEnabledFunction::
870 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {} 871 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {}
871 872
872 ExtensionFunction::ResponseAction 873 ExtensionFunction::ResponseAction
873 WebstorePrivateGetEphemeralAppsEnabledFunction::Run() { 874 WebstorePrivateGetEphemeralAppsEnabledFunction::Run() {
874 return RespondNow(ArgumentList(GetEphemeralAppsEnabled::Results::Create( 875 return RespondNow(ArgumentList(GetEphemeralAppsEnabled::Results::Create(
875 EphemeralAppLauncher::IsFeatureEnabled()))); 876 EphemeralAppLauncher::IsFeatureEnabled())));
876 } 877 }
877 878
878 } // namespace extensions 879 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698