#include "chrome/browser/extensions/api/file_system/file_system_api.h"
+#include "apps/app_window.h"
+#include "apps/app_window_registry.h"
#include "apps/saved_files_service.h"
-#include "apps/shell_window.h"
-#include "apps/shell_window_registry.h"
#include "base/bind.h"
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/values.h"
#include "chrome/browser/extensions/api/file_handlers/app_file_handler_util.h"
#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/apps/directory_access_confirmation_dialog.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
+#include "extensions/browser/extension_system.h"
#include "extensions/common/permissions/api_permission.h"
#include "grit/generated_resources.h"
#include "net/base/mime_util.h"
using apps::SavedFileEntry;
using apps::SavedFilesService;
-using apps::ShellWindow;
+using apps::AppWindow;
using fileapi::IsolatedContext;
const char kInvalidCallingPage[] = "Invalid calling page. This function can't "
// platform-app only.
content::WebContents* web_contents = NULL;
if (extension_->is_platform_app()) {
- apps::ShellWindowRegistry* registry =
- apps::ShellWindowRegistry::Get(GetProfile());
+ apps::AppWindowRegistry* registry =
+ apps::AppWindowRegistry::Get(GetProfile());
DCHECK(registry);
- ShellWindow* shell_window = registry->GetShellWindowForRenderViewHost(
- render_view_host());
- if (!shell_window) {
+ AppWindow* app_window =
+ registry->GetAppWindowForRenderViewHost(render_view_host());
+ if (!app_window) {
error_ = kInvalidCallingPage;
SendResponse(false);
return;
}
- web_contents = shell_window->web_contents();
+ web_contents = app_window->web_contents();
} else {
web_contents = GetAssociatedWebContents();
}
if (is_directory_) {
// Get the WebContents for the app window to be the parent window of the
// confirmation dialog if necessary.
- apps::ShellWindowRegistry* registry =
- apps::ShellWindowRegistry::Get(GetProfile());
+ apps::AppWindowRegistry* registry =
+ apps::AppWindowRegistry::Get(GetProfile());
DCHECK(registry);
- ShellWindow* shell_window = registry->GetShellWindowForRenderViewHost(
- render_view_host());
- if (!shell_window) {
+ AppWindow* app_window =
+ registry->GetAppWindowForRenderViewHost(render_view_host());
+ if (!app_window) {
error_ = kInvalidCallingPage;
SendResponse(false);
return;
}
- content::WebContents* web_contents = shell_window->web_contents();
+ content::WebContents* web_contents = app_window->web_contents();
content::BrowserThread::PostTask(
content::BrowserThread::FILE,