13551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file.
42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
53551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)#include "content/shell/browser/shell_quota_permission_context.h"
62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
71320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "storage/common/quota/quota_types.h"
82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace content {
102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)ShellQuotaPermissionContext::ShellQuotaPermissionContext() {}
122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)void ShellQuotaPermissionContext::RequestQuotaPermission(
14c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch    const StorageQuotaParams& params,
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    int render_process_id,
162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    const PermissionCallback& callback) {
1703b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)  if (params.storage_type != storage::kStorageTypePersistent) {
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    // For now we only support requesting quota with this interface
192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    // for Persistent storage type.
202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    return;
222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  }
232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  callback.Run(QUOTA_PERMISSION_RESPONSE_ALLOW);
252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}
262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)ShellQuotaPermissionContext::~ShellQuotaPermissionContext() {}
282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}  // namespace content
30