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" | 
| 11 #include "ui/app_list/search_box_model_observer.h" | 11 #include "ui/app_list/search_box_model_observer.h" | 
| 12 #include "ui/app_list/speech_ui_model_observer.h" | 12 #include "ui/app_list/speech_ui_model_observer.h" | 
| 13 #include "ui/app_list/views/app_list_view.h" | |
| 
 
xiyuan
2017/05/26 18:27:32
ditto
 
newcomer
2017/05/26 23:20:22
Done.
 
 | |
| 13 #include "ui/gfx/shadow_value.h" | 14 #include "ui/gfx/shadow_value.h" | 
| 14 #include "ui/views/controls/button/image_button.h" | 15 #include "ui/views/controls/button/image_button.h" | 
| 15 #include "ui/views/controls/textfield/textfield_controller.h" | 16 #include "ui/views/controls/textfield/textfield_controller.h" | 
| 16 #include "ui/views/view.h" | 17 #include "ui/views/view.h" | 
| 17 | 18 | 
| 18 namespace views { | 19 namespace views { | 
| 19 class Textfield; | 20 class Textfield; | 
| 20 } // namespace views | 21 } // namespace views | 
| 21 | 22 | 
| 22 namespace app_list { | 23 namespace app_list { | 
| (...skipping 24 matching lines...) Expand all Loading... | |
| 47 public SpeechUIModelObserver { | 48 public SpeechUIModelObserver { | 
| 48 public: | 49 public: | 
| 49 SearchBoxView(SearchBoxViewDelegate* delegate, | 50 SearchBoxView(SearchBoxViewDelegate* delegate, | 
| 50 AppListViewDelegate* view_delegate); | 51 AppListViewDelegate* view_delegate); | 
| 51 ~SearchBoxView() override; | 52 ~SearchBoxView() override; | 
| 52 | 53 | 
| 53 void ModelChanged(); | 54 void ModelChanged(); | 
| 54 bool HasSearch() const; | 55 bool HasSearch() const; | 
| 55 void ClearSearch(); | 56 void ClearSearch(); | 
| 56 | 57 | 
| 58 void SetAppListView(AppListView* app_list_view); | |
| 59 | |
| 57 // Sets the shadow border of the search box. | 60 // Sets the shadow border of the search box. | 
| 58 void SetShadow(const gfx::ShadowValue& shadow); | 61 void SetShadow(const gfx::ShadowValue& shadow); | 
| 59 | 62 | 
| 60 // Returns the bounds to use for the view (including the shadow) given the | 63 // Returns the bounds to use for the view (including the shadow) given the | 
| 61 // desired bounds of the search box contents. | 64 // desired bounds of the search box contents. | 
| 62 gfx::Rect GetViewBoundsForSearchBoxContentsBounds( | 65 gfx::Rect GetViewBoundsForSearchBoxContentsBounds( | 
| 63 const gfx::Rect& rect) const; | 66 const gfx::Rect& rect) const; | 
| 64 | 67 | 
| 65 views::ImageButton* back_button(); | 68 views::ImageButton* back_button(); | 
| 66 views::Textfield* search_box() { return search_box_; } | 69 views::Textfield* search_box() { return search_box_; } | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 | 115 | 
| 113 SearchBoxViewDelegate* delegate_; // Not owned. | 116 SearchBoxViewDelegate* delegate_; // Not owned. | 
| 114 AppListViewDelegate* view_delegate_; // Not owned. | 117 AppListViewDelegate* view_delegate_; // Not owned. | 
| 115 AppListModel* model_; // Owned by the profile-keyed service. | 118 AppListModel* model_; // Owned by the profile-keyed service. | 
| 116 | 119 | 
| 117 views::View* content_container_; // Owned by views hierarchy. | 120 views::View* content_container_; // Owned by views hierarchy. | 
| 118 SearchBoxImageButton* back_button_; // Owned by views hierarchy. | 121 SearchBoxImageButton* back_button_; // Owned by views hierarchy. | 
| 119 SearchBoxImageButton* speech_button_; // Owned by views hierarchy. | 122 SearchBoxImageButton* speech_button_; // Owned by views hierarchy. | 
| 120 views::Textfield* search_box_; // Owned by views hierarchy. | 123 views::Textfield* search_box_; // Owned by views hierarchy. | 
| 121 views::View* contents_view_; // Owned by views hierarchy. | 124 views::View* contents_view_; // Owned by views hierarchy. | 
| 125 app_list::AppListView* app_list_view_; // Owned by views hierarchy. | |
| 126 | |
| 127 bool is_fullscreen_enabled_; | |
| 122 | 128 | 
| 123 SearchBoxFocus focused_view_; // Which element has TAB'd focus. | 129 SearchBoxFocus focused_view_; // Which element has TAB'd focus. | 
| 124 | 130 | 
| 125 DISALLOW_COPY_AND_ASSIGN(SearchBoxView); | 131 DISALLOW_COPY_AND_ASSIGN(SearchBoxView); | 
| 126 }; | 132 }; | 
| 127 | 133 | 
| 128 } // namespace app_list | 134 } // namespace app_list | 
| 129 | 135 | 
| 130 #endif // UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ | 136 #endif // UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ | 
| OLD | NEW |