permission_request_utils.h 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef WEBLAYER_BROWSER_ANDROID_PERMISSION_REQUEST_UTILS_H_
  5. #define WEBLAYER_BROWSER_ANDROID_PERMISSION_REQUEST_UTILS_H_
  6. #include <vector>
  7. #include "base/callback_forward.h"
  8. #include "components/content_settings/core/common/content_settings_types.h"
  9. namespace content {
  10. class WebContents;
  11. }
  12. namespace weblayer {
  13. using PermissionsUpdatedCallback = base::OnceCallback<void(bool)>;
  14. // Requests all necessary Android permissions related to
  15. // |content_settings_types|, and calls |callback|. |callback| will be called
  16. // with true if all permissions were successfully granted, and false otherwise.
  17. void RequestAndroidPermissions(
  18. content::WebContents* web_contents,
  19. const std::vector<ContentSettingsType>& content_settings_type,
  20. PermissionsUpdatedCallback callback);
  21. } // namespace weblayer
  22. #endif // WEBLAYER_BROWSER_ANDROID_PERMISSION_REQUEST_UTILS_H_