| 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 13 matching lines...) Expand all  Loading... | 
|   24 // Possible locations for partial keyboard focus (but note that the search |   24 // Possible locations for partial keyboard focus (but note that the search | 
|   25 // box always handles typing). |   25 // box always handles typing). | 
|   26 enum SearchBoxFocus { |   26 enum SearchBoxFocus { | 
|   27   FOCUS_BACK_BUTTON,    // Back button, only responds to ENTER |   27   FOCUS_BACK_BUTTON,    // Back button, only responds to ENTER | 
|   28   FOCUS_SEARCH_BOX,     // Nothing else has partial focus |   28   FOCUS_SEARCH_BOX,     // Nothing else has partial focus | 
|   29   FOCUS_MIC_BUTTON,     // Mic button, only responds to ENTER |   29   FOCUS_MIC_BUTTON,     // Mic button, only responds to ENTER | 
|   30   FOCUS_CONTENTS_VIEW,  // Something outside the SearchBox is selected |   30   FOCUS_CONTENTS_VIEW,  // Something outside the SearchBox is selected | 
|   31 }; |   31 }; | 
|   32  |   32  | 
|   33 class AppListModel; |   33 class AppListModel; | 
|   34 class AppListView; |  | 
|   35 class AppListViewDelegate; |   34 class AppListViewDelegate; | 
|   36 class SearchBoxModel; |   35 class SearchBoxModel; | 
|   37 class SearchBoxViewDelegate; |   36 class SearchBoxViewDelegate; | 
|   38 class SearchBoxImageButton; |   37 class SearchBoxImageButton; | 
|   39  |   38  | 
|   40 // SearchBoxView consists of an icon and a Textfield. SearchBoxModel is its data |   39 // SearchBoxView consists of an icon and a Textfield. SearchBoxModel is its data | 
|   41 // model that controls what icon to display, what placeholder text to use for |   40 // model that controls what icon to display, what placeholder text to use for | 
|   42 // Textfield. The text and selection model part could be set to change the |   41 // Textfield. The text and selection model part could be set to change the | 
|   43 // contents and selection model of the Textfield. |   42 // contents and selection model of the Textfield. | 
|   44 class APP_LIST_EXPORT SearchBoxView : public views::View, |   43 class APP_LIST_EXPORT SearchBoxView : public views::View, | 
|   45                                       public views::TextfieldController, |   44                                       public views::TextfieldController, | 
|   46                                       public views::ButtonListener, |   45                                       public views::ButtonListener, | 
|   47                                       public SearchBoxModelObserver, |   46                                       public SearchBoxModelObserver, | 
|   48                                       public SpeechUIModelObserver { |   47                                       public SpeechUIModelObserver { | 
|   49  public: |   48  public: | 
|   50   SearchBoxView(SearchBoxViewDelegate* delegate, |   49   SearchBoxView(SearchBoxViewDelegate* delegate, | 
|   51                 AppListViewDelegate* view_delegate, |   50                 AppListViewDelegate* view_delegate); | 
|   52                 AppListView* app_list_view = nullptr); |  | 
|   53   ~SearchBoxView() override; |   51   ~SearchBoxView() override; | 
|   54  |   52  | 
|   55   void ModelChanged(); |   53   void ModelChanged(); | 
|   56   bool HasSearch() const; |   54   bool HasSearch() const; | 
|   57   void ClearSearch(); |   55   void ClearSearch(); | 
|   58  |   56  | 
|   59   // Sets the shadow border of the search box. |   57   // Sets the shadow border of the search box. | 
|   60   void SetShadow(const gfx::ShadowValue& shadow); |   58   void SetShadow(const gfx::ShadowValue& shadow); | 
|   61  |   59  | 
|   62   // Returns the bounds to use for the view (including the shadow) given the |   60   // Returns the bounds to use for the view (including the shadow) given the | 
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  113  |  111  | 
|  114   SearchBoxViewDelegate* delegate_;  // Not owned. |  112   SearchBoxViewDelegate* delegate_;  // Not owned. | 
|  115   AppListViewDelegate* view_delegate_;  // Not owned. |  113   AppListViewDelegate* view_delegate_;  // Not owned. | 
|  116   AppListModel* model_;  // Owned by the profile-keyed service. |  114   AppListModel* model_;  // Owned by the profile-keyed service. | 
|  117  |  115  | 
|  118   views::View* content_container_;     // Owned by views hierarchy. |  116   views::View* content_container_;     // Owned by views hierarchy. | 
|  119   SearchBoxImageButton* back_button_;    // Owned by views hierarchy. |  117   SearchBoxImageButton* back_button_;    // Owned by views hierarchy. | 
|  120   SearchBoxImageButton* speech_button_;  // Owned by views hierarchy. |  118   SearchBoxImageButton* speech_button_;  // Owned by views hierarchy. | 
|  121   views::Textfield* search_box_;  // Owned by views hierarchy. |  119   views::Textfield* search_box_;  // Owned by views hierarchy. | 
|  122   views::View* contents_view_;  // Owned by views hierarchy. |  120   views::View* contents_view_;  // Owned by views hierarchy. | 
|  123   app_list::AppListView* app_list_view_;  // Owned by views hierarchy. |  | 
|  124  |  121  | 
|  125   SearchBoxFocus focused_view_;  // Which element has TAB'd focus. |  122   SearchBoxFocus focused_view_;  // Which element has TAB'd focus. | 
|  126  |  123  | 
|  127   DISALLOW_COPY_AND_ASSIGN(SearchBoxView); |  124   DISALLOW_COPY_AND_ASSIGN(SearchBoxView); | 
|  128 }; |  125 }; | 
|  129  |  126  | 
|  130 }  // namespace app_list |  127 }  // namespace app_list | 
|  131  |  128  | 
|  132 #endif  // UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ |  129 #endif  // UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ | 
| OLD | NEW |