refactor: chromium-style warnings in linux code (#12949)
This commit is contained in:
parent
2a161e1725
commit
da0fd10423
21 changed files with 41 additions and 36 deletions
|
@ -1592,12 +1592,12 @@ void WebContents::Focus() {
|
|||
|
||||
#if !defined(OS_MACOSX)
|
||||
bool WebContents::IsFocused() const {
|
||||
auto view = web_contents()->GetRenderWidgetHostView();
|
||||
auto* view = web_contents()->GetRenderWidgetHostView();
|
||||
if (!view)
|
||||
return false;
|
||||
|
||||
if (GetType() != BACKGROUND_PAGE) {
|
||||
auto window = web_contents()->GetNativeView()->GetToplevelWindow();
|
||||
auto* window = web_contents()->GetNativeView()->GetToplevelWindow();
|
||||
if (window && !window->IsVisible())
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ bool SetDefaultWebClient(const std::string& protocol) {
|
|||
|
||||
void Browser::Focus() {
|
||||
// Focus on the first visible window.
|
||||
for (const auto& window : WindowList::GetWindows()) {
|
||||
for (auto* const window : WindowList::GetWindows()) {
|
||||
if (window->IsVisible()) {
|
||||
window->Focus(true);
|
||||
break;
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace atom {
|
|||
|
||||
PowerObserverLinux::PowerObserverLinux()
|
||||
: lock_owner_name_(get_executable_basename()), weak_ptr_factory_(this) {
|
||||
auto dbus_thread_manager = bluez::DBusThreadManagerLinux::Get();
|
||||
auto* dbus_thread_manager = bluez::DBusThreadManagerLinux::Get();
|
||||
if (dbus_thread_manager) {
|
||||
bus_ = dbus_thread_manager->GetSystemBus();
|
||||
if (bus_) {
|
||||
|
@ -49,6 +49,8 @@ PowerObserverLinux::PowerObserverLinux()
|
|||
}
|
||||
}
|
||||
|
||||
PowerObserverLinux::~PowerObserverLinux() = default;
|
||||
|
||||
void PowerObserverLinux::OnLoginServiceAvailable(bool service_available) {
|
||||
if (!service_available) {
|
||||
LOG(WARNING) << kLogindServiceName << " not available";
|
||||
|
|
|
@ -19,6 +19,7 @@ namespace atom {
|
|||
class PowerObserverLinux : public base::PowerObserver {
|
||||
public:
|
||||
PowerObserverLinux();
|
||||
~PowerObserverLinux() override;
|
||||
|
||||
protected:
|
||||
void BlockSleep();
|
||||
|
|
|
@ -17,6 +17,10 @@ NativeBrowserViewViews::NativeBrowserViewViews(
|
|||
|
||||
NativeBrowserViewViews::~NativeBrowserViewViews() {}
|
||||
|
||||
void NativeBrowserViewViews::SetAutoResizeFlags(uint8_t flags) {
|
||||
auto_resize_flags_ = flags;
|
||||
}
|
||||
|
||||
void NativeBrowserViewViews::SetBounds(const gfx::Rect& bounds) {
|
||||
auto* view = GetInspectableWebContentsView()->GetView();
|
||||
view->SetBoundsRect(bounds);
|
||||
|
|
|
@ -16,9 +16,7 @@ class NativeBrowserViewViews : public NativeBrowserView {
|
|||
~NativeBrowserViewViews() override;
|
||||
|
||||
uint8_t GetAutoResizeFlags() { return auto_resize_flags_; }
|
||||
void SetAutoResizeFlags(uint8_t flags) override {
|
||||
auto_resize_flags_ = flags;
|
||||
}
|
||||
void SetAutoResizeFlags(uint8_t flags) override;
|
||||
void SetBounds(const gfx::Rect& bounds) override;
|
||||
void SetBackgroundColor(SkColor color) override;
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ class NativeWindowClientView : public views::ClientView {
|
|||
views::View* root_view,
|
||||
NativeWindowViews* window)
|
||||
: views::ClientView(widget, root_view), window_(window) {}
|
||||
virtual ~NativeWindowClientView() {}
|
||||
~NativeWindowClientView() override = default;
|
||||
|
||||
bool CanClose() override {
|
||||
window_->NotifyWindowCloseButtonClicked();
|
||||
|
|
|
@ -783,6 +783,10 @@ void OffScreenRenderWidgetHostView::CompositorResizeLockEnded() {
|
|||
ReleaseResize();
|
||||
}
|
||||
|
||||
bool OffScreenRenderWidgetHostView::IsAutoResizeEnabled() const {
|
||||
return render_widget_host_->auto_resize_enabled();
|
||||
}
|
||||
|
||||
#endif // !defined(OS_MACOSX)
|
||||
|
||||
bool OffScreenRenderWidgetHostView::TransformPointToLocalCoordSpace(
|
||||
|
@ -913,10 +917,6 @@ bool OffScreenRenderWidgetHostView::InstallTransparency() {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool OffScreenRenderWidgetHostView::IsAutoResizeEnabled() const {
|
||||
return render_widget_host_->auto_resize_enabled();
|
||||
}
|
||||
|
||||
void OffScreenRenderWidgetHostView::SetNeedsBeginFrames(
|
||||
bool needs_begin_frames) {
|
||||
SetupFrameRate(true);
|
||||
|
|
|
@ -184,6 +184,7 @@ class OffScreenRenderWidgetHostView
|
|||
std::unique_ptr<ui::CompositorLock> GetCompositorLock(
|
||||
ui::CompositorLockClient* client) override;
|
||||
void CompositorResizeLockEnded() override;
|
||||
bool IsAutoResizeEnabled() const override;
|
||||
#endif // !defined(OS_MACOSX)
|
||||
|
||||
bool TransformPointToLocalCoordSpace(const gfx::Point& point,
|
||||
|
@ -199,7 +200,6 @@ class OffScreenRenderWidgetHostView
|
|||
ui::Compositor* compositor) override;
|
||||
|
||||
bool InstallTransparency();
|
||||
bool IsAutoResizeEnabled() const;
|
||||
|
||||
// NativeWindowObserver:
|
||||
void OnWindowResize() override;
|
||||
|
|
|
@ -43,7 +43,7 @@ gfx::NativeView OffScreenWebContentsView::GetNativeView() const {
|
|||
if (!web_contents_)
|
||||
return gfx::NativeView();
|
||||
|
||||
auto relay = NativeWindowRelay::FromWebContents(web_contents_);
|
||||
auto* relay = NativeWindowRelay::FromWebContents(web_contents_);
|
||||
if (!relay)
|
||||
return gfx::NativeView();
|
||||
return relay->window->GetNativeView();
|
||||
|
@ -53,7 +53,7 @@ gfx::NativeView OffScreenWebContentsView::GetContentNativeView() const {
|
|||
if (!web_contents_)
|
||||
return gfx::NativeView();
|
||||
|
||||
auto relay = NativeWindowRelay::FromWebContents(web_contents_);
|
||||
auto* relay = NativeWindowRelay::FromWebContents(web_contents_);
|
||||
if (!relay)
|
||||
return gfx::NativeView();
|
||||
return relay->window->GetNativeView();
|
||||
|
@ -63,7 +63,7 @@ gfx::NativeWindow OffScreenWebContentsView::GetTopLevelNativeWindow() const {
|
|||
if (!web_contents_)
|
||||
return gfx::NativeWindow();
|
||||
|
||||
auto relay = NativeWindowRelay::FromWebContents(web_contents_);
|
||||
auto* relay = NativeWindowRelay::FromWebContents(web_contents_);
|
||||
if (!relay)
|
||||
return gfx::NativeWindow();
|
||||
return relay->window->GetNativeWindow();
|
||||
|
|
|
@ -86,7 +86,7 @@ class GtkMessageBox : public NativeWindowObserver {
|
|||
}
|
||||
}
|
||||
|
||||
~GtkMessageBox() {
|
||||
~GtkMessageBox() override {
|
||||
gtk_widget_destroy(dialog_);
|
||||
if (parent_) {
|
||||
parent_->RemoveObserver(this);
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace atom {
|
|||
class TrayIconGtk : public TrayIcon, public views::StatusIconLinux::Delegate {
|
||||
public:
|
||||
TrayIconGtk();
|
||||
virtual ~TrayIconGtk();
|
||||
~TrayIconGtk() override;
|
||||
|
||||
// TrayIcon:
|
||||
void SetImage(const gfx::Image& image) override;
|
||||
|
|
|
@ -38,7 +38,7 @@ AutofillPopupView::AutofillPopupView(AutofillPopup* popup,
|
|||
|
||||
AutofillPopupView::~AutofillPopupView() {
|
||||
if (popup_) {
|
||||
auto host = popup_->frame_host_->GetRenderViewHost()->GetWidget();
|
||||
auto* host = popup_->frame_host_->GetRenderViewHost()->GetWidget();
|
||||
host->RemoveKeyPressEventCallback(keypress_callback_);
|
||||
popup_->view_ = nullptr;
|
||||
popup_ = nullptr;
|
||||
|
@ -100,7 +100,7 @@ void AutofillPopupView::Show() {
|
|||
|
||||
keypress_callback_ = base::Bind(&AutofillPopupView::HandleKeyPressEvent,
|
||||
base::Unretained(this));
|
||||
auto host = popup_->frame_host_->GetRenderViewHost()->GetWidget();
|
||||
auto* host = popup_->frame_host_->GetRenderViewHost()->GetWidget();
|
||||
host->AddKeyPressEventCallback(keypress_callback_);
|
||||
|
||||
NotifyAccessibilityEvent(ui::AX_EVENT_MENU_START, true);
|
||||
|
@ -108,7 +108,7 @@ void AutofillPopupView::Show() {
|
|||
|
||||
void AutofillPopupView::Hide() {
|
||||
if (popup_) {
|
||||
auto host = popup_->frame_host_->GetRenderViewHost()->GetWidget();
|
||||
auto* host = popup_->frame_host_->GetRenderViewHost()->GetWidget();
|
||||
host->RemoveKeyPressEventCallback(keypress_callback_);
|
||||
popup_ = nullptr;
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ void AutofillPopupView::CreateChildViews() {
|
|||
RemoveAllChildViews(true);
|
||||
|
||||
for (int i = 0; i < popup_->GetLineCount(); ++i) {
|
||||
auto child_view = new AutofillPopupChildView(popup_->GetValueAt(i));
|
||||
auto* child_view = new AutofillPopupChildView(popup_->GetValueAt(i));
|
||||
child_view->set_drag_controller(this);
|
||||
AddChildView(child_view);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ const SkColor kDefaultColor = SkColorSetARGB(255, 233, 233, 233);
|
|||
const char MenuBar::kViewClassName[] = "ElectronMenuBar";
|
||||
|
||||
MenuBar::MenuBar(views::View* window)
|
||||
: background_color_(kDefaultColor), menu_model_(NULL), window_(window) {
|
||||
: background_color_(kDefaultColor), window_(window), menu_model_(NULL) {
|
||||
RefreshColorCache();
|
||||
UpdateViewColors();
|
||||
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal));
|
||||
|
@ -60,7 +60,7 @@ bool MenuBar::HasAccelerator(base::char16 key) {
|
|||
}
|
||||
|
||||
void MenuBar::ActivateAccelerator(base::char16 key) {
|
||||
auto child = FindAccelChild(key);
|
||||
auto* child = FindAccelChild(key);
|
||||
if (child)
|
||||
static_cast<SubmenuButton*>(child)->Activate(nullptr);
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ void MenuBar::OnDidChangeFocus(View* focused_before, View* focused_now) {
|
|||
void MenuBar::RebuildChildren() {
|
||||
RemoveAllChildViews(true);
|
||||
for (int i = 0, n = GetItemCount(); i < n; ++i) {
|
||||
auto button =
|
||||
auto* button =
|
||||
new SubmenuButton(menu_model_->GetLabelAt(i), this, background_color_);
|
||||
button->set_tag(i);
|
||||
AddChildView(button);
|
||||
|
@ -168,7 +168,7 @@ void MenuBar::UpdateViewColors() {
|
|||
#if defined(USE_X11)
|
||||
const auto& textColor = has_focus_ ? enabled_color_ : disabled_color_;
|
||||
for (auto* child : GetChildrenInZOrder()) {
|
||||
auto button = static_cast<SubmenuButton*>(child);
|
||||
auto* button = static_cast<SubmenuButton*>(child);
|
||||
button->SetTextColor(views::Button::STATE_NORMAL, textColor);
|
||||
button->SetTextColor(views::Button::STATE_DISABLED, disabled_color_);
|
||||
button->SetTextColor(views::Button::STATE_PRESSED, enabled_color_);
|
||||
|
|
|
@ -25,7 +25,7 @@ class MenuBar : public views::View,
|
|||
static const char kViewClassName[];
|
||||
|
||||
explicit MenuBar(views::View* window);
|
||||
virtual ~MenuBar();
|
||||
~MenuBar() override;
|
||||
|
||||
// Replaces current menu with a new one.
|
||||
void SetMenu(AtomMenuModel* menu_model);
|
||||
|
|
|
@ -21,7 +21,7 @@ class MenuBar;
|
|||
class MenuDelegate : public views::MenuDelegate {
|
||||
public:
|
||||
explicit MenuDelegate(MenuBar* menu_bar);
|
||||
virtual ~MenuDelegate();
|
||||
~MenuDelegate() override;
|
||||
|
||||
void RunMenu(AtomMenuModel* model, views::MenuButton* button);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class SubmenuButton : public views::MenuButton {
|
|||
SubmenuButton(const base::string16& title,
|
||||
views::MenuButtonListener* menu_button_listener,
|
||||
const SkColor& background_color);
|
||||
virtual ~SubmenuButton();
|
||||
~SubmenuButton() override;
|
||||
|
||||
void SetAcceleratorVisibility(bool visible);
|
||||
void SetUnderlineColor(SkColor color);
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace atom {
|
|||
class WindowStateWatcher : public ui::PlatformEventObserver {
|
||||
public:
|
||||
explicit WindowStateWatcher(NativeWindowViews* window);
|
||||
virtual ~WindowStateWatcher();
|
||||
~WindowStateWatcher() override;
|
||||
|
||||
protected:
|
||||
// ui::PlatformEventObserver:
|
||||
|
|
|
@ -43,7 +43,7 @@ class CrashReporterLinux : public CrashReporter {
|
|||
friend struct base::DefaultSingletonTraits<CrashReporterLinux>;
|
||||
|
||||
CrashReporterLinux();
|
||||
virtual ~CrashReporterLinux();
|
||||
~CrashReporterLinux() override;
|
||||
|
||||
void EnableCrashDumping(const base::FilePath& crashes_dir);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace atom {
|
|||
class NodeBindingsLinux : public NodeBindings {
|
||||
public:
|
||||
explicit NodeBindingsLinux(BrowserEnvironment browser_env);
|
||||
virtual ~NodeBindingsLinux();
|
||||
~NodeBindingsLinux() override;
|
||||
|
||||
void RunMessageLoop() override;
|
||||
|
||||
|
|
|
@ -30,12 +30,12 @@ class ColorChooserAura : public content::ColorChooser,
|
|||
ColorChooserAura(content::WebContents* web_contents, SkColor initial_color);
|
||||
|
||||
// content::ColorChooser overrides:
|
||||
virtual void End() override;
|
||||
virtual void SetSelectedColor(SkColor color) override;
|
||||
void End() override;
|
||||
void SetSelectedColor(SkColor color) override;
|
||||
|
||||
// views::ColorChooserListener overrides:
|
||||
virtual void OnColorChosen(SkColor color) override;
|
||||
virtual void OnColorChooserDialogClosed() override;
|
||||
void OnColorChosen(SkColor color) override;
|
||||
void OnColorChooserDialogClosed() override;
|
||||
|
||||
void DidEndColorChooser();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue