Commit 3e9df476 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Remove unnecessary use of Profile from InstallableManager.

BrowserContext is sufficient and is one step closer to componentizing
the class.

Bug: 1147276
Change-Id: Ifa05a35c71ca601a52c54d7a428f54f0abdc149e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527856Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827136}
parent e1cb574e
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "base/threading/sequenced_task_runner_handle.h" #include "base/threading/sequenced_task_runner_handle.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/installable/installable_metrics.h" #include "chrome/browser/installable/installable_metrics.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ssl/security_state_tab_helper.h" #include "chrome/browser/ssl/security_state_tab_helper.h"
#include "components/security_state/core/security_state.h" #include "components/security_state/core/security_state.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
...@@ -252,8 +251,7 @@ InstallableManager::InstallableManager(content::WebContents* web_contents) ...@@ -252,8 +251,7 @@ InstallableManager::InstallableManager(content::WebContents* web_contents)
if (web_contents) { if (web_contents) {
content::StoragePartition* storage_partition = content::StoragePartition* storage_partition =
content::BrowserContext::GetStoragePartition( content::BrowserContext::GetStoragePartition(
Profile::FromBrowserContext(web_contents->GetBrowserContext()), web_contents->GetBrowserContext(), web_contents->GetSiteInstance());
web_contents->GetSiteInstance());
DCHECK(storage_partition); DCHECK(storage_partition);
service_worker_context_ = storage_partition->GetServiceWorkerContext(); service_worker_context_ = storage_partition->GetServiceWorkerContext();
...@@ -591,8 +589,7 @@ void InstallableManager::WorkOnTask() { ...@@ -591,8 +589,7 @@ void InstallableManager::WorkOnTask() {
void InstallableManager::CheckEligiblity() { void InstallableManager::CheckEligiblity() {
// Fail if this is an incognito window, non-main frame, or insecure context. // Fail if this is an incognito window, non-main frame, or insecure context.
content::WebContents* web_contents = GetWebContents(); content::WebContents* web_contents = GetWebContents();
if (Profile::FromBrowserContext(web_contents->GetBrowserContext()) if (web_contents->GetBrowserContext()->IsOffTheRecord()) {
->IsOffTheRecord()) {
eligibility_->errors.push_back(IN_INCOGNITO); eligibility_->errors.push_back(IN_INCOGNITO);
} }
if (!IsContentSecure(web_contents)) { if (!IsContentSecure(web_contents)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment