libcef: Convert NULL to nullptr (see issue #2861)

This commit is contained in:
Marshall Greenblatt
2020-01-15 14:36:24 +01:00
parent c05c3e4065
commit ea63799c3e
98 changed files with 538 additions and 527 deletions

View File

@@ -382,7 +382,7 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateWheelEvent(
CefEventHandle CefBrowserPlatformDelegateNativeLinux::GetEventHandle(
const content::NativeWebKeyboardEvent& event) const {
if (!event.os_event)
return NULL;
return nullptr;
return const_cast<CefEventHandle>(
static_cast<CefEventHandle>(event.os_event->native_event()));
}

View File

@@ -32,7 +32,7 @@ void Menu2::CancelMenu() {
}
void Menu2::Rebuild() {
wrapper_->Rebuild(NULL);
wrapper_->Rebuild(nullptr);
}
void Menu2::UpdateStates() {

View File

@@ -26,7 +26,7 @@ bool CefMenuRunnerLinux::RunContextMenu(
if (!browser->IsWindowless())
parent_widget = browser->GetWindowWidget();
menu_->RunMenuAt(parent_widget, NULL, gfx::Rect(screen_point, gfx::Size()),
menu_->RunMenuAt(parent_widget, nullptr, gfx::Rect(screen_point, gfx::Size()),
views::MenuAnchorPosition::kTopRight, ui::MENU_SOURCE_NONE);
return true;

View File

@@ -18,8 +18,8 @@ bool CefMenuRunnerWin::RunContextMenu(
CefMenuModelImpl* model,
const content::ContextMenuParams& params) {
// Create a menu based on the model.
menu_.reset(new views::CefNativeMenuWin(model->model(), NULL));
menu_->Rebuild(NULL);
menu_.reset(new views::CefNativeMenuWin(model->model(), nullptr));
menu_->Rebuild(nullptr);
// Make sure events can be pumped while the menu is up.
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;

View File

@@ -401,7 +401,7 @@ class CefNativeMenuWin::MenuHostWindow {
struct CefNativeMenuWin::HighlightedMenuItemInfo {
HighlightedMenuItemInfo()
: has_parent(false), has_submenu(false), menu(NULL), position(-1) {}
: has_parent(false), has_submenu(false), menu(nullptr), position(-1) {}
bool has_parent;
bool has_submenu;
@@ -420,16 +420,16 @@ const wchar_t* CefNativeMenuWin::MenuHostWindow::kWindowClassName =
CefNativeMenuWin::CefNativeMenuWin(ui::MenuModel* model, HWND system_menu_for)
: model_(model),
menu_(NULL),
menu_(nullptr),
owner_draw_(l10n_util::NeedOverrideDefaultUIFont(NULL, NULL) &&
!system_menu_for),
system_menu_for_(system_menu_for),
first_item_index_(0),
menu_action_(MENU_ACTION_NONE),
menu_to_select_(NULL),
menu_to_select_(nullptr),
position_to_select_(-1),
parent_(NULL),
destroyed_flag_(NULL),
parent_(nullptr),
destroyed_flag_(nullptr),
menu_to_select_factory_(this) {}
CefNativeMenuWin::~CefNativeMenuWin() {
@@ -458,7 +458,7 @@ void CefNativeMenuWin::RunMenuAt(const gfx::Point& point, int alignment) {
// Command dispatch is done through WM_MENUCOMMAND, handled by the host
// window.
menu_to_select_ = NULL;
menu_to_select_ = nullptr;
position_to_select_ = -1;
menu_to_select_factory_.InvalidateWeakPtrs();
bool destroyed = false;
@@ -467,10 +467,10 @@ void CefNativeMenuWin::RunMenuAt(const gfx::Point& point, int alignment) {
TrackPopupMenu(menu_, flags, point.x(), point.y(), 0, host_window_->hwnd(),
NULL);
UnhookWindowsHookEx(hhook);
open_native_menu_win_ = NULL;
open_native_menu_win_ = nullptr;
if (destroyed)
return;
destroyed_flag_ = NULL;
destroyed_flag_ = nullptr;
if (menu_to_select_) {
// Folks aren't too happy if we notify immediately. In particular, notifying
// the delegate can cause destruction leaving the stack in a weird
@@ -542,7 +542,7 @@ void CefNativeMenuWin::SetMinimumWidth(int width) {
// CefNativeMenuWin, private:
// static
CefNativeMenuWin* CefNativeMenuWin::open_native_menu_win_ = NULL;
CefNativeMenuWin* CefNativeMenuWin::open_native_menu_win_ = nullptr;
void CefNativeMenuWin::DelayedSelect() {
if (menu_to_select_)

View File

@@ -17,7 +17,7 @@ CefWindowDelegateView::CefWindowDelegateView(
bool always_on_top,
base::RepeatingClosure on_bounds_changed)
: background_color_(background_color),
web_view_(NULL),
web_view_(nullptr),
always_on_top_(always_on_top),
on_bounds_changed_(on_bounds_changed) {}

View File

@@ -53,7 +53,7 @@ const char kUTF8String[] = "UTF8_STRING";
::Window top_level_window = window;
::Window root = x11::None;
::Window parent = x11::None;
::Window* children = NULL;
::Window* children = nullptr;
unsigned int nchildren = 0;
// Enumerate all parents of "window" to find the highest level window
// that either:
@@ -77,7 +77,7 @@ const char kUTF8String[] = "UTF8_STRING";
CEF_EXPORT XDisplay* cef_get_xdisplay() {
if (!CEF_CURRENTLY_ON(CEF_UIT))
return NULL;
return nullptr;
return gfx::GetXDisplay();
}
@@ -280,7 +280,7 @@ views::DesktopWindowTreeHostX11* CefWindowX11::GetHost() {
views::DesktopWindowTreeHostLinux::GetHostForWidget(child));
}
}
return NULL;
return nullptr;
}
bool CefWindowX11::CanDispatchEvent(const ui::PlatformEvent& event) {