chore: use ScopedPumpMessagesInPrivateModes in tray (#18977)

* chore: use ScopedPumpMessagesInPrivateModes in tray

* revert refcounting of AtomMenuModel

* Prefer WeakPtr for posting tasks to handle unexpected destruction
This commit is contained in:
Shelley Vohr 2019-06-26 10:18:53 -07:00 committed by GitHub
parent d643921313
commit 6243dba068
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 15 deletions

View file

@ -30,7 +30,7 @@ class TrayIconCocoa : public TrayIcon, public AtomMenuModel::Observer {
void SetHighlightMode(TrayIcon::HighlightMode mode) override;
void SetIgnoreDoubleClickEvents(bool ignore) override;
bool GetIgnoreDoubleClickEvents() override;
void PopUpOnUI(scoped_refptr<AtomMenuModel> menu_model);
void PopUpOnUI(AtomMenuModel* menu_model);
void PopUpContextMenu(const gfx::Point& pos,
AtomMenuModel* menu_model) override;
void SetContextMenu(AtomMenuModel* menu_model) override;
@ -50,6 +50,8 @@ class TrayIconCocoa : public TrayIcon, public AtomMenuModel::Observer {
// Used for unregistering observer.
AtomMenuModel* menu_model_ = nullptr; // weak ref.
base::WeakPtrFactory<TrayIconCocoa> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(TrayIconCocoa);
};