| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/views/omnibox/omnibox_view_views.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE { | 65 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE { |
| 66 bool handled = views::Textfield::OnKeyPressed(event); | 66 bool handled = views::Textfield::OnKeyPressed(event); |
| 67 return omnibox_view_->HandleAfterKeyEvent(event, handled) || handled; | 67 return omnibox_view_->HandleAfterKeyEvent(event, handled) || handled; |
| 68 } | 68 } |
| 69 | 69 |
| 70 virtual bool OnKeyReleased(const views::KeyEvent& event) OVERRIDE { | 70 virtual bool OnKeyReleased(const views::KeyEvent& event) OVERRIDE { |
| 71 return omnibox_view_->HandleKeyReleaseEvent(event); | 71 return omnibox_view_->HandleKeyReleaseEvent(event); |
| 72 } | 72 } |
| 73 | 73 |
| 74 virtual bool IsFocusable() const OVERRIDE { | |
| 75 // Bypass Textfield::IsFocusable. The omnibox in popup window requires | |
| 76 // focus in order for text selection to work. | |
| 77 return views::View::IsFocusable(); | |
| 78 } | |
| 79 | |
| 80 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE { | 74 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE { |
| 81 return omnibox_view_->HandleMousePressEvent(event); | 75 return omnibox_view_->HandleMousePressEvent(event); |
| 82 } | 76 } |
| 83 | 77 |
| 84 private: | 78 private: |
| 85 OmniboxViewViews* omnibox_view_; | 79 OmniboxViewViews* omnibox_view_; |
| 86 | 80 |
| 87 DISALLOW_COPY_AND_ASSIGN(AutocompleteTextfield); | 81 DISALLOW_COPY_AND_ASSIGN(AutocompleteTextfield); |
| 88 }; | 82 }; |
| 89 | 83 |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 OmniboxViewViews* omnibox_view = new OmniboxViewViews(controller, | 769 OmniboxViewViews* omnibox_view = new OmniboxViewViews(controller, |
| 776 toolbar_model, | 770 toolbar_model, |
| 777 profile, | 771 profile, |
| 778 command_updater, | 772 command_updater, |
| 779 popup_window_mode, | 773 popup_window_mode, |
| 780 location_bar); | 774 location_bar); |
| 781 omnibox_view->Init(); | 775 omnibox_view->Init(); |
| 782 return omnibox_view; | 776 return omnibox_view; |
| 783 } | 777 } |
| 784 #endif | 778 #endif |
| OLD | NEW |