mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-21 14:40:49 +01:00
- Delete include/cef_runnable.h (issue #1336). - Build the cef_unittests target using all Chromium headers. Add a USING_CHROMIUM_INCLUDES define and libcef_dll_wrapper_unittests target to support this. This change avoids compile errors due to the divergence of CEF and Chromium base/ header implementations. The libcef_dll_wrapper sources must now compile successfully with both CEF and Chromium base/ headers (issue #1632). - The onbeforeunload message specified via JavaScript is no longer passed to the client (see http://crbug.com/587940).
52 lines
1.7 KiB
C++
52 lines
1.7 KiB
C++
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "libcef/browser/permissions/permission_util.h"
|
|
|
|
#include "base/logging.h"
|
|
|
|
using content::PermissionType;
|
|
|
|
namespace permission_util {
|
|
|
|
ContentSettingsType PermissionTypeToContentSetting(PermissionType permission) {
|
|
switch (permission) {
|
|
case PermissionType::MIDI_SYSEX:
|
|
return CONTENT_SETTINGS_TYPE_MIDI_SYSEX;
|
|
case PermissionType::PUSH_MESSAGING:
|
|
return CONTENT_SETTINGS_TYPE_PUSH_MESSAGING;
|
|
case PermissionType::NOTIFICATIONS:
|
|
return CONTENT_SETTINGS_TYPE_NOTIFICATIONS;
|
|
case PermissionType::GEOLOCATION:
|
|
return CONTENT_SETTINGS_TYPE_GEOLOCATION;
|
|
case PermissionType::PROTECTED_MEDIA_IDENTIFIER:
|
|
#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
|
|
return CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER;
|
|
#else
|
|
NOTIMPLEMENTED();
|
|
break;
|
|
#endif
|
|
case PermissionType::DURABLE_STORAGE:
|
|
return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE;
|
|
case PermissionType::MIDI:
|
|
// This will hit the NOTREACHED below.
|
|
break;
|
|
case PermissionType::AUDIO_CAPTURE:
|
|
return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC;
|
|
case PermissionType::VIDEO_CAPTURE:
|
|
return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA;
|
|
case PermissionType::BACKGROUND_SYNC:
|
|
return CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC;
|
|
case PermissionType::NUM:
|
|
// This will hit the NOTREACHED below.
|
|
break;
|
|
}
|
|
|
|
NOTREACHED() << "Unknown content setting for permission "
|
|
<< static_cast<int>(permission);
|
|
return CONTENT_SETTINGS_TYPE_DEFAULT;
|
|
}
|
|
|
|
} // namespace permission_util
|