| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // The FindBarView is responsible for drawing the UI controls of the | 31 // The FindBarView is responsible for drawing the UI controls of the |
| 32 // FindBar, the find text box, the 'Find' button and the 'Close' | 32 // FindBar, the find text box, the 'Find' button and the 'Close' |
| 33 // button. It communicates the user search words to the FindBarHost. | 33 // button. It communicates the user search words to the FindBarHost. |
| 34 // | 34 // |
| 35 //////////////////////////////////////////////////////////////////////////////// | 35 //////////////////////////////////////////////////////////////////////////////// |
| 36 class FindBarView : public DropdownBarView, | 36 class FindBarView : public DropdownBarView, |
| 37 public views::ButtonListener, | 37 public views::ButtonListener, |
| 38 public views::TextfieldController, | 38 public views::TextfieldController, |
| 39 public views::ViewTargeterDelegate { | 39 public views::ViewTargeterDelegate { |
| 40 public: | 40 public: |
| 41 // A tag denoting which button the user pressed. | |
| 42 enum ButtonTag { | |
| 43 FIND_PREVIOUS_TAG = 0, // The Find Previous button. | |
| 44 FIND_NEXT_TAG, // The Find Next button. | |
| 45 CLOSE_TAG, // The Close button (the 'X'). | |
| 46 }; | |
| 47 | |
| 48 explicit FindBarView(FindBarHost* host); | 41 explicit FindBarView(FindBarHost* host); |
| 49 ~FindBarView() override; | 42 ~FindBarView() override; |
| 50 | 43 |
| 51 // Accessors for the text and selection displayed in the text box. | 44 // Accessors for the text and selection displayed in the text box. |
| 52 void SetFindTextAndSelectedRange(const base::string16& find_text, | 45 void SetFindTextAndSelectedRange(const base::string16& find_text, |
| 53 const gfx::Range& selected_range); | 46 const gfx::Range& selected_range); |
| 54 base::string16 GetFindText() const; | 47 base::string16 GetFindText() const; |
| 55 gfx::Range GetSelectedRange() const; | 48 gfx::Range GetSelectedRange() const; |
| 56 | 49 |
| 57 // Gets the selected text in the text box. | 50 // Gets the selected text in the text box. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 views::ImageButton* find_next_button_; | 140 views::ImageButton* find_next_button_; |
| 148 views::ImageButton* close_button_; | 141 views::ImageButton* close_button_; |
| 149 | 142 |
| 150 // The preferred height of the find bar. | 143 // The preferred height of the find bar. |
| 151 int preferred_height_; | 144 int preferred_height_; |
| 152 | 145 |
| 153 DISALLOW_COPY_AND_ASSIGN(FindBarView); | 146 DISALLOW_COPY_AND_ASSIGN(FindBarView); |
| 154 }; | 147 }; |
| 155 | 148 |
| 156 #endif // CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ | 149 #endif // CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ |
| OLD | NEW |