| 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/autocomplete/autocomplete_edit_view_mac.h" | 5 #include "chrome/browser/autocomplete/autocomplete_edit_view_mac.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> // kVK_Return | 7 #include <Carbon/Carbon.h> // kVK_Return |
| 8 | 8 |
| 9 #include "app/clipboard/clipboard.h" | 9 #include "app/clipboard/clipboard.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 model_->OnUpOrDownKeyPressed(model_->result().size()); | 593 model_->OnUpOrDownKeyPressed(model_->result().size()); |
| 594 return true; | 594 return true; |
| 595 } | 595 } |
| 596 | 596 |
| 597 if (cmd == @selector(scrollPageUp:)) { | 597 if (cmd == @selector(scrollPageUp:)) { |
| 598 model_->OnUpOrDownKeyPressed(-model_->result().size()); | 598 model_->OnUpOrDownKeyPressed(-model_->result().size()); |
| 599 return true; | 599 return true; |
| 600 } | 600 } |
| 601 | 601 |
| 602 if (cmd == @selector(cancelOperation:)) { | 602 if (cmd == @selector(cancelOperation:)) { |
| 603 model_->OnEscapeKeyPressed(); | 603 return model_->OnEscapeKeyPressed(); |
| 604 return true; | |
| 605 } | 604 } |
| 606 | 605 |
| 607 if (cmd == @selector(insertTab:)) { | 606 if (cmd == @selector(insertTab:)) { |
| 608 if (model_->is_keyword_hint() && !model_->keyword().empty()) { | 607 if (model_->is_keyword_hint() && !model_->keyword().empty()) { |
| 609 model_->AcceptKeyword(); | 608 model_->AcceptKeyword(); |
| 610 return true; | 609 return true; |
| 611 } | 610 } |
| 612 } | 611 } |
| 613 | 612 |
| 614 // TODO(shess): Option-tab, would normally insert a literal tab | 613 // TODO(shess): Option-tab, would normally insert a literal tab |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 clipboard->ReadBookmark(NULL, &url_str); | 805 clipboard->ReadBookmark(NULL, &url_str); |
| 807 // pass resulting url string through GURL to normalize | 806 // pass resulting url string through GURL to normalize |
| 808 GURL url(url_str); | 807 GURL url(url_str); |
| 809 if (url.is_valid()) { | 808 if (url.is_valid()) { |
| 810 return UTF8ToWide(url.spec()); | 809 return UTF8ToWide(url.spec()); |
| 811 } | 810 } |
| 812 } | 811 } |
| 813 | 812 |
| 814 return std::wstring(); | 813 return std::wstring(); |
| 815 } | 814 } |
| OLD | NEW |