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

Unified Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

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/cocoa/location_bar/location_bar_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
index d62b09625cd032d46eb3d8cc85244e9761ae5068..f617d8e732bd81207fab1f818ade323cdd7a8ab3 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
@@ -208,7 +208,7 @@ void LocationBarViewMac::UpdatePageActions() {
}
void LocationBarViewMac::InvalidatePageActions() {
- DeletePageActionDecorations();
+ DeletePageActionsAndDecorations();
Layout();
}
@@ -650,13 +650,14 @@ PageActionDecoration* LocationBarViewMac::GetPageActionDecoration(
return NULL;
}
-void LocationBarViewMac::DeletePageActionDecorations() {
+void LocationBarViewMac::DeletePageActionsAndDecorations() {
// TODO(shess): Deleting these decorations could result in the cell
// refering to them before things are laid out again. Meanwhile, at
// least fail safe.
[[field_ cell] clearDecorations];
page_action_decorations_.clear();
+ page_actions_.clear();
}
void LocationBarViewMac::OnEditBookmarksEnabledChanged() {
@@ -666,13 +667,13 @@ void LocationBarViewMac::OnEditBookmarksEnabledChanged() {
void LocationBarViewMac::RefreshPageActionDecorations() {
if (!IsEditable()) {
- DeletePageActionDecorations();
+ DeletePageActionsAndDecorations();
return;
}
WebContents* web_contents = GetWebContents();
if (!web_contents) {
- DeletePageActionDecorations(); // Necessary?
+ DeletePageActionsAndDecorations(); // Necessary?
return;
}
@@ -682,7 +683,7 @@ void LocationBarViewMac::RefreshPageActionDecorations() {
if (new_page_actions != page_actions_) {
page_actions_.swap(new_page_actions);
- DeletePageActionDecorations();
+ page_action_decorations_.clear();
danduong 2014/12/20 03:21:24 do you have to call [[field_ cell] clearDecoration
erikchen 2014/12/22 20:39:43 Yes, you're right.
for (size_t i = 0; i < page_actions_.size(); ++i) {
page_action_decorations_.push_back(
new PageActionDecoration(this, browser_, page_actions_[i]));

Powered by Google App Engine
This is Rietveld 408576698