| 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/bookmark_manager_view.h" | 5 #include "chrome/browser/views/bookmark_manager_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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 const std::wstring& new_contents) { | 496 const std::wstring& new_contents) { |
| 497 search_factory_.RevokeAll(); | 497 search_factory_.RevokeAll(); |
| 498 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 498 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 499 search_factory_.NewRunnableMethod(&BookmarkManagerView::PerformSearch), | 499 search_factory_.NewRunnableMethod(&BookmarkManagerView::PerformSearch), |
| 500 kSearchDelayMS); | 500 kSearchDelayMS); |
| 501 } | 501 } |
| 502 | 502 |
| 503 bool BookmarkManagerView::HandleKeystroke( | 503 bool BookmarkManagerView::HandleKeystroke( |
| 504 views::Textfield* sender, | 504 views::Textfield* sender, |
| 505 const views::Textfield::Keystroke& key) { | 505 const views::Textfield::Keystroke& key) { |
| 506 if (views::Textfield::IsKeystrokeEnter(key)) { | 506 if (key.GetKeyboardCode() == base::VKEY_RETURN) { |
| 507 PerformSearch(); | 507 PerformSearch(); |
| 508 search_tf_->SelectAll(); | 508 search_tf_->SelectAll(); |
| 509 } | 509 } |
| 510 | 510 |
| 511 return false; | 511 return false; |
| 512 } | 512 } |
| 513 | 513 |
| 514 void BookmarkManagerView::ShowContextMenu(views::View* source, | 514 void BookmarkManagerView::ShowContextMenu(views::View* source, |
| 515 int x, | 515 int x, |
| 516 int y, | 516 int y, |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 file_type_info.extensions.resize(1); | 784 file_type_info.extensions.resize(1); |
| 785 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html")); | 785 file_type_info.extensions[0].push_back(FILE_PATH_LITERAL("html")); |
| 786 file_type_info.include_all_files = true; | 786 file_type_info.include_all_files = true; |
| 787 select_file_dialog_ = SelectFileDialog::Create(this); | 787 select_file_dialog_ = SelectFileDialog::Create(this); |
| 788 select_file_dialog_->SelectFile( | 788 select_file_dialog_->SelectFile( |
| 789 SelectFileDialog::SELECT_SAVEAS_FILE, std::wstring(), | 789 SelectFileDialog::SELECT_SAVEAS_FILE, std::wstring(), |
| 790 FilePath(FILE_PATH_LITERAL("bookmarks.html")), &file_type_info, 0, | 790 FilePath(FILE_PATH_LITERAL("bookmarks.html")), &file_type_info, 0, |
| 791 L"html", GetWidget()->GetNativeView(), | 791 L"html", GetWidget()->GetNativeView(), |
| 792 reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_EXPORT_MENU)); | 792 reinterpret_cast<void*>(IDS_BOOKMARK_MANAGER_EXPORT_MENU)); |
| 793 } | 793 } |
| OLD | NEW |