Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Side by Side Diff: ui/app_list/views/search_box_view.h

Issue 681873002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/app_list/views/pulsing_block_view.h ('k') | ui/app_list/views/search_box_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/app_list/search_box_model_observer.h" 10 #include "ui/app_list/search_box_model_observer.h"
(...skipping 23 matching lines...) Expand all
34 // contents and selection model of the Textfield. 34 // contents and selection model of the Textfield.
35 class APP_LIST_EXPORT SearchBoxView : public views::View, 35 class APP_LIST_EXPORT SearchBoxView : public views::View,
36 public views::TextfieldController, 36 public views::TextfieldController,
37 public views::ButtonListener, 37 public views::ButtonListener,
38 public views::MenuButtonListener, 38 public views::MenuButtonListener,
39 public SearchBoxModelObserver, 39 public SearchBoxModelObserver,
40 public SpeechUIModelObserver { 40 public SpeechUIModelObserver {
41 public: 41 public:
42 SearchBoxView(SearchBoxViewDelegate* delegate, 42 SearchBoxView(SearchBoxViewDelegate* delegate,
43 AppListViewDelegate* view_delegate); 43 AppListViewDelegate* view_delegate);
44 virtual ~SearchBoxView(); 44 ~SearchBoxView() override;
45 45
46 void ModelChanged(); 46 void ModelChanged();
47 bool HasSearch() const; 47 bool HasSearch() const;
48 void ClearSearch(); 48 void ClearSearch();
49 void InvalidateMenu(); 49 void InvalidateMenu();
50 50
51 views::Textfield* search_box() { return search_box_; } 51 views::Textfield* search_box() { return search_box_; }
52 52
53 void set_contents_view(views::View* contents_view) { 53 void set_contents_view(views::View* contents_view) {
54 contents_view_ = contents_view; 54 contents_view_ = contents_view;
55 } 55 }
56 56
57 // Overridden from views::View: 57 // Overridden from views::View:
58 virtual gfx::Size GetPreferredSize() const override; 58 gfx::Size GetPreferredSize() const override;
59 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) override; 59 bool OnMouseWheel(const ui::MouseWheelEvent& event) override;
60 60
61 private: 61 private:
62 // Updates model text and selection model with current Textfield info. 62 // Updates model text and selection model with current Textfield info.
63 void UpdateModel(); 63 void UpdateModel();
64 64
65 // Fires query change notification. 65 // Fires query change notification.
66 void NotifyQueryChanged(); 66 void NotifyQueryChanged();
67 67
68 // Overridden from views::TextfieldController: 68 // Overridden from views::TextfieldController:
69 virtual void ContentsChanged(views::Textfield* sender, 69 void ContentsChanged(views::Textfield* sender,
70 const base::string16& new_contents) override; 70 const base::string16& new_contents) override;
71 virtual bool HandleKeyEvent(views::Textfield* sender, 71 bool HandleKeyEvent(views::Textfield* sender,
72 const ui::KeyEvent& key_event) override; 72 const ui::KeyEvent& key_event) override;
73 73
74 // Overridden from views::ButtonListener: 74 // Overridden from views::ButtonListener:
75 virtual void ButtonPressed(views::Button* sender, 75 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
76 const ui::Event& event) override;
77 76
78 // Overridden from views::MenuButtonListener: 77 // Overridden from views::MenuButtonListener:
79 virtual void OnMenuButtonClicked(View* source, 78 void OnMenuButtonClicked(View* source, const gfx::Point& point) override;
80 const gfx::Point& point) override;
81 79
82 // Overridden from SearchBoxModelObserver: 80 // Overridden from SearchBoxModelObserver:
83 virtual void IconChanged() override; 81 void IconChanged() override;
84 virtual void SpeechRecognitionButtonPropChanged() override; 82 void SpeechRecognitionButtonPropChanged() override;
85 virtual void HintTextChanged() override; 83 void HintTextChanged() override;
86 virtual void SelectionModelChanged() override; 84 void SelectionModelChanged() override;
87 virtual void TextChanged() override; 85 void TextChanged() override;
88 86
89 // Overridden from SpeechUIModelObserver: 87 // Overridden from SpeechUIModelObserver:
90 virtual void OnSpeechRecognitionStateChanged( 88 void OnSpeechRecognitionStateChanged(
91 SpeechRecognitionState new_state) override; 89 SpeechRecognitionState new_state) override;
92 90
93 SearchBoxViewDelegate* delegate_; // Not owned. 91 SearchBoxViewDelegate* delegate_; // Not owned.
94 AppListViewDelegate* view_delegate_; // Not owned. 92 AppListViewDelegate* view_delegate_; // Not owned.
95 AppListModel* model_; // Owned by the profile-keyed service. 93 AppListModel* model_; // Owned by the profile-keyed service.
96 94
97 scoped_ptr<AppListMenuViews> menu_; 95 scoped_ptr<AppListMenuViews> menu_;
98 96
99 views::ImageView* icon_view_; // Owned by views hierarchy. 97 views::ImageView* icon_view_; // Owned by views hierarchy.
100 views::ImageButton* speech_button_; // Owned by views hierarchy. 98 views::ImageButton* speech_button_; // Owned by views hierarchy.
101 views::MenuButton* menu_button_; // Owned by views hierarchy. 99 views::MenuButton* menu_button_; // Owned by views hierarchy.
102 views::Textfield* search_box_; // Owned by views hierarchy. 100 views::Textfield* search_box_; // Owned by views hierarchy.
103 views::View* contents_view_; // Owned by views hierarchy. 101 views::View* contents_view_; // Owned by views hierarchy.
104 102
105 DISALLOW_COPY_AND_ASSIGN(SearchBoxView); 103 DISALLOW_COPY_AND_ASSIGN(SearchBoxView);
106 }; 104 };
107 105
108 } // namespace app_list 106 } // namespace app_list
109 107
110 #endif // UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ 108 #endif // UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_
OLDNEW
« no previous file with comments | « ui/app_list/views/pulsing_block_view.h ('k') | ui/app_list/views/search_box_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698