Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4031)

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 789763004: Fix disappearing page actions bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor rename. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 9be31772fe3b03f571e1213f59b86495cf007f51..e45cf84a5289e46c2838a594bf7fc69c0a7d9361 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -1056,11 +1056,12 @@ bool LocationBarView::RefreshContentSettingViews() {
return visibility_changed;
}
-void LocationBarView::DeletePageActionViews() {
+void LocationBarView::DeletePageActionsAndViews() {
for (PageActionViews::const_iterator i(page_action_views_.begin());
i != page_action_views_.end(); ++i)
RemoveChildView(*i);
STLDeleteElements(&page_action_views_);
+ STLDeleteElements(&page_actions_);
}
bool LocationBarView::RefreshPageActionViews() {
@@ -1085,7 +1086,7 @@ bool LocationBarView::RefreshPageActionViews() {
changed = true;
page_actions_.swap(new_page_actions);
- DeletePageActionViews(); // Delete the old views (if any).
+ page_action_views.clear();
danduong 2014/12/20 03:09:22 This should be page_action_views_. Also we need to
erikchen 2014/12/22 20:39:43 Done.
// Create the page action views.
for (PageActions::const_iterator i = page_actions_.begin();
@@ -1293,7 +1294,7 @@ void LocationBarView::UpdatePageActions() {
}
void LocationBarView::InvalidatePageActions() {
- DeletePageActionViews();
+ DeletePageActionsAndViews();
danduong 2014/12/20 04:28:40 Hah! I think the bug is actually here. This proba
danduong 2014/12/20 04:59:04 I just realized that you commented on this in the
erikchen 2014/12/22 20:39:43 We should be calling Refresh. This is another bug.
}
void LocationBarView::UpdateBookmarkStarVisibility() {

Powered by Google App Engine
This is Rietveld 408576698