OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 void CookiesView::ContentsChanged(views::Textfield* sender, | 138 void CookiesView::ContentsChanged(views::Textfield* sender, |
139 const std::wstring& new_contents) { | 139 const std::wstring& new_contents) { |
140 clear_search_button_->SetEnabled(!search_field_->text().empty()); | 140 clear_search_button_->SetEnabled(!search_field_->text().empty()); |
141 search_update_factory_.RevokeAll(); | 141 search_update_factory_.RevokeAll(); |
142 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 142 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
143 search_update_factory_.NewRunnableMethod( | 143 search_update_factory_.NewRunnableMethod( |
144 &CookiesView::UpdateSearchResults), kSearchFilterDelayMs); | 144 &CookiesView::UpdateSearchResults), kSearchFilterDelayMs); |
145 } | 145 } |
146 | 146 |
147 bool CookiesView::HandleKeystroke(views::Textfield* sender, | 147 bool CookiesView::HandleKeyEvent(views::Textfield* sender, |
148 const views::Textfield::Keystroke& key) { | 148 const views::KeyEvent& key_event) { |
149 if (key.GetKeyboardCode() == app::VKEY_ESCAPE) { | 149 if (key_event.GetKeyCode() == app::VKEY_ESCAPE) { |
150 ResetSearchQuery(); | 150 ResetSearchQuery(); |
151 } else if (key.GetKeyboardCode() == app::VKEY_RETURN) { | 151 } else if (key_event.GetKeyCode() == app::VKEY_RETURN) { |
152 search_update_factory_.RevokeAll(); | 152 search_update_factory_.RevokeAll(); |
153 UpdateSearchResults(); | 153 UpdateSearchResults(); |
154 } | 154 } |
155 return false; | 155 return false; |
156 } | 156 } |
157 | 157 |
158 /////////////////////////////////////////////////////////////////////////////// | 158 /////////////////////////////////////////////////////////////////////////////// |
159 // CookiesView, views::DialogDelegate implementation: | 159 // CookiesView, views::DialogDelegate implementation: |
160 | 160 |
161 std::wstring CookiesView::GetWindowTitle() const { | 161 std::wstring CookiesView::GetWindowTitle() const { |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 GetTotalNodeCount() > 1); | 388 GetTotalNodeCount() > 1); |
389 } | 389 } |
390 | 390 |
391 void CookiesView::UpdateVisibleDetailedInfo(views::View* view) { | 391 void CookiesView::UpdateVisibleDetailedInfo(views::View* view) { |
392 cookie_info_view_->SetVisible(view == cookie_info_view_); | 392 cookie_info_view_->SetVisible(view == cookie_info_view_); |
393 database_info_view_->SetVisible(view == database_info_view_); | 393 database_info_view_->SetVisible(view == database_info_view_); |
394 local_storage_info_view_->SetVisible(view == local_storage_info_view_); | 394 local_storage_info_view_->SetVisible(view == local_storage_info_view_); |
395 appcache_info_view_->SetVisible(view == appcache_info_view_); | 395 appcache_info_view_->SetVisible(view == appcache_info_view_); |
396 indexed_db_info_view_->SetVisible(view == indexed_db_info_view_); | 396 indexed_db_info_view_->SetVisible(view == indexed_db_info_view_); |
397 } | 397 } |
OLD | NEW |