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

Side by Side Diff: chrome/browser/ui/views/website_settings/chosen_object_row.cc

Issue 2804153002: Fix a crash after removing button from site settings popup (Closed)
Patch Set: Created 3 years, 8 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/website_settings/chosen_object_row.h" 5 #include "chrome/browser/ui/views/website_settings/chosen_object_row.h"
6 6
7 #include "chrome/browser/ui/views/website_settings/chosen_object_row_observer.h" 7 #include "chrome/browser/ui/views/website_settings/chosen_object_row_observer.h"
8 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h " 8 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h "
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 ChosenObjectRow::~ChosenObjectRow() {} 68 ChosenObjectRow::~ChosenObjectRow() {}
69 69
70 void ChosenObjectRow::ButtonPressed(views::Button* sender, 70 void ChosenObjectRow::ButtonPressed(views::Button* sender,
71 const ui::Event& event) { 71 const ui::Event& event) {
72 // Change the icon to reflect the selected setting. 72 // Change the icon to reflect the selected setting.
73 const gfx::Image& image = 73 const gfx::Image& image =
74 WebsiteSettingsUI::GetChosenObjectIcon(*info_, true); 74 WebsiteSettingsUI::GetChosenObjectIcon(*info_, true);
75 icon_->SetImage(image.ToImageSkia()); 75 icon_->SetImage(image.ToImageSkia());
76 76
77 RemoveChildView(delete_button_); 77 DCHECK(delete_button_->visible());
78 delete delete_button_; 78 delete_button_->SetVisible(false);
79 delete_button_ = nullptr;
80 79
81 for (ChosenObjectRowObserver& observer : observer_list_) 80 for (ChosenObjectRowObserver& observer : observer_list_)
82 observer.OnChosenObjectDeleted(*info_); 81 observer.OnChosenObjectDeleted(*info_);
83 } 82 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698