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

Unified Diff: chrome/browser/views/options/cookies_view.cc

Issue 155060: This patch changes the behavior of clear search button in cookies_view to wor... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/options/cookies_view.cc
===================================================================
--- chrome/browser/views/options/cookies_view.cc (revision 20106)
+++ chrome/browser/views/options/cookies_view.cc (working copy)
@@ -50,12 +50,12 @@
void RemoveCookies(int start_index, int remove_count);
void RemoveAllShownCookies();
- // TableModel implementation:
+ // TableModel methods.
virtual int RowCount();
virtual std::wstring GetText(int row, int column_id);
virtual SkBitmap GetIcon(int row);
+ virtual int CompareValues(int row1, int row2, int column_id);
virtual void SetObserver(TableModelObserver* observer);
- virtual int CompareValues(int row1, int row2, int column_id);
// Filter the cookies to only display matched results.
void UpdateSearchResults(const std::wstring& filter);
@@ -130,7 +130,8 @@
// We could do this all better if there was a way to mark elements of
// all_cookies as dead instead of deleting, but this should be fine for now.
DoFilter();
- observer_->OnItemsRemoved(start_index, remove_count);
+ if (observer_)
+ observer_->OnItemsRemoved(start_index, remove_count);
}
void CookiesTableModel::RemoveAllShownCookies() {
@@ -615,6 +616,7 @@
void CookiesView::ContentsChanged(views::Textfield* sender,
const std::wstring& new_contents) {
+ clear_search_button_->SetEnabled(!search_field_->text().empty());
search_update_factory_.RevokeAll();
MessageLoop::current()->PostDelayedTask(FROM_HERE,
search_update_factory_.NewRunnableMethod(
@@ -705,6 +707,7 @@
search_field_->SetController(this);
clear_search_button_ = new views::NativeButton(
this, l10n_util::GetString(IDS_COOKIES_CLEAR_SEARCH_LABEL));
+ clear_search_button_->SetEnabled(false);
description_label_ = new views::Label(
l10n_util::GetString(IDS_COOKIES_INFO_LABEL));
description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
@@ -781,6 +784,7 @@
void CookiesView::ResetSearchQuery() {
search_field_->SetText(EmptyWString());
+ clear_search_button_->SetEnabled(false);
UpdateSearchResults();
}
« 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