chore: use auto to avoid repeating type (#26113)
This commit is contained in:
parent
f714556a12
commit
4be10523e8
25 changed files with 38 additions and 48 deletions
|
@ -73,7 +73,7 @@ void AutofillPopupView::Show() {
|
|||
// The widget is destroyed by the corresponding NativeWidget, so we use
|
||||
// a weak pointer to hold the reference and don't have to worry about
|
||||
// deletion.
|
||||
views::Widget* widget = new views::Widget;
|
||||
auto* widget = new views::Widget;
|
||||
views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
|
||||
params.delegate = this;
|
||||
params.parent = parent_widget_->GetNativeView();
|
||||
|
|
|
@ -89,7 +89,7 @@ InspectableWebContentsViewViews::InspectableWebContentsViewViews(
|
|||
title_(base::ASCIIToUTF16("Developer Tools")) {
|
||||
if (!inspectable_web_contents_->IsGuest() &&
|
||||
inspectable_web_contents_->GetWebContents()->GetNativeView()) {
|
||||
views::WebView* contents_web_view = new views::WebView(nullptr);
|
||||
auto* contents_web_view = new views::WebView(nullptr);
|
||||
contents_web_view->SetWebContents(
|
||||
inspectable_web_contents_->GetWebContents());
|
||||
contents_web_view_ = contents_web_view;
|
||||
|
|
|
@ -272,7 +272,7 @@ void MenuBar::ButtonPressed(views::Button* source, const ui::Event& event) {
|
|||
}
|
||||
|
||||
// Deleted in MenuDelegate::OnMenuClosed
|
||||
MenuDelegate* menu_delegate = new MenuDelegate(this);
|
||||
auto* menu_delegate = new MenuDelegate(this);
|
||||
menu_delegate->RunMenu(
|
||||
menu_model_->GetSubmenuModelAt(id), source,
|
||||
event.IsKeyEvent() ? ui::MENU_SOURCE_KEYBOARD : ui::MENU_SOURCE_MOUSE);
|
||||
|
|
|
@ -39,7 +39,7 @@ void MenuDelegate::RunMenu(ElectronMenuModel* model,
|
|||
id_ = button->tag();
|
||||
adapter_ = std::make_unique<MenuModelAdapter>(model);
|
||||
|
||||
views::MenuItemView* item = new views::MenuItemView(this);
|
||||
auto* item = new views::MenuItemView(this);
|
||||
static_cast<MenuModelAdapter*>(adapter_.get())->BuildMenu(item);
|
||||
|
||||
menu_runner_ = std::make_unique<views::MenuRunner>(
|
||||
|
|
|
@ -89,7 +89,7 @@ NotifyIcon* NotifyIconHost::CreateNotifyIcon(base::Optional<UUID> guid) {
|
|||
if (guid.has_value()) {
|
||||
for (NotifyIcons::const_iterator i(notify_icons_.begin());
|
||||
i != notify_icons_.end(); ++i) {
|
||||
NotifyIcon* current_win_icon = static_cast<NotifyIcon*>(*i);
|
||||
auto* current_win_icon = static_cast<NotifyIcon*>(*i);
|
||||
if (current_win_icon->guid() == guid.value()) {
|
||||
LOG(WARNING)
|
||||
<< "Guid already in use. Existing tray entry will be replaced.";
|
||||
|
@ -97,7 +97,7 @@ NotifyIcon* NotifyIconHost::CreateNotifyIcon(base::Optional<UUID> guid) {
|
|||
}
|
||||
}
|
||||
|
||||
NotifyIcon* notify_icon =
|
||||
auto* notify_icon =
|
||||
new NotifyIcon(this, NextIconId(), window_, kNotifyIconMessage,
|
||||
guid.has_value() ? guid.value() : GUID_DEFAULT);
|
||||
|
||||
|
@ -121,7 +121,7 @@ LRESULT CALLBACK NotifyIconHost::WndProcStatic(HWND hwnd,
|
|||
UINT message,
|
||||
WPARAM wparam,
|
||||
LPARAM lparam) {
|
||||
NotifyIconHost* msg_wnd =
|
||||
auto* msg_wnd =
|
||||
reinterpret_cast<NotifyIconHost*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
|
||||
if (msg_wnd)
|
||||
return msg_wnd->WndProc(hwnd, message, wparam, lparam);
|
||||
|
@ -137,7 +137,7 @@ LRESULT CALLBACK NotifyIconHost::WndProc(HWND hwnd,
|
|||
// We need to reset all of our icons because the taskbar went away.
|
||||
for (NotifyIcons::const_iterator i(notify_icons_.begin());
|
||||
i != notify_icons_.end(); ++i) {
|
||||
NotifyIcon* win_icon = static_cast<NotifyIcon*>(*i);
|
||||
auto* win_icon = static_cast<NotifyIcon*>(*i);
|
||||
win_icon->ResetIcon();
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -147,7 +147,7 @@ LRESULT CALLBACK NotifyIconHost::WndProc(HWND hwnd,
|
|||
// Find the selected status icon.
|
||||
for (NotifyIcons::const_iterator i(notify_icons_.begin());
|
||||
i != notify_icons_.end(); ++i) {
|
||||
NotifyIcon* current_win_icon = static_cast<NotifyIcon*>(*i);
|
||||
auto* current_win_icon = static_cast<NotifyIcon*>(*i);
|
||||
if (current_win_icon->icon_id() == wparam) {
|
||||
win_icon = current_win_icon;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue