Chromium Code Reviews| 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 UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ |
| 6 #define UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 | 74 |
| 75 // Moves focus forward/backwards in response to TAB. | 75 // Moves focus forward/backwards in response to TAB. |
| 76 bool MoveTabFocus(bool move_backwards); | 76 bool MoveTabFocus(bool move_backwards); |
| 77 | 77 |
| 78 // Moves focus to contents or SearchBox and unselects buttons. | 78 // Moves focus to contents or SearchBox and unselects buttons. |
| 79 void ResetTabFocus(bool on_contents); | 79 void ResetTabFocus(bool on_contents); |
| 80 | 80 |
| 81 // Sets voice label for Back button depending on whether a folder is open. | 81 // Sets voice label for Back button depending on whether a folder is open. |
| 82 void SetBackButtonLabel(bool folder); | 82 void SetBackButtonLabel(bool folder); |
| 83 | 83 |
| 84 // Whether the cursor is being shown. | |
| 85 bool is_cursor_enabled() { return is_cursor_enabled_; } | |
|
vadimt
2017/06/21 17:44:56
const
newcomer
2017/06/21 20:53:26
Done.
| |
| 86 | |
| 87 // Aligns the placeholder text to the left/center, changes the colour of the | |
| 88 // placeholder text, and enable/disables the cursor. | |
| 89 void SetPlaceholderTextAndEnableCursor(bool enable); | |
| 90 | |
| 91 // Passes a mouse event to HandleMouseEvent, used for testing. | |
| 92 bool PassMouseEventForTesting(ui::MouseEvent& mouse_event); | |
| 93 | |
| 84 // Overridden from views::View: | 94 // Overridden from views::View: |
| 85 bool OnMouseWheel(const ui::MouseWheelEvent& event) override; | 95 bool OnMouseWheel(const ui::MouseWheelEvent& event) override; |
| 86 void OnEnabledChanged() override; | 96 void OnEnabledChanged() override; |
| 87 const char* GetClassName() const override; | 97 const char* GetClassName() const override; |
| 98 void OnGestureEvent(ui::GestureEvent* event) override; | |
| 99 void OnMouseEvent(ui::MouseEvent* event) override; | |
| 88 | 100 |
| 89 private: | 101 private: |
| 90 // Updates model text and selection model with current Textfield info. | 102 // Updates model text and selection model with current Textfield info. |
| 91 void UpdateModel(); | 103 void UpdateModel(); |
| 92 | 104 |
| 93 // Fires query change notification. | 105 // Fires query change notification. |
| 94 void NotifyQueryChanged(); | 106 void NotifyQueryChanged(); |
| 95 | 107 |
| 96 // Overridden from views::TextfieldController: | 108 // Overridden from views::TextfieldController: |
| 97 void ContentsChanged(views::Textfield* sender, | 109 void ContentsChanged(views::Textfield* sender, |
| 98 const base::string16& new_contents) override; | 110 const base::string16& new_contents) override; |
| 99 bool HandleKeyEvent(views::Textfield* sender, | 111 bool HandleKeyEvent(views::Textfield* sender, |
| 100 const ui::KeyEvent& key_event) override; | 112 const ui::KeyEvent& key_event) override; |
| 113 bool HandleMouseEvent(views::Textfield* sender, | |
| 114 const ui::MouseEvent& mouse_event) override; | |
| 115 void NotifyOfGestureEvent() override; | |
| 101 | 116 |
| 102 // Overridden from views::ButtonListener: | 117 // Overridden from views::ButtonListener: |
| 103 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 118 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 104 | 119 |
| 105 // Overridden from SearchBoxModelObserver: | 120 // Overridden from SearchBoxModelObserver: |
| 106 void SpeechRecognitionButtonPropChanged() override; | 121 void SpeechRecognitionButtonPropChanged() override; |
| 107 void HintTextChanged() override; | 122 void HintTextChanged() override; |
| 108 void SelectionModelChanged() override; | 123 void SelectionModelChanged() override; |
| 109 void Update() override; | 124 void Update() override; |
| 110 | 125 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 121 SearchBoxImageButton* back_button_; // Owned by views hierarchy. | 136 SearchBoxImageButton* back_button_; // Owned by views hierarchy. |
| 122 SearchBoxImageButton* speech_button_; // Owned by views hierarchy. | 137 SearchBoxImageButton* speech_button_; // Owned by views hierarchy. |
| 123 views::Textfield* search_box_; // Owned by views hierarchy. | 138 views::Textfield* search_box_; // Owned by views hierarchy. |
| 124 views::View* contents_view_; // Owned by views hierarchy. | 139 views::View* contents_view_; // Owned by views hierarchy. |
| 125 app_list::AppListView* app_list_view_; // Owned by views hierarchy. | 140 app_list::AppListView* app_list_view_; // Owned by views hierarchy. |
| 126 | 141 |
| 127 SearchBoxFocus focused_view_; // Which element has TAB'd focus. | 142 SearchBoxFocus focused_view_; // Which element has TAB'd focus. |
| 128 | 143 |
| 129 // Whether the fullscreen app list feature is enabled. | 144 // Whether the fullscreen app list feature is enabled. |
| 130 const bool is_fullscreen_app_list_enabled_; | 145 const bool is_fullscreen_app_list_enabled_; |
| 146 // Whether the cursor blink is enabled. | |
| 147 bool is_cursor_enabled_; | |
| 131 | 148 |
| 132 DISALLOW_COPY_AND_ASSIGN(SearchBoxView); | 149 DISALLOW_COPY_AND_ASSIGN(SearchBoxView); |
| 133 }; | 150 }; |
| 134 | 151 |
| 135 } // namespace app_list | 152 } // namespace app_list |
| 136 | 153 |
| 137 #endif // UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ | 154 #endif // UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ |
| OLD | NEW |