Chromium Code Reviews| 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 { | 74 virtual bool IsFocusableInRootView() const OVERRIDE { |
|
Ben Goodger (Google)
2011/12/16 16:20:23
Questions:
When you open a popup window (www.popu
| |
| 75 // Bypass Textfield::IsFocusable. The omnibox in popup window requires | 75 // Bypass Textfield::IsFocusable. The omnibox in popup window requires |
| 76 // focus in order for text selection to work. | 76 // focus in order for text selection to work. |
| 77 return views::View::IsFocusable(); | 77 return views::View::focusable(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE { | 80 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE { |
| 81 return omnibox_view_->HandleMousePressEvent(event); | 81 return omnibox_view_->HandleMousePressEvent(event); |
| 82 } | 82 } |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 OmniboxViewViews* omnibox_view_; | 85 OmniboxViewViews* omnibox_view_; |
| 86 | 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(AutocompleteTextfield); | 87 DISALLOW_COPY_AND_ASSIGN(AutocompleteTextfield); |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 775 OmniboxViewViews* omnibox_view = new OmniboxViewViews(controller, | 775 OmniboxViewViews* omnibox_view = new OmniboxViewViews(controller, |
| 776 toolbar_model, | 776 toolbar_model, |
| 777 profile, | 777 profile, |
| 778 command_updater, | 778 command_updater, |
| 779 popup_window_mode, | 779 popup_window_mode, |
| 780 location_bar); | 780 location_bar); |
| 781 omnibox_view->Init(); | 781 omnibox_view->Init(); |
| 782 return omnibox_view; | 782 return omnibox_view; |
| 783 } | 783 } |
| 784 #endif | 784 #endif |
| OLD | NEW |