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_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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // AppListView is the top-level view and controller of app list UI. It creates | 38 // AppListView is the top-level view and controller of app list UI. It creates |
39 // and hosts a AppsGridView and passes AppListModel to it for display. | 39 // and hosts a AppsGridView and passes AppListModel to it for display. |
40 class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, | 40 class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, |
41 public SpeechUIModelObserver { | 41 public SpeechUIModelObserver { |
42 public: | 42 public: |
43 // Does not take ownership of |delegate|. | 43 // Does not take ownership of |delegate|. |
44 explicit AppListView(AppListViewDelegate* delegate); | 44 explicit AppListView(AppListViewDelegate* delegate); |
45 ~AppListView() override; | 45 ~AppListView() override; |
46 | 46 |
47 // Initializes the widget and use a fixed |anchor_point_in_screen| for | 47 // Initializes the widget. |
48 // positioning. | 48 void InitAsBubble(gfx::NativeView parent, int initial_apps_page); |
49 void InitAsBubbleAtFixedLocation(gfx::NativeView parent, | |
50 int initial_apps_page, | |
51 const gfx::Point& anchor_point_in_screen, | |
52 views::BubbleBorder::Arrow arrow, | |
53 bool border_accepts_events); | |
54 | 49 |
55 // Initializes the widget as a frameless window, not a bubble. | 50 // Initializes the widget as a frameless window, not a bubble. |
56 void InitAsFramelessWindow(gfx::NativeView parent, | 51 void InitAsFramelessWindow(gfx::NativeView parent, |
57 int initial_apps_page, | 52 int initial_apps_page, |
58 gfx::Rect bounds); | 53 gfx::Rect bounds); |
59 | 54 |
60 void SetBubbleArrow(views::BubbleBorder::Arrow arrow); | 55 void SetBubbleArrow(views::BubbleBorder::Arrow arrow); |
61 | 56 |
62 void SetAnchorPoint(const gfx::Point& anchor_point); | 57 void SetAnchorPoint(const gfx::Point& anchor_point); |
63 | 58 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 void Layout() override; | 102 void Layout() override; |
108 void SchedulePaintInRect(const gfx::Rect& rect) override; | 103 void SchedulePaintInRect(const gfx::Rect& rect) override; |
109 | 104 |
110 private: | 105 private: |
111 friend class test::AppListViewTestApi; | 106 friend class test::AppListViewTestApi; |
112 | 107 |
113 void InitContents(gfx::NativeView parent, int initial_apps_page); | 108 void InitContents(gfx::NativeView parent, int initial_apps_page); |
114 | 109 |
115 void InitChildWidgets(); | 110 void InitChildWidgets(); |
116 | 111 |
117 void InitAsBubbleInternal(gfx::NativeView parent, | |
118 int initial_apps_page, | |
119 views::BubbleBorder::Arrow arrow, | |
120 bool border_accepts_events, | |
121 const gfx::Vector2d& anchor_offset); | |
122 | |
123 // Overridden from views::BubbleDialogDelegateView: | 112 // Overridden from views::BubbleDialogDelegateView: |
124 void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params, | 113 void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params, |
125 views::Widget* widget) const override; | 114 views::Widget* widget) const override; |
126 int GetDialogButtons() const override; | 115 int GetDialogButtons() const override; |
127 | 116 |
128 // Overridden from views::WidgetDelegateView: | 117 // Overridden from views::WidgetDelegateView: |
129 views::View* GetInitiallyFocusedView() override; | 118 views::View* GetInitiallyFocusedView() override; |
130 bool WidgetHasHitTestMask() const override; | 119 bool WidgetHasHitTestMask() const override; |
131 void GetWidgetHitTestMask(gfx::Path* mask) const override; | 120 void GetWidgetHitTestMask(gfx::Path* mask) const override; |
132 | 121 |
(...skipping 24 matching lines...) Expand all Loading... |
157 | 146 |
158 // For UMA and testing. If non-null, triggered when the app list is painted. | 147 // For UMA and testing. If non-null, triggered when the app list is painted. |
159 base::Closure next_paint_callback_; | 148 base::Closure next_paint_callback_; |
160 | 149 |
161 DISALLOW_COPY_AND_ASSIGN(AppListView); | 150 DISALLOW_COPY_AND_ASSIGN(AppListView); |
162 }; | 151 }; |
163 | 152 |
164 } // namespace app_list | 153 } // namespace app_list |
165 | 154 |
166 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ | 155 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ |
OLD | NEW |