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

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

Issue 1878153002: Revert of Simplify BrowserContext by removing redundant methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 <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
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"
36 #include "content/public/browser/web_contents.h" 35 #include "content/public/browser/web_contents.h"
37 #include "extensions/browser/extension_registry.h" 36 #include "extensions/browser/extension_registry.h"
38 #include "extensions/browser/extension_system.h" 37 #include "extensions/browser/extension_system.h"
39 #include "extensions/common/extension.h" 38 #include "extensions/common/extension.h"
40 #include "net/base/load_flags.h" 39 #include "net/base/load_flags.h"
41 #include "net/url_request/url_request.h" 40 #include "net/url_request/url_request.h"
42 #include "url/gurl.h" 41 #include "url/gurl.h"
43 42
44 namespace extensions { 43 namespace extensions {
45 44
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 details().id, extensions::ExtensionRegistry::EVERYTHING) != nullptr; 203 details().id, extensions::ExtensionRegistry::EVERYTHING) != nullptr;
205 if (is_installed || tracker->GetActiveInstall(details().id)) { 204 if (is_installed || tracker->GetActiveInstall(details().id)) {
206 return RespondNow(BuildResponse( 205 return RespondNow(BuildResponse(
207 api::webstore_private::RESULT_ALREADY_INSTALLED, 206 api::webstore_private::RESULT_ALREADY_INSTALLED,
208 kAlreadyInstalledError)); 207 kAlreadyInstalledError));
209 } 208 }
210 ActiveInstallData install_data(details().id); 209 ActiveInstallData install_data(details().id);
211 scoped_active_install_.reset(new ScopedActiveInstall(tracker, install_data)); 210 scoped_active_install_.reset(new ScopedActiveInstall(tracker, install_data));
212 211
213 net::URLRequestContextGetter* context_getter = nullptr; 212 net::URLRequestContextGetter* context_getter = nullptr;
214 if (!icon_url.is_empty()) { 213 if (!icon_url.is_empty())
215 context_getter = content::BrowserContext::GetDefaultStoragePartition( 214 context_getter = browser_context()->GetRequestContext();
216 browser_context())->GetURLRequestContext();
217 }
218 215
219 scoped_refptr<WebstoreInstallHelper> helper = new WebstoreInstallHelper( 216 scoped_refptr<WebstoreInstallHelper> helper = new WebstoreInstallHelper(
220 this, details().id, details().manifest, icon_url, context_getter); 217 this, details().id, details().manifest, icon_url, context_getter);
221 218
222 // The helper will call us back via OnWebstoreParseSuccess or 219 // The helper will call us back via OnWebstoreParseSuccess or
223 // OnWebstoreParseFailure. 220 // OnWebstoreParseFailure.
224 helper->Start(); 221 helper->Start();
225 222
226 // Matched with a Release in OnWebstoreParseSuccess/OnWebstoreParseFailure. 223 // Matched with a Release in OnWebstoreParseSuccess/OnWebstoreParseFailure.
227 AddRef(); 224 AddRef();
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 WebstorePrivateGetEphemeralAppsEnabledFunction:: 594 WebstorePrivateGetEphemeralAppsEnabledFunction::
598 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {} 595 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {}
599 596
600 ExtensionFunction::ResponseAction 597 ExtensionFunction::ResponseAction
601 WebstorePrivateGetEphemeralAppsEnabledFunction::Run() { 598 WebstorePrivateGetEphemeralAppsEnabledFunction::Run() {
602 return RespondNow(ArgumentList(GetEphemeralAppsEnabled::Results::Create( 599 return RespondNow(ArgumentList(GetEphemeralAppsEnabled::Results::Create(
603 false))); 600 false)));
604 } 601 }
605 602
606 } // namespace extensions 603 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698