Commit 7edcaa69 authored by Alan Cutter's avatar Alan Cutter Committed by Commit Bot

Rename PageActionIconView::Refresh() to Update()

This CL renames PageActionIconView::Refresh() to be Update().
This makes it more consistent with
PageActionIconContainer::UpdatePageActionIcon() and LocationBar methods
like UpdateSaveCreditCardIcon().

There are no behavioural changes in this CL.

Bug: 788051
Change-Id: I1d5d05cfc659d89a41480771e2415b261553263b
Reviewed-on: https://chromium-review.googlesource.com/1082064Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565135}
parent 8b83e531
......@@ -39,7 +39,7 @@ views::BubbleDialogDelegateView* SaveCardIconView::GetBubble() const {
controller->save_card_bubble_view());
}
bool SaveCardIconView::Refresh() {
bool SaveCardIconView::Update() {
if (!GetWebContents())
return false;
......
......@@ -27,7 +27,7 @@ class SaveCardIconView : public PageActionIconView {
// PageActionIconView:
views::BubbleDialogDelegateView* GetBubble() const override;
bool Refresh() override;
bool Update() override;
base::string16 GetTextForTooltipAndAccessibleName() const override;
protected:
......
......@@ -856,7 +856,7 @@ bool LocationBarView::RefreshPageActionIconViews() {
bool visibility_changed = false;
for (auto* v : page_action_icons_) {
visibility_changed |= v->Refresh();
visibility_changed |= v->Update();
}
return visibility_changed;
}
......@@ -867,7 +867,8 @@ bool LocationBarView::RefreshZoomView() {
if (!web_contents)
return false;
const bool was_visible = zoom_view_->visible();
zoom_view_->Update(zoom::ZoomController::FromWebContents(web_contents));
zoom_view_->UpdateWithController(
zoom::ZoomController::FromWebContents(web_contents));
return was_visible != zoom_view_->visible();
}
......@@ -1029,14 +1030,14 @@ void LocationBarView::UpdateContentSettingsIcons() {
}
void LocationBarView::UpdateManagePasswordsIconAndBubble() {
if (manage_passwords_icon_view_->Refresh()) {
if (manage_passwords_icon_view_->Update()) {
Layout();
SchedulePaint();
}
}
void LocationBarView::UpdateSaveCreditCardIcon() {
if (save_credit_card_icon_view_->Refresh()) {
if (save_credit_card_icon_view_->Update()) {
Layout();
SchedulePaint();
}
......
......@@ -21,13 +21,13 @@ ZoomView::ZoomView(LocationBarView::Delegate* location_bar_delegate,
: PageActionIconView(nullptr, 0, delegate),
location_bar_delegate_(location_bar_delegate),
icon_(&kZoomMinusIcon) {
Update(nullptr);
UpdateWithController(nullptr);
}
ZoomView::~ZoomView() {
}
void ZoomView::Update(zoom::ZoomController* zoom_controller) {
void ZoomView::UpdateWithController(zoom::ZoomController* zoom_controller) {
if (!zoom_controller ||
(!ZoomBubbleView::GetZoomBubble() &&
zoom_controller->IsAtDefaultZoom()) ||
......
......@@ -26,7 +26,7 @@ class ZoomView : public PageActionIconView {
// Updates the image and its tooltip appropriately, hiding or showing the icon
// as needed.
void Update(zoom::ZoomController* zoom_controller);
void UpdateWithController(zoom::ZoomController* zoom_controller);
protected:
// PageActionIconView:
......
......@@ -87,7 +87,7 @@ void PageActionIconView::OnBubbleWidgetCreated(views::Widget* bubble_widget) {
SetHighlighted(true);
}
bool PageActionIconView::Refresh() {
bool PageActionIconView::Update() {
return false;
}
......
......@@ -52,7 +52,7 @@ class PageActionIconView : public views::InkDropHostView {
// Updates the icon state and associated bubble when the WebContents changes.
// Returns true if there was a change.
virtual bool Refresh();
virtual bool Update();
protected:
enum ExecuteSource {
......
......@@ -58,7 +58,7 @@ views::BubbleDialogDelegateView* ManagePasswordsIconViews::GetBubble() const {
return PasswordBubbleViewBase::manage_password_bubble();
}
bool ManagePasswordsIconViews::Refresh() {
bool ManagePasswordsIconViews::Update() {
if (!GetWebContents())
return false;
......
......@@ -27,7 +27,7 @@ class ManagePasswordsIconViews : public ManagePasswordsIconView,
// PageActionIconView:
views::BubbleDialogDelegateView* GetBubble() const override;
bool Refresh() override;
bool Update() override;
void OnExecuting(PageActionIconView::ExecuteSource source) override;
bool OnMousePressed(const ui::MouseEvent& event) override;
bool OnKeyPressed(const ui::KeyEvent& event) override;
......
......@@ -31,7 +31,7 @@ views::BubbleDialogDelegateView* TranslateIconView::GetBubble() const {
return TranslateBubbleView::GetCurrentBubble();
}
bool TranslateIconView::Refresh() {
bool TranslateIconView::Update() {
if (!GetWebContents())
return false;
......
......@@ -20,7 +20,7 @@ class TranslateIconView : public PageActionIconView {
// PageActionIconView:
views::BubbleDialogDelegateView* GetBubble() const override;
bool Refresh() override;
bool Update() override;
protected:
// PageActionIconView:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment