| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 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 MANDOLINE_UI_DESKTOP_UI_FIND_BAR_VIEW_H_ | |
| 6 #define MANDOLINE_UI_DESKTOP_UI_FIND_BAR_VIEW_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "ui/views/controls/button/label_button.h" | |
| 10 #include "ui/views/controls/textfield/textfield_controller.h" | |
| 11 #include "ui/views/view.h" | |
| 12 | |
| 13 namespace views { | |
| 14 class BoxLayout; | |
| 15 class Label; | |
| 16 class Textfield; | |
| 17 } | |
| 18 | |
| 19 namespace mandoline { | |
| 20 | |
| 21 class FindBarDelegate; | |
| 22 | |
| 23 // Owns the widgets which show the find bar. | |
| 24 class FindBarView : public views::View, | |
| 25 public views::TextfieldController, | |
| 26 public views::ButtonListener { | |
| 27 public: | |
| 28 FindBarView(FindBarDelegate* delegate); | |
| 29 ~FindBarView() override; | |
| 30 | |
| 31 void Show(); | |
| 32 void Hide(); | |
| 33 | |
| 34 void SetMatchLabel(int result, int total); | |
| 35 | |
| 36 private: | |
| 37 // Overridden from views::TextfieldController: | |
| 38 void ContentsChanged(views::Textfield* sender, | |
| 39 const base::string16& new_contents) override; | |
| 40 | |
| 41 // Overridden from views::ButtonListener: | |
| 42 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | |
| 43 | |
| 44 FindBarDelegate* delegate_; | |
| 45 | |
| 46 views::BoxLayout* layout_; | |
| 47 views::Textfield* text_field_; | |
| 48 views::Label* match_count_label_; | |
| 49 views::LabelButton* next_button_; | |
| 50 views::LabelButton* prev_button_; | |
| 51 views::LabelButton* close_button_; | |
| 52 | |
| 53 std::string last_find_string_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(FindBarView); | |
| 56 }; | |
| 57 | |
| 58 } // namespace mandoline | |
| 59 | |
| 60 #endif // MANDOLINE_UI_DESKTOP_UI_FIND_BAR_VIEW_H_ | |
| OLD | NEW |