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

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

Issue 43147: Merge 11279 - Added a PasswordManagerTableModelObserver to listen for row cou... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/branches/169/src/
Patch Set: 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
===================================================================
--- chrome/browser/views/password_manager_exceptions_view.cc (revision 11543)
+++ chrome/browser/views/password_manager_exceptions_view.cc (working copy)
@@ -18,7 +18,7 @@
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 @@
}
if (observer_)
observer_->OnModelChanged();
+ if (row_count_observer_)
+ row_count_observer_->OnRowCountChanged(RowCount());
}
//////////////////////////////////////////////////////////////////////
@@ -105,6 +107,9 @@
}
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 @@
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