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

Unified Diff: chrome/browser/extensions/api/file_system/consent_provider.cc

Issue 2934143002: Move chrome.fileSystem implementation to //extensions (Closed)
Patch Set: devlin Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/file_system/consent_provider.cc
diff --git a/chrome/browser/extensions/api/file_system/consent_provider.cc b/chrome/browser/extensions/api/file_system/consent_provider.cc
index 3f7decec0545967aaec45341650b473ed8a538dc..5871bc6b6b2478745eba0f6d7cbb78714505e8fa 100644
--- a/chrome/browser/extensions/api/file_system/consent_provider.cc
+++ b/chrome/browser/extensions/api/file_system/consent_provider.cc
@@ -17,12 +17,12 @@
#include "chrome/browser/extensions/api/file_system/request_file_system_notification.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/views/extensions/request_file_system_dialog_view.h"
-#include "chrome/common/extensions/api/file_system.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/app_window/app_window.h"
#include "extensions/browser/app_window/app_window_registry.h"
+#include "extensions/common/api/file_system.h"
#include "extensions/common/manifest_handlers/kiosk_mode_info.h"
namespace extensions {
@@ -85,6 +85,7 @@ ConsentProvider::~ConsentProvider() {
void ConsentProvider::RequestConsent(
const Extension& extension,
+ content::RenderFrameHost* host,
const base::WeakPtr<file_manager::Volume>& volume,
bool writable,
const ConsentCallback& callback) {
@@ -111,7 +112,7 @@ void ConsentProvider::RequestConsent(
// the confirmation dialog.
if (KioskModeInfo::IsKioskOnly(&extension) &&
user_manager::UserManager::Get()->IsLoggedInAsKioskApp()) {
- delegate_->ShowDialog(extension, volume, writable,
+ delegate_->ShowDialog(extension, host, volume, writable,
base::Bind(&DialogResultToConsent, callback));
return;
}
@@ -130,9 +131,8 @@ bool ConsentProvider::IsGrantable(const Extension& extension) {
return is_whitelisted_component || is_running_in_kiosk_session;
}
-ConsentProviderDelegate::ConsentProviderDelegate(Profile* profile,
- content::RenderFrameHost* host)
- : profile_(profile), host_(host) {
+ConsentProviderDelegate::ConsentProviderDelegate(Profile* profile)
+ : profile_(profile) {
DCHECK(profile_);
}
@@ -147,15 +147,16 @@ void ConsentProviderDelegate::SetAutoDialogButtonForTest(
void ConsentProviderDelegate::ShowDialog(
const Extension& extension,
+ content::RenderFrameHost* host,
const base::WeakPtr<file_manager::Volume>& volume,
bool writable,
const file_system_api::ConsentProvider::ShowDialogCallback& callback) {
- DCHECK(host_);
+ DCHECK(host);
content::WebContents* web_contents = nullptr;
// Find an app window to host the dialog.
content::WebContents* const foreground_contents =
- content::WebContents::FromRenderFrameHost(host_);
+ content::WebContents::FromRenderFrameHost(host);
if (AppWindowRegistry::Get(profile_)->GetAppWindowForWebContents(
foreground_contents)) {
web_contents = foreground_contents;

Powered by Google App Engine
This is Rietveld 408576698