refactor: use C++11 class member variable initialization (#27477)

This commit is contained in:
Milan Burda 2021-01-26 19:16:21 +01:00 committed by GitHub
parent f083380c38
commit ddf3ef0a5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
93 changed files with 130 additions and 163 deletions

View file

@ -31,7 +31,7 @@ void AutofillPopupChildView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
AutofillPopupView::AutofillPopupView(AutofillPopup* popup,
views::Widget* parent_widget)
: popup_(popup), parent_widget_(parent_widget), weak_ptr_factory_(this) {
: popup_(popup), parent_widget_(parent_widget) {
CreateChildViews();
SetFocusBehavior(FocusBehavior::ALWAYS);
set_drag_controller(this);

View file

@ -147,7 +147,7 @@ class AutofillPopupView : public views::WidgetDelegateView,
// key presses
content::RenderWidgetHost::KeyPressEventCallback keypress_callback_;
base::WeakPtrFactory<AutofillPopupView> weak_ptr_factory_;
base::WeakPtrFactory<AutofillPopupView> weak_ptr_factory_{this};
};
} // namespace electron

View file

@ -81,11 +81,7 @@ InspectableWebContentsView* CreateInspectableContentsView(
InspectableWebContentsViewViews::InspectableWebContentsViewViews(
InspectableWebContents* inspectable_web_contents)
: inspectable_web_contents_(inspectable_web_contents),
devtools_window_web_view_(nullptr),
contents_web_view_(nullptr),
devtools_web_view_(new views::WebView(nullptr)),
devtools_visible_(false),
devtools_window_delegate_(nullptr),
title_(base::ASCIIToUTF16("Developer Tools")) {
if (!inspectable_web_contents_->IsGuest() &&
inspectable_web_contents_->GetWebContents()->GetNativeView()) {

View file

@ -55,13 +55,13 @@ class InspectableWebContentsViewViews : public InspectableWebContentsView,
InspectableWebContents* inspectable_web_contents_;
std::unique_ptr<views::Widget> devtools_window_;
views::WebView* devtools_window_web_view_;
views::View* contents_web_view_;
views::WebView* devtools_web_view_;
views::WebView* devtools_window_web_view_ = nullptr;
views::View* contents_web_view_ = nullptr;
views::WebView* devtools_web_view_ = nullptr;
DevToolsContentsResizingStrategy strategy_;
bool devtools_visible_;
views::WidgetDelegate* devtools_window_delegate_;
bool devtools_visible_ = false;
views::WidgetDelegate* devtools_window_delegate_ = nullptr;
base::string16 title_;
DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsViewViews);

View file

@ -18,8 +18,7 @@
namespace electron {
MenuDelegate::MenuDelegate(MenuBar* menu_bar)
: menu_bar_(menu_bar), id_(-1), hold_first_switch_(false) {}
MenuDelegate::MenuDelegate(MenuBar* menu_bar) : menu_bar_(menu_bar) {}
MenuDelegate::~MenuDelegate() = default;

View file

@ -62,13 +62,13 @@ class MenuDelegate : public views::MenuDelegate {
private:
MenuBar* menu_bar_;
int id_;
int id_ = -1;
std::unique_ptr<views::MenuDelegate> adapter_;
std::unique_ptr<views::MenuRunner> menu_runner_;
// The menu button to switch to.
views::MenuButton* button_to_open_ = nullptr;
bool hold_first_switch_;
bool hold_first_switch_ = false;
base::ObserverList<Observer>::Unchecked observers_;