| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 const std::wstring& new_contents) { | 138 const std::wstring& new_contents) { |
| 139 clear_search_button_->SetEnabled(!search_field_->text().empty()); | 139 clear_search_button_->SetEnabled(!search_field_->text().empty()); |
| 140 search_update_factory_.RevokeAll(); | 140 search_update_factory_.RevokeAll(); |
| 141 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 141 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 142 search_update_factory_.NewRunnableMethod( | 142 search_update_factory_.NewRunnableMethod( |
| 143 &CookiesView::UpdateSearchResults), kSearchFilterDelayMs); | 143 &CookiesView::UpdateSearchResults), kSearchFilterDelayMs); |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool CookiesView::HandleKeystroke(views::Textfield* sender, | 146 bool CookiesView::HandleKeystroke(views::Textfield* sender, |
| 147 const views::Textfield::Keystroke& key) { | 147 const views::Textfield::Keystroke& key) { |
| 148 if (key.GetKeyboardCode() == base::VKEY_ESCAPE) { | 148 if (key.GetKeyboardCode() == app::VKEY_ESCAPE) { |
| 149 ResetSearchQuery(); | 149 ResetSearchQuery(); |
| 150 } else if (key.GetKeyboardCode() == base::VKEY_RETURN) { | 150 } else if (key.GetKeyboardCode() == app::VKEY_RETURN) { |
| 151 search_update_factory_.RevokeAll(); | 151 search_update_factory_.RevokeAll(); |
| 152 UpdateSearchResults(); | 152 UpdateSearchResults(); |
| 153 } | 153 } |
| 154 return false; | 154 return false; |
| 155 } | 155 } |
| 156 | 156 |
| 157 /////////////////////////////////////////////////////////////////////////////// | 157 /////////////////////////////////////////////////////////////////////////////// |
| 158 // CookiesView, views::DialogDelegate implementation: | 158 // CookiesView, views::DialogDelegate implementation: |
| 159 | 159 |
| 160 std::wstring CookiesView::GetWindowTitle() const { | 160 std::wstring CookiesView::GetWindowTitle() const { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } else if (detailed_info.node_type == | 228 } else if (detailed_info.node_type == |
| 229 CookieTreeNode::DetailedInfo::TYPE_APPCACHE) { | 229 CookieTreeNode::DetailedInfo::TYPE_APPCACHE) { |
| 230 UpdateVisibleDetailedInfo(appcache_info_view_); | 230 UpdateVisibleDetailedInfo(appcache_info_view_); |
| 231 appcache_info_view_->SetAppCacheInfo(detailed_info.appcache_info); | 231 appcache_info_view_->SetAppCacheInfo(detailed_info.appcache_info); |
| 232 } else { | 232 } else { |
| 233 UpdateVisibleDetailedInfo(cookie_info_view_); | 233 UpdateVisibleDetailedInfo(cookie_info_view_); |
| 234 cookie_info_view_->ClearCookieDisplay(); | 234 cookie_info_view_->ClearCookieDisplay(); |
| 235 } | 235 } |
| 236 } | 236 } |
| 237 | 237 |
| 238 void CookiesView::OnTreeViewKeyDown(base::KeyboardCode keycode) { | 238 void CookiesView::OnTreeViewKeyDown(app::KeyboardCode keycode) { |
| 239 if (keycode == base::VKEY_DELETE) | 239 if (keycode == app::VKEY_DELETE) |
| 240 cookies_tree_->RemoveSelectedItems(); | 240 cookies_tree_->RemoveSelectedItems(); |
| 241 } | 241 } |
| 242 | 242 |
| 243 /////////////////////////////////////////////////////////////////////////////// | 243 /////////////////////////////////////////////////////////////////////////////// |
| 244 // CookiesView, public: | 244 // CookiesView, public: |
| 245 | 245 |
| 246 void CookiesView::UpdateSearchResults() { | 246 void CookiesView::UpdateSearchResults() { |
| 247 cookies_tree_model_->UpdateSearchResults(search_field_->text()); | 247 cookies_tree_model_->UpdateSearchResults(search_field_->text()); |
| 248 UpdateRemoveButtonsState(); | 248 UpdateRemoveButtonsState(); |
| 249 } | 249 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 remove_all_button_->SetEnabled(cookies_tree_model_->GetRoot()-> | 378 remove_all_button_->SetEnabled(cookies_tree_model_->GetRoot()-> |
| 379 GetTotalNodeCount() > 1); | 379 GetTotalNodeCount() > 1); |
| 380 } | 380 } |
| 381 | 381 |
| 382 void CookiesView::UpdateVisibleDetailedInfo(views::View* view) { | 382 void CookiesView::UpdateVisibleDetailedInfo(views::View* view) { |
| 383 cookie_info_view_->SetVisible(view == cookie_info_view_); | 383 cookie_info_view_->SetVisible(view == cookie_info_view_); |
| 384 database_info_view_->SetVisible(view == database_info_view_); | 384 database_info_view_->SetVisible(view == database_info_view_); |
| 385 local_storage_info_view_->SetVisible(view == local_storage_info_view_); | 385 local_storage_info_view_->SetVisible(view == local_storage_info_view_); |
| 386 appcache_info_view_->SetVisible(view == appcache_info_view_); | 386 appcache_info_view_->SetVisible(view == appcache_info_view_); |
| 387 } | 387 } |
| OLD | NEW |