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

Side by Side Diff: chrome/browser/extensions/api/dashboard_private/dashboard_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/dashboard_private/dashboard_private_api. h" 5 #include "chrome/browser/extensions/api/dashboard_private/dashboard_private_api. h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
11 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" 11 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "components/crx_file/id_util.h" 13 #include "components/crx_file/id_util.h"
14 #include "content/public/browser/storage_partition.h"
15 #include "extensions/common/extension.h" 14 #include "extensions/common/extension.h"
16 #include "net/base/load_flags.h" 15 #include "net/base/load_flags.h"
17 #include "net/url_request/url_request.h" 16 #include "net/url_request/url_request.h"
18 #include "url/gurl.h" 17 #include "url/gurl.h"
19 18
20 namespace extensions { 19 namespace extensions {
21 20
22 namespace ShowPermissionPromptForDelegatedInstall = 21 namespace ShowPermissionPromptForDelegatedInstall =
23 api::dashboard_private::ShowPermissionPromptForDelegatedInstall; 22 api::dashboard_private::ShowPermissionPromptForDelegatedInstall;
24 23
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (params_->details.icon_url) { 67 if (params_->details.icon_url) {
69 icon_url = source_url().Resolve(*params_->details.icon_url); 68 icon_url = source_url().Resolve(*params_->details.icon_url);
70 if (!icon_url.is_valid()) { 69 if (!icon_url.is_valid()) {
71 return RespondNow(BuildResponse( 70 return RespondNow(BuildResponse(
72 api::dashboard_private::RESULT_INVALID_ICON_URL, 71 api::dashboard_private::RESULT_INVALID_ICON_URL,
73 kInvalidIconUrlError)); 72 kInvalidIconUrlError));
74 } 73 }
75 } 74 }
76 75
77 net::URLRequestContextGetter* context_getter = nullptr; 76 net::URLRequestContextGetter* context_getter = nullptr;
78 if (!icon_url.is_empty()) { 77 if (!icon_url.is_empty())
79 context_getter = 78 context_getter = browser_context()->GetRequestContext();
80 content::BrowserContext::GetDefaultStoragePartition(browser_context())->
81 GetURLRequestContext();
82 }
83 79
84 scoped_refptr<WebstoreInstallHelper> helper = new WebstoreInstallHelper( 80 scoped_refptr<WebstoreInstallHelper> helper = new WebstoreInstallHelper(
85 this, params_->details.id, params_->details.manifest, icon_url, 81 this, params_->details.id, params_->details.manifest, icon_url,
86 context_getter); 82 context_getter);
87 83
88 // The helper will call us back via OnWebstoreParseSuccess or 84 // The helper will call us back via OnWebstoreParseSuccess or
89 // OnWebstoreParseFailure. 85 // OnWebstoreParseFailure.
90 helper->Start(); 86 helper->Start();
91 87
92 // Matched with a Release in OnWebstoreParseSuccess/OnWebstoreParseFailure. 88 // Matched with a Release in OnWebstoreParseSuccess/OnWebstoreParseFailure.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 } 180 }
185 181
186 std::unique_ptr<base::ListValue> 182 std::unique_ptr<base::ListValue>
187 DashboardPrivateShowPermissionPromptForDelegatedInstallFunction::CreateResults( 183 DashboardPrivateShowPermissionPromptForDelegatedInstallFunction::CreateResults(
188 api::dashboard_private::Result result) const { 184 api::dashboard_private::Result result) const {
189 return ShowPermissionPromptForDelegatedInstall::Results::Create(result); 185 return ShowPermissionPromptForDelegatedInstall::Results::Create(result);
190 } 186 }
191 187
192 } // namespace extensions 188 } // namespace extensions
193 189
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698