Skip to content

Commit

Permalink
Adapt signature of callback for views::Link::set_callback()
Browse files Browse the repository at this point in the history
This used to expect 2 parameters (Link* source, int event_flags),
but it's only one (int event_flags) now, so let's adapt it.

Chromium change:

https://chromium.googlesource.com/chromium/src/+/10d5bf9896fd3b41bb0b74b79b27c8df1feebcd4

commit 10d5bf9896fd3b41bb0b74b79b27c8df1feebcd4
Author: Peter Kasting <pkasting@chromium.org>
Date:   Thu Sep 10 22:51:15 2020 +0000

    Remove StyledLabelListener.

    This replaces it with direct callback registration on the underlying
    links, conveyed by setting the callback on the RangeStyleInfo
    corresponding to the link.  This allows eliminating parameters like the
    range, since a different callback or different bound arguments can be
    set for each range.

    With a change to how ContentSettingBubbleContents works (which was the
    other place using the Link* argument of Link::ClickedCallback), this
    allows reducing Link::ClickedCallback to one argument as well.  It makes
    sense to make these changes simultaneously since they mostly affect the
    same listeners and thus this avoids changing lots of signatures twice.

    Bug: 1108460
  • Loading branch information
mariospr authored and mkarolin committed Oct 6, 2020
1 parent 190f842 commit 6248eef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ void BookmarkBarInstructionsView::GetAccessibleNodeData(
instructions_->GetAccessibleNodeData(node_data);
}

void BookmarkBarInstructionsView::LinkClicked(views::Link* source,
int event_flags) {
void BookmarkBarInstructionsView::LinkClicked(int event_flags) {
chrome::ShowImportDialog(browser_);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class BookmarkBarInstructionsView : public views::View,
ui::MenuSourceType source_type) override;

void UpdateColors();
void LinkClicked(views::Link* source, int event_flags);
void LinkClicked(int event_flags);

views::Label* instructions_;
views::Link* import_link_;
Expand Down

0 comments on commit 6248eef

Please sign in to comment.