mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update source files for bracket style
This commit is contained in:
@ -33,18 +33,24 @@ CefContextMenuParamsImpl::TypeFlags CefContextMenuParamsImpl::GetTypeFlags() {
|
||||
CEF_VALUE_VERIFY_RETURN(false, CM_TYPEFLAG_NONE);
|
||||
const content::ContextMenuParams& params = const_value();
|
||||
int type_flags = CM_TYPEFLAG_NONE;
|
||||
if (!params.page_url.is_empty())
|
||||
if (!params.page_url.is_empty()) {
|
||||
type_flags |= CM_TYPEFLAG_PAGE;
|
||||
if (!params.frame_url.is_empty())
|
||||
}
|
||||
if (!params.frame_url.is_empty()) {
|
||||
type_flags |= CM_TYPEFLAG_FRAME;
|
||||
if (!params.link_url.is_empty())
|
||||
}
|
||||
if (!params.link_url.is_empty()) {
|
||||
type_flags |= CM_TYPEFLAG_LINK;
|
||||
if (params.media_type != blink::mojom::ContextMenuDataMediaType::kNone)
|
||||
}
|
||||
if (params.media_type != blink::mojom::ContextMenuDataMediaType::kNone) {
|
||||
type_flags |= CM_TYPEFLAG_MEDIA;
|
||||
if (!params.selection_text.empty())
|
||||
}
|
||||
if (!params.selection_text.empty()) {
|
||||
type_flags |= CM_TYPEFLAG_SELECTION;
|
||||
if (params.is_editable)
|
||||
}
|
||||
if (params.is_editable) {
|
||||
type_flags |= CM_TYPEFLAG_EDITABLE;
|
||||
}
|
||||
return static_cast<TypeFlags>(type_flags);
|
||||
}
|
||||
|
||||
@ -113,16 +119,19 @@ bool CefContextMenuParamsImpl::GetDictionarySuggestions(
|
||||
std::vector<CefString>& suggestions) {
|
||||
CEF_VALUE_VERIFY_RETURN(false, false);
|
||||
|
||||
if (!suggestions.empty())
|
||||
if (!suggestions.empty()) {
|
||||
suggestions.clear();
|
||||
}
|
||||
|
||||
if (const_value().dictionary_suggestions.empty())
|
||||
if (const_value().dictionary_suggestions.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::u16string>::const_iterator it =
|
||||
const_value().dictionary_suggestions.begin();
|
||||
for (; it != const_value().dictionary_suggestions.end(); ++it)
|
||||
for (; it != const_value().dictionary_suggestions.end(); ++it) {
|
||||
suggestions.push_back(*it);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user