OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ASH_APP_LIST_SEARCH_BOX_VIEW_H_ |
| 6 #define ASH_APP_LIST_SEARCH_BOX_VIEW_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/timer.h" |
| 10 #include "ui/views/view.h" |
| 11 #include "ui/views/controls/textfield/textfield_controller.h" |
| 12 |
| 13 namespace views { |
| 14 class ImageView; |
| 15 class Textfield; |
| 16 } // namespace views |
| 17 |
| 18 namespace ash { |
| 19 |
| 20 class SearchBoxView : public views::View, |
| 21 public views::TextfieldController { |
| 22 public: |
| 23 SearchBoxView(); |
| 24 |
| 25 views::Textfield* search_box() const { |
| 26 return search_box_; |
| 27 } |
| 28 |
| 29 std::string search_text() const; |
| 30 |
| 31 private: |
| 32 // Overridden from views::View: |
| 33 virtual void Layout() OVERRIDE; |
| 34 |
| 35 // Overridden from views::TextfieldController: |
| 36 virtual void ContentsChanged(views::Textfield* sender, |
| 37 const string16& new_contents) OVERRIDE; |
| 38 virtual bool HandleKeyEvent(views::Textfield* sender, |
| 39 const views::KeyEvent& key_event) OVERRIDE; |
| 40 |
| 41 views::ImageView* white_search_; |
| 42 views::Textfield* search_box_; |
| 43 |
| 44 base::OneShotTimer<SearchBoxView> query_timer_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(SearchBoxView); |
| 47 }; |
| 48 |
| 49 } // namespace ash |
| 50 |
| 51 #endif // ASH_APP_LIST_SEARCH_BOX_VIEW_H_ |
OLD | NEW |