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

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

Issue 770813004: Make app list search box into a Widget. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@matt_remove_dummy_search_box
Patch Set: addTODO Created 6 years 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
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_APP_LIST_VIEW_H_ 5 #ifndef UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_
6 #define UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ 6 #define UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 void UpdateBounds(); 89 void UpdateBounds();
90 90
91 // Enables/disables a semi-transparent overlay over the app list (good for 91 // Enables/disables a semi-transparent overlay over the app list (good for
92 // hiding the app list when a modal dialog is being shown). 92 // hiding the app list when a modal dialog is being shown).
93 void SetAppListOverlayVisible(bool visible); 93 void SetAppListOverlayVisible(bool visible);
94 94
95 // Returns true if the app list should be centered and in landscape mode. 95 // Returns true if the app list should be centered and in landscape mode.
96 bool ShouldCenterWindow() const; 96 bool ShouldCenterWindow() const;
97 97
98 SearchBoxView* search_box_view() const { return search_box_view_; } 98 views::Widget* search_box_widget() const { return search_box_widget_; }
99 99
100 // Overridden from views::View: 100 // Overridden from views::View:
101 gfx::Size GetPreferredSize() const override; 101 gfx::Size GetPreferredSize() const override;
102 void Paint(gfx::Canvas* canvas, const views::CullSet& cull_set) override; 102 void Paint(gfx::Canvas* canvas, const views::CullSet& cull_set) override;
103 void OnThemeChanged() override; 103 void OnThemeChanged() override;
104 104
105 // WidgetDelegate overrides: 105 // WidgetDelegate overrides:
106 bool ShouldHandleSystemCommands() const override; 106 bool ShouldHandleSystemCommands() const override;
107 107
108 // Overridden from AppListViewDelegateObserver: 108 // Overridden from AppListViewDelegateObserver:
(...skipping 22 matching lines...) Expand all
131 // Overridden from views::View: 131 // Overridden from views::View:
132 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; 132 bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
133 void Layout() override; 133 void Layout() override;
134 void SchedulePaintInRect(const gfx::Rect& rect) override; 134 void SchedulePaintInRect(const gfx::Rect& rect) override;
135 135
136 private: 136 private:
137 friend class ::test::AppListViewTestApi; 137 friend class ::test::AppListViewTestApi;
138 138
139 void InitContents(gfx::NativeView parent, int initial_apps_page); 139 void InitContents(gfx::NativeView parent, int initial_apps_page);
140 140
141 void InitChildWidgets();
142
141 void InitAsBubbleInternal(gfx::NativeView parent, 143 void InitAsBubbleInternal(gfx::NativeView parent,
142 int initial_apps_page, 144 int initial_apps_page,
143 views::BubbleBorder::Arrow arrow, 145 views::BubbleBorder::Arrow arrow,
144 bool border_accepts_events, 146 bool border_accepts_events,
145 const gfx::Vector2d& anchor_offset); 147 const gfx::Vector2d& anchor_offset);
146 148
147 // Overridden from views::BubbleDelegateView: 149 // Overridden from views::BubbleDelegateView:
148 void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params, 150 void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params,
149 views::Widget* widget) const override; 151 views::Widget* widget) const override;
150 152
151 // Overridden from views::WidgetDelegateView: 153 // Overridden from views::WidgetDelegateView:
152 views::View* GetInitiallyFocusedView() override; 154 views::View* GetInitiallyFocusedView() override;
153 gfx::ImageSkia GetWindowIcon() override; 155 gfx::ImageSkia GetWindowIcon() override;
154 bool WidgetHasHitTestMask() const override; 156 bool WidgetHasHitTestMask() const override;
155 void GetWidgetHitTestMask(gfx::Path* mask) const override; 157 void GetWidgetHitTestMask(gfx::Path* mask) const override;
156 158
157 // Overridden from views::WidgetObserver: 159 // Overridden from views::WidgetObserver:
158 void OnWidgetDestroying(views::Widget* widget) override; 160 void OnWidgetDestroying(views::Widget* widget) override;
159 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; 161 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override;
160 void OnWidgetActivationChanged(views::Widget* widget, bool active) override; 162 void OnWidgetActivationChanged(views::Widget* widget, bool active) override;
161 163
162 // Overridden from SpeechUIModelObserver: 164 // Overridden from SpeechUIModelObserver:
163 void OnSpeechRecognitionStateChanged( 165 void OnSpeechRecognitionStateChanged(
164 SpeechRecognitionState new_state) override; 166 SpeechRecognitionState new_state) override;
165 167
166 AppListViewDelegate* delegate_; // Weak. Owned by AppListService. 168 AppListViewDelegate* delegate_; // Weak. Owned by AppListService.
167 169
168 AppListMainView* app_list_main_view_; 170 AppListMainView* app_list_main_view_;
169 SearchBoxView* search_box_view_;
170 SpeechView* speech_view_; 171 SpeechView* speech_view_;
171 172
173 views::Widget* search_box_widget_; // Owned by the app list's widget.
174 SearchBoxView* search_box_view_; // Owned by |search_box_widget_|.
175
172 // A semi-transparent white overlay that covers the app list while dialogs are 176 // A semi-transparent white overlay that covers the app list while dialogs are
173 // open. 177 // open.
174 views::View* overlay_view_; 178 views::View* overlay_view_;
175 179
176 ObserverList<AppListViewObserver> observers_; 180 ObserverList<AppListViewObserver> observers_;
177 scoped_ptr<HideViewAnimationObserver> animation_observer_; 181 scoped_ptr<HideViewAnimationObserver> animation_observer_;
178 182
179 // For UMA and testing. If non-null, triggered when the app list is painted. 183 // For UMA and testing. If non-null, triggered when the app list is painted.
180 base::Closure next_paint_callback_; 184 base::Closure next_paint_callback_;
181 185
182 DISALLOW_COPY_AND_ASSIGN(AppListView); 186 DISALLOW_COPY_AND_ASSIGN(AppListView);
183 }; 187 };
184 188
185 } // namespace app_list 189 } // namespace app_list
186 190
187 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ 191 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc ('k') | ui/app_list/views/app_list_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698