| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/browser/gpu/gpu_feature_checker.h" | 25 #include "chrome/browser/gpu/gpu_feature_checker.h" |
| 26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 27 #include "chrome/browser/signin/signin_manager_factory.h" | 27 #include "chrome/browser/signin/signin_manager_factory.h" |
| 28 #include "chrome/browser/ui/app_list/app_list_service.h" | 28 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 29 #include "chrome/browser/ui/app_list/app_list_util.h" | 29 #include "chrome/browser/ui/app_list/app_list_util.h" |
| 30 #include "chrome/common/extensions/extension_constants.h" | 30 #include "chrome/common/extensions/extension_constants.h" |
| 31 #include "chrome/common/pref_names.h" | 31 #include "chrome/common/pref_names.h" |
| 32 #include "components/crx_file/id_util.h" | 32 #include "components/crx_file/id_util.h" |
| 33 #include "components/prefs/pref_service.h" | 33 #include "components/prefs/pref_service.h" |
| 34 #include "components/signin/core/browser/signin_manager.h" | 34 #include "components/signin/core/browser/signin_manager.h" |
| 35 #include "content/public/browser/storage_partition.h" |
| 35 #include "content/public/browser/web_contents.h" | 36 #include "content/public/browser/web_contents.h" |
| 36 #include "extensions/browser/extension_registry.h" | 37 #include "extensions/browser/extension_registry.h" |
| 37 #include "extensions/browser/extension_system.h" | 38 #include "extensions/browser/extension_system.h" |
| 38 #include "extensions/common/extension.h" | 39 #include "extensions/common/extension.h" |
| 39 #include "net/base/load_flags.h" | 40 #include "net/base/load_flags.h" |
| 40 #include "net/url_request/url_request.h" | 41 #include "net/url_request/url_request.h" |
| 41 #include "url/gurl.h" | 42 #include "url/gurl.h" |
| 42 | 43 |
| 43 namespace extensions { | 44 namespace extensions { |
| 44 | 45 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 details().id, extensions::ExtensionRegistry::EVERYTHING) != nullptr; | 204 details().id, extensions::ExtensionRegistry::EVERYTHING) != nullptr; |
| 204 if (is_installed || tracker->GetActiveInstall(details().id)) { | 205 if (is_installed || tracker->GetActiveInstall(details().id)) { |
| 205 return RespondNow(BuildResponse( | 206 return RespondNow(BuildResponse( |
| 206 api::webstore_private::RESULT_ALREADY_INSTALLED, | 207 api::webstore_private::RESULT_ALREADY_INSTALLED, |
| 207 kAlreadyInstalledError)); | 208 kAlreadyInstalledError)); |
| 208 } | 209 } |
| 209 ActiveInstallData install_data(details().id); | 210 ActiveInstallData install_data(details().id); |
| 210 scoped_active_install_.reset(new ScopedActiveInstall(tracker, install_data)); | 211 scoped_active_install_.reset(new ScopedActiveInstall(tracker, install_data)); |
| 211 | 212 |
| 212 net::URLRequestContextGetter* context_getter = nullptr; | 213 net::URLRequestContextGetter* context_getter = nullptr; |
| 213 if (!icon_url.is_empty()) | 214 if (!icon_url.is_empty()) { |
| 214 context_getter = browser_context()->GetRequestContext(); | 215 context_getter = content::BrowserContext::GetDefaultStoragePartition( |
| 216 browser_context())->GetURLRequestContext(); |
| 217 } |
| 215 | 218 |
| 216 scoped_refptr<WebstoreInstallHelper> helper = new WebstoreInstallHelper( | 219 scoped_refptr<WebstoreInstallHelper> helper = new WebstoreInstallHelper( |
| 217 this, details().id, details().manifest, icon_url, context_getter); | 220 this, details().id, details().manifest, icon_url, context_getter); |
| 218 | 221 |
| 219 // The helper will call us back via OnWebstoreParseSuccess or | 222 // The helper will call us back via OnWebstoreParseSuccess or |
| 220 // OnWebstoreParseFailure. | 223 // OnWebstoreParseFailure. |
| 221 helper->Start(); | 224 helper->Start(); |
| 222 | 225 |
| 223 // Matched with a Release in OnWebstoreParseSuccess/OnWebstoreParseFailure. | 226 // Matched with a Release in OnWebstoreParseSuccess/OnWebstoreParseFailure. |
| 224 AddRef(); | 227 AddRef(); |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 WebstorePrivateGetEphemeralAppsEnabledFunction:: | 597 WebstorePrivateGetEphemeralAppsEnabledFunction:: |
| 595 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {} | 598 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {} |
| 596 | 599 |
| 597 ExtensionFunction::ResponseAction | 600 ExtensionFunction::ResponseAction |
| 598 WebstorePrivateGetEphemeralAppsEnabledFunction::Run() { | 601 WebstorePrivateGetEphemeralAppsEnabledFunction::Run() { |
| 599 return RespondNow(ArgumentList(GetEphemeralAppsEnabled::Results::Create( | 602 return RespondNow(ArgumentList(GetEphemeralAppsEnabled::Results::Create( |
| 600 false))); | 603 false))); |
| 601 } | 604 } |
| 602 | 605 |
| 603 } // namespace extensions | 606 } // namespace extensions |
| OLD | NEW |