Replace C-style casts with static_cast.
This commit is contained in:
parent
ff745e1a82
commit
e8abee9ca9
5 changed files with 15 additions and 15 deletions
|
|
@ -78,11 +78,11 @@ void ShowMessageBox(int type,
|
||||||
if (mate::Converter<atom::MessageBoxCallback>::FromV8(args->isolate(),
|
if (mate::Converter<atom::MessageBoxCallback>::FromV8(args->isolate(),
|
||||||
peek,
|
peek,
|
||||||
&callback)) {
|
&callback)) {
|
||||||
atom::ShowMessageBox(window, (atom::MessageBoxType)type, buttons,
|
atom::ShowMessageBox(window, static_cast<atom::MessageBoxType>(type), buttons,
|
||||||
default_id, cancel_id, options, title, message, detail,
|
default_id, cancel_id, options, title, message, detail,
|
||||||
checkbox_label, checkbox_checked, icon, callback);
|
checkbox_label, checkbox_checked, icon, callback);
|
||||||
} else {
|
} else {
|
||||||
int chosen = atom::ShowMessageBox(window, (atom::MessageBoxType)type,
|
int chosen = atom::ShowMessageBox(window, static_cast<atom::MessageBoxType>(type),
|
||||||
buttons, default_id, cancel_id,
|
buttons, default_id, cancel_id,
|
||||||
options, title, message, detail, icon);
|
options, title, message, detail, icon);
|
||||||
args->Return(chosen);
|
args->Return(chosen);
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ std::string Browser::GetExecutableFileProductName() const {
|
||||||
|
|
||||||
int Browser::DockBounce(BounceType type) {
|
int Browser::DockBounce(BounceType type) {
|
||||||
return [[AtomApplication sharedApplication]
|
return [[AtomApplication sharedApplication]
|
||||||
requestUserAttention:(NSRequestUserAttentionType)type];
|
requestUserAttention:static_cast<NSRequestUserAttentionType>(type)];
|
||||||
}
|
}
|
||||||
|
|
||||||
void Browser::DockCancelBounce(int request_id) {
|
void Browser::DockCancelBounce(int request_id) {
|
||||||
|
|
|
||||||
|
|
@ -1358,22 +1358,22 @@ void NativeWindowMac::SetVibrancy(const std::string& type) {
|
||||||
// they are available in the minimum SDK version
|
// they are available in the minimum SDK version
|
||||||
if (type == "selection") {
|
if (type == "selection") {
|
||||||
// NSVisualEffectMaterialSelection
|
// NSVisualEffectMaterialSelection
|
||||||
vibrancyType = (NSVisualEffectMaterial) 4;
|
vibrancyType = static_cast<NSVisualEffectMaterial>( 4);
|
||||||
} else if (type == "menu") {
|
} else if (type == "menu") {
|
||||||
// NSVisualEffectMaterialMenu
|
// NSVisualEffectMaterialMenu
|
||||||
vibrancyType = (NSVisualEffectMaterial) 5;
|
vibrancyType = static_cast<NSVisualEffectMaterial>( 5);
|
||||||
} else if (type == "popover") {
|
} else if (type == "popover") {
|
||||||
// NSVisualEffectMaterialPopover
|
// NSVisualEffectMaterialPopover
|
||||||
vibrancyType = (NSVisualEffectMaterial) 6;
|
vibrancyType = static_cast<NSVisualEffectMaterial>( 6);
|
||||||
} else if (type == "sidebar") {
|
} else if (type == "sidebar") {
|
||||||
// NSVisualEffectMaterialSidebar
|
// NSVisualEffectMaterialSidebar
|
||||||
vibrancyType = (NSVisualEffectMaterial) 7;
|
vibrancyType = static_cast<NSVisualEffectMaterial>( 7);
|
||||||
} else if (type == "medium-light") {
|
} else if (type == "medium-light") {
|
||||||
// NSVisualEffectMaterialMediumLight
|
// NSVisualEffectMaterialMediumLight
|
||||||
vibrancyType = (NSVisualEffectMaterial) 8;
|
vibrancyType = static_cast<NSVisualEffectMaterial>( 8);
|
||||||
} else if (type == "ultra-dark") {
|
} else if (type == "ultra-dark") {
|
||||||
// NSVisualEffectMaterialUltraDark
|
// NSVisualEffectMaterialUltraDark
|
||||||
vibrancyType = (NSVisualEffectMaterial) 9;
|
vibrancyType = static_cast<NSVisualEffectMaterial>( 9);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ void WebContentsPermissionHelper::RequestPermission(
|
||||||
|
|
||||||
void WebContentsPermissionHelper::RequestFullscreenPermission(
|
void WebContentsPermissionHelper::RequestFullscreenPermission(
|
||||||
const base::Callback<void(bool)>& callback) {
|
const base::Callback<void(bool)>& callback) {
|
||||||
RequestPermission((content::PermissionType)(PermissionType::FULLSCREEN),
|
RequestPermission(static_cast<content::PermissionType>(PermissionType::FULLSCREEN),
|
||||||
callback);
|
callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -86,7 +86,7 @@ void WebContentsPermissionHelper::RequestWebNotificationPermission(
|
||||||
|
|
||||||
void WebContentsPermissionHelper::RequestPointerLockPermission(
|
void WebContentsPermissionHelper::RequestPointerLockPermission(
|
||||||
bool user_gesture) {
|
bool user_gesture) {
|
||||||
RequestPermission((content::PermissionType)(PermissionType::POINTER_LOCK),
|
RequestPermission(static_cast<content::PermissionType>(PermissionType::POINTER_LOCK),
|
||||||
base::Bind(&OnPointerLockResponse, web_contents_),
|
base::Bind(&OnPointerLockResponse, web_contents_),
|
||||||
user_gesture);
|
user_gesture);
|
||||||
}
|
}
|
||||||
|
|
@ -94,7 +94,7 @@ void WebContentsPermissionHelper::RequestPointerLockPermission(
|
||||||
void WebContentsPermissionHelper::RequestOpenExternalPermission(
|
void WebContentsPermissionHelper::RequestOpenExternalPermission(
|
||||||
const base::Callback<void(bool)>& callback,
|
const base::Callback<void(bool)>& callback,
|
||||||
bool user_gesture) {
|
bool user_gesture) {
|
||||||
RequestPermission((content::PermissionType)(PermissionType::OPEN_EXTERNAL),
|
RequestPermission(static_cast<content::PermissionType>(PermissionType::OPEN_EXTERNAL),
|
||||||
callback,
|
callback,
|
||||||
user_gesture);
|
user_gesture);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -168,11 +168,11 @@ v8::Local<v8::Value> Converter<content::PermissionType>::ToV8(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val == (content::PermissionType)(PermissionType::POINTER_LOCK))
|
if (val == static_cast<content::PermissionType>(PermissionType::POINTER_LOCK))
|
||||||
return StringToV8(isolate, "pointerLock");
|
return StringToV8(isolate, "pointerLock");
|
||||||
else if (val == (content::PermissionType)(PermissionType::FULLSCREEN))
|
else if (val == static_cast<content::PermissionType>(PermissionType::FULLSCREEN))
|
||||||
return StringToV8(isolate, "fullscreen");
|
return StringToV8(isolate, "fullscreen");
|
||||||
else if (val == (content::PermissionType)(PermissionType::OPEN_EXTERNAL))
|
else if (val == static_cast<content::PermissionType>(PermissionType::OPEN_EXTERNAL))
|
||||||
return StringToV8(isolate, "openExternal");
|
return StringToV8(isolate, "openExternal");
|
||||||
|
|
||||||
return StringToV8(isolate, "unknown");
|
return StringToV8(isolate, "unknown");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue