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

Unified Diff: chrome/browser/views/password_manager_exceptions_view.cc

Issue 39313: Fix a crash in PasswordManagerExceptionsView (Closed)
Patch Set: more comments Created 11 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/views/password_manager_exceptions_view.cc
diff --git a/chrome/browser/views/password_manager_exceptions_view.cc b/chrome/browser/views/password_manager_exceptions_view.cc
index 9d41a85b313d7c79eb5ad78d7f89cbb3e00f79f8..a501a609acadb6b5923caff32464eaecdfaa742a 100644
--- a/chrome/browser/views/password_manager_exceptions_view.cc
+++ b/chrome/browser/views/password_manager_exceptions_view.cc
@@ -18,7 +18,7 @@ using views::ColumnSet;
using views::GridLayout;
// We can only have one PasswordManagerExceptionsView at a time.
-static PasswordManagerExceptionsView* instance_ = NULL;
+PasswordManagerExceptionsView* PasswordManagerExceptionsView::instance_ = NULL;
static const int kDefaultWindowWidth = 530;
static const int kDefaultWindowHeight = 240;
@@ -74,6 +74,8 @@ void PasswordManagerExceptionsTableModel::OnWebDataServiceRequestDone(
}
if (observer_)
observer_->OnModelChanged();
+ if (row_count_observer_)
+ row_count_observer_->OnRowCountChanged(RowCount());
}
//////////////////////////////////////////////////////////////////////
@@ -105,6 +107,9 @@ PasswordManagerExceptionsView::PasswordManagerExceptionsView(Profile* profile)
}
void PasswordManagerExceptionsView::SetupTable() {
+ // Tell the table model we are concern about how many rows it has.
+ table_model_.set_row_count_observer(this);
+
// Creates the different columns for the table.
// The float resize values are the result of much tinkering.
std::vector<views::TableColumn> columns;
@@ -240,3 +245,7 @@ void PasswordManagerExceptionsView::WindowClosing() {
views::View* PasswordManagerExceptionsView::GetContentsView() {
return this;
}
+
+void PasswordManagerExceptionsView::OnRowCountChanged(size_t rows) {
+ remove_all_button_.SetEnabled(rows > 0);
+}
« no previous file with comments | « chrome/browser/views/password_manager_exceptions_view.h ('k') | chrome/browser/views/password_manager_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698