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 20 matching lines...) Expand all Loading... | |
31 | 31 |
32 // AppListView is the top-level view and controller of app list UI. It creates | 32 // AppListView is the top-level view and controller of app list UI. It creates |
33 // and hosts a AppsGridView and passes AppListModel to it for display. | 33 // and hosts a AppsGridView and passes AppListModel to it for display. |
34 class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, | 34 class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, |
35 public SpeechUIModelObserver { | 35 public SpeechUIModelObserver { |
36 public: | 36 public: |
37 // Does not take ownership of |delegate|. | 37 // Does not take ownership of |delegate|. |
38 explicit AppListView(AppListViewDelegate* delegate); | 38 explicit AppListView(AppListViewDelegate* delegate); |
39 ~AppListView() override; | 39 ~AppListView() override; |
40 | 40 |
41 // Initializes the widget. | 41 // Helper function for Initialize, used when there is a flag. |
vadimt
2017/04/19 00:57:15
We use 'helper' in class names, not method names.
newcomer
2017/04/20 19:59:02
Done.
| |
42 void InitializeFullscreenHelper(gfx::NativeView parent, | |
sky
2017/04/19 15:18:51
Document what the parameters meant.
newcomer
2017/04/20 19:59:02
Done.
| |
43 int initial_apps_page, | |
44 const gfx::Rect display_work_area_bounds); | |
sky
2017/04/19 15:18:51
const gfx::Rect& here and 53.
newcomer
2017/04/20 19:59:02
Done.
| |
45 | |
46 // Helper function for Initialize, used when there is no flag. | |
47 void InitializeBubbleHelper(gfx::NativeView parent, int initial_apps_page); | |
sky
2017/04/19 15:18:51
Why do you need the InitializeHelper functions to
newcomer
2017/04/20 19:59:02
Thanks, I made the helper functions (now no longer
| |
48 | |
49 // Initializes the widget with a frame or a frameless view depending on | |
50 // command line switches. | |
51 void Initialize(gfx::NativeView parent, | |
52 int initial_apps_page, | |
53 const gfx::Rect display_work_area_bounds); | |
54 | |
55 // Initializes the widget as a bubble. Integrated into Initialize but | |
56 // kept around for its usage in app_list_presenter_delegate_mus.cc. | |
42 void InitAsBubble(gfx::NativeView parent, int initial_apps_page); | 57 void InitAsBubble(gfx::NativeView parent, int initial_apps_page); |
43 | 58 |
44 void SetBubbleArrow(views::BubbleBorder::Arrow arrow); | 59 void SetBubbleArrow(views::BubbleBorder::Arrow arrow); |
45 | 60 |
46 void SetAnchorPoint(const gfx::Point& anchor_point); | 61 void SetAnchorPoint(const gfx::Point& anchor_point); |
47 | 62 |
48 // If |drag_and_drop_host| is not NULL it will be called upon drag and drop | 63 // If |drag_and_drop_host| is not NULL it will be called upon drag and drop |
49 // operations outside the application list. This has to be called after | 64 // operations outside the application list. This has to be called after |
50 // InitAsBubble was called since the app list object needs to exist so that | 65 // InitAsBubble was called since the app list object needs to exist so that |
51 // it can set the host. | 66 // it can set the host. |
(...skipping 10 matching lines...) Expand all Loading... | |
62 | 77 |
63 // Enables/disables a semi-transparent overlay over the app list (good for | 78 // Enables/disables a semi-transparent overlay over the app list (good for |
64 // hiding the app list when a modal dialog is being shown). | 79 // hiding the app list when a modal dialog is being shown). |
65 void SetAppListOverlayVisible(bool visible); | 80 void SetAppListOverlayVisible(bool visible); |
66 | 81 |
67 views::Widget* search_box_widget() const { return search_box_widget_; } | 82 views::Widget* search_box_widget() const { return search_box_widget_; } |
68 | 83 |
69 // Overridden from views::View: | 84 // Overridden from views::View: |
70 gfx::Size GetPreferredSize() const override; | 85 gfx::Size GetPreferredSize() const override; |
71 void OnPaint(gfx::Canvas* canvas) override; | 86 void OnPaint(gfx::Canvas* canvas) override; |
87 const char* GetClassName() const override; | |
72 | 88 |
73 // WidgetDelegate overrides: | 89 // WidgetDelegate overrides: |
74 bool ShouldHandleSystemCommands() const override; | 90 bool ShouldHandleSystemCommands() const override; |
75 bool ShouldDescendIntoChildForEventHandling( | 91 bool ShouldDescendIntoChildForEventHandling( |
76 gfx::NativeView child, | 92 gfx::NativeView child, |
77 const gfx::Point& location) override; | 93 const gfx::Point& location) override; |
78 | 94 |
79 AppListMainView* app_list_main_view() { return app_list_main_view_; } | 95 AppListMainView* app_list_main_view() { return app_list_main_view_; } |
80 | 96 |
81 // Gets the PaginationModel owned by this view's apps grid. | 97 // Gets the PaginationModel owned by this view's apps grid. |
(...skipping 28 matching lines...) Expand all Loading... | |
110 // Overridden from SpeechUIModelObserver: | 126 // Overridden from SpeechUIModelObserver: |
111 void OnSpeechRecognitionStateChanged( | 127 void OnSpeechRecognitionStateChanged( |
112 SpeechRecognitionState new_state) override; | 128 SpeechRecognitionState new_state) override; |
113 | 129 |
114 AppListViewDelegate* delegate_; // Weak. Owned by AppListService. | 130 AppListViewDelegate* delegate_; // Weak. Owned by AppListService. |
115 | 131 |
116 AppListMainView* app_list_main_view_; | 132 AppListMainView* app_list_main_view_; |
117 SpeechView* speech_view_; | 133 SpeechView* speech_view_; |
118 | 134 |
119 views::View* search_box_focus_host_; // Owned by the views hierarchy. | 135 views::View* search_box_focus_host_; // Owned by the views hierarchy. |
120 views::Widget* search_box_widget_; // Owned by the app list's widget. | 136 views::Widget* search_box_widget_; // Owned by the app list's widget. |
121 SearchBoxView* search_box_view_; // Owned by |search_box_widget_|. | 137 SearchBoxView* search_box_view_; // Owned by |search_box_widget_|. |
122 | 138 |
123 // A semi-transparent white overlay that covers the app list while dialogs are | 139 // A semi-transparent white overlay that covers the app list while dialogs are |
124 // open. | 140 // open. |
125 views::View* overlay_view_; | 141 views::View* overlay_view_; |
126 | 142 |
127 std::unique_ptr<HideViewAnimationObserver> animation_observer_; | 143 std::unique_ptr<HideViewAnimationObserver> animation_observer_; |
128 | 144 |
129 // For UMA and testing. If non-null, triggered when the app list is painted. | 145 // For UMA and testing. If non-null, triggered when the app list is painted. |
130 base::Closure next_paint_callback_; | 146 base::Closure next_paint_callback_; |
131 | 147 |
132 DISALLOW_COPY_AND_ASSIGN(AppListView); | 148 DISALLOW_COPY_AND_ASSIGN(AppListView); |
133 }; | 149 }; |
134 | 150 |
135 } // namespace app_list | 151 } // namespace app_list |
136 | 152 |
137 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ | 153 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ |
OLD | NEW |