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

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

Issue 508813002: Move ownership of the AppListViewDelegate into the AppListService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 6 years, 3 months 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/demo/app_list_demo_views.cc ('k') | ui/app_list/views/app_list_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_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 24 matching lines...) Expand all
35 class HideViewAnimationObserver; 35 class HideViewAnimationObserver;
36 class PaginationModel; 36 class PaginationModel;
37 class SpeechView; 37 class SpeechView;
38 38
39 // AppListView is the top-level view and controller of app list UI. It creates 39 // AppListView is the top-level view and controller of app list UI. It creates
40 // and hosts a AppsGridView and passes AppListModel to it for display. 40 // and hosts a AppsGridView and passes AppListModel to it for display.
41 class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView, 41 class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView,
42 public AppListViewDelegateObserver, 42 public AppListViewDelegateObserver,
43 public SpeechUIModelObserver { 43 public SpeechUIModelObserver {
44 public: 44 public:
45 // Takes ownership of |delegate|. 45 // Does not take ownership of |delegate|.
46 explicit AppListView(AppListViewDelegate* delegate); 46 explicit AppListView(AppListViewDelegate* delegate);
47 virtual ~AppListView(); 47 virtual ~AppListView();
48 48
49 // Initializes the widget and use a given |anchor| plus an |anchor_offset| for 49 // Initializes the widget and use a given |anchor| plus an |anchor_offset| for
50 // positioning. 50 // positioning.
51 void InitAsBubbleAttachedToAnchor(gfx::NativeView parent, 51 void InitAsBubbleAttachedToAnchor(gfx::NativeView parent,
52 int initial_apps_page, 52 int initial_apps_page,
53 views::View* anchor, 53 views::View* anchor,
54 const gfx::Vector2d& anchor_offset, 54 const gfx::Vector2d& anchor_offset,
55 views::BubbleBorder::Arrow arrow, 55 views::BubbleBorder::Arrow arrow,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; 149 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE;
150 virtual void OnWidgetVisibilityChanged( 150 virtual void OnWidgetVisibilityChanged(
151 views::Widget* widget, bool visible) OVERRIDE; 151 views::Widget* widget, bool visible) OVERRIDE;
152 virtual void OnWidgetActivationChanged( 152 virtual void OnWidgetActivationChanged(
153 views::Widget* widget, bool active) OVERRIDE; 153 views::Widget* widget, bool active) OVERRIDE;
154 154
155 // Overridden from SpeechUIModelObserver: 155 // Overridden from SpeechUIModelObserver:
156 virtual void OnSpeechRecognitionStateChanged( 156 virtual void OnSpeechRecognitionStateChanged(
157 SpeechRecognitionState new_state) OVERRIDE; 157 SpeechRecognitionState new_state) OVERRIDE;
158 158
159 scoped_ptr<AppListViewDelegate> delegate_; 159 AppListViewDelegate* delegate_; // Weak. Owned by AppListService.
160 160
161 AppListMainView* app_list_main_view_; 161 AppListMainView* app_list_main_view_;
162 SpeechView* speech_view_; 162 SpeechView* speech_view_;
163 163
164 // The red "experimental" banner for the experimental app list. 164 // The red "experimental" banner for the experimental app list.
165 views::ImageView* experimental_banner_view_; 165 views::ImageView* experimental_banner_view_;
166 166
167 // A semi-transparent white overlay that covers the app list while dialogs are 167 // A semi-transparent white overlay that covers the app list while dialogs are
168 // open. 168 // open.
169 views::View* overlay_view_; 169 views::View* overlay_view_;
170 170
171 ObserverList<AppListViewObserver> observers_; 171 ObserverList<AppListViewObserver> observers_;
172 scoped_ptr<HideViewAnimationObserver> animation_observer_; 172 scoped_ptr<HideViewAnimationObserver> animation_observer_;
173 173
174 // For UMA and testing. If non-null, triggered when the app list is painted. 174 // For UMA and testing. If non-null, triggered when the app list is painted.
175 base::Closure next_paint_callback_; 175 base::Closure next_paint_callback_;
176 176
177 DISALLOW_COPY_AND_ASSIGN(AppListView); 177 DISALLOW_COPY_AND_ASSIGN(AppListView);
178 }; 178 };
179 179
180 } // namespace app_list 180 } // namespace app_list
181 181
182 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ 182 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_
OLDNEW
« no previous file with comments | « ui/app_list/demo/app_list_demo_views.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