| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/options/cookies_view.h" | 5 #include "chrome/browser/views/options/cookies_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/gfx/canvas.h" | 9 #include "app/gfx/canvas.h" |
| 10 #include "app/gfx/color_utils.h" | 10 #include "app/gfx/color_utils.h" |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 const std::wstring& new_contents) { | 401 const std::wstring& new_contents) { |
| 402 clear_search_button_->SetEnabled(!search_field_->text().empty()); | 402 clear_search_button_->SetEnabled(!search_field_->text().empty()); |
| 403 search_update_factory_.RevokeAll(); | 403 search_update_factory_.RevokeAll(); |
| 404 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 404 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 405 search_update_factory_.NewRunnableMethod( | 405 search_update_factory_.NewRunnableMethod( |
| 406 &CookiesView::UpdateSearchResults), kSearchFilterDelayMs); | 406 &CookiesView::UpdateSearchResults), kSearchFilterDelayMs); |
| 407 } | 407 } |
| 408 | 408 |
| 409 bool CookiesView::HandleKeystroke(views::Textfield* sender, | 409 bool CookiesView::HandleKeystroke(views::Textfield* sender, |
| 410 const views::Textfield::Keystroke& key) { | 410 const views::Textfield::Keystroke& key) { |
| 411 if (views::Textfield::IsKeystrokeEscape(key)) { | 411 if (key.GetKeyboardCode() == base::VKEY_ESCAPE) { |
| 412 ResetSearchQuery(); | 412 ResetSearchQuery(); |
| 413 } else if (views::Textfield::IsKeystrokeEnter(key)) { | 413 } else if (key.GetKeyboardCode() == base::VKEY_RETURN) { |
| 414 search_update_factory_.RevokeAll(); | 414 search_update_factory_.RevokeAll(); |
| 415 UpdateSearchResults(); | 415 UpdateSearchResults(); |
| 416 } | 416 } |
| 417 return false; | 417 return false; |
| 418 } | 418 } |
| 419 | 419 |
| 420 /////////////////////////////////////////////////////////////////////////////// | 420 /////////////////////////////////////////////////////////////////////////////// |
| 421 // CookiesView, views::DialogDelegate implementation: | 421 // CookiesView, views::DialogDelegate implementation: |
| 422 | 422 |
| 423 std::wstring CookiesView::GetWindowTitle() const { | 423 std::wstring CookiesView::GetWindowTitle() const { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 search_field_->SetText(EmptyWString()); | 569 search_field_->SetText(EmptyWString()); |
| 570 clear_search_button_->SetEnabled(false); | 570 clear_search_button_->SetEnabled(false); |
| 571 UpdateSearchResults(); | 571 UpdateSearchResults(); |
| 572 } | 572 } |
| 573 | 573 |
| 574 void CookiesView::UpdateForEmptyState() { | 574 void CookiesView::UpdateForEmptyState() { |
| 575 info_view_->ClearCookieDisplay(); | 575 info_view_->ClearCookieDisplay(); |
| 576 remove_button_->SetEnabled(false); | 576 remove_button_->SetEnabled(false); |
| 577 remove_all_button_->SetEnabled(false); | 577 remove_all_button_->SetEnabled(false); |
| 578 } | 578 } |
| OLD | NEW |