| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // AppListView is the top-level view and controller of app list UI. It creates | 43 // AppListView is the top-level view and controller of app list UI. It creates |
| 44 // and hosts a AppsGridView and passes AppListModel to it for display. | 44 // and hosts a AppsGridView and passes AppListModel to it for display. |
| 45 class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, | 45 class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, |
| 46 public AppListViewDelegateObserver, | 46 public AppListViewDelegateObserver, |
| 47 public SpeechUIModelObserver { | 47 public SpeechUIModelObserver { |
| 48 public: | 48 public: |
| 49 // Does not take ownership of |delegate|. | 49 // Does not take ownership of |delegate|. |
| 50 explicit AppListView(AppListViewDelegate* delegate); | 50 explicit AppListView(AppListViewDelegate* delegate); |
| 51 ~AppListView() override; | 51 ~AppListView() override; |
| 52 | 52 |
| 53 // Initializes the widget and use a given |anchor| plus an |anchor_offset| for | |
| 54 // positioning. | |
| 55 void InitAsBubbleAttachedToAnchor(gfx::NativeView parent, | |
| 56 int initial_apps_page, | |
| 57 views::View* anchor, | |
| 58 const gfx::Vector2d& anchor_offset, | |
| 59 views::BubbleBorder::Arrow arrow, | |
| 60 bool border_accepts_events); | |
| 61 | |
| 62 // Initializes the widget and use a fixed |anchor_point_in_screen| for | 53 // Initializes the widget and use a fixed |anchor_point_in_screen| for |
| 63 // positioning. | 54 // positioning. |
| 64 void InitAsBubbleAtFixedLocation(gfx::NativeView parent, | 55 void InitAsBubbleAtFixedLocation(gfx::NativeView parent, |
| 65 int initial_apps_page, | 56 int initial_apps_page, |
| 66 const gfx::Point& anchor_point_in_screen, | 57 const gfx::Point& anchor_point_in_screen, |
| 67 views::BubbleBorder::Arrow arrow, | 58 views::BubbleBorder::Arrow arrow, |
| 68 bool border_accepts_events); | 59 bool border_accepts_events); |
| 69 | 60 |
| 70 // Initializes the widget as a frameless window, not a bubble. | 61 // Initializes the widget as a frameless window, not a bubble. |
| 71 void InitAsFramelessWindow(gfx::NativeView parent, | 62 void InitAsFramelessWindow(gfx::NativeView parent, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 88 void ShowWhenReady(); | 79 void ShowWhenReady(); |
| 89 | 80 |
| 90 void CloseAppList(); | 81 void CloseAppList(); |
| 91 | 82 |
| 92 void UpdateBounds(); | 83 void UpdateBounds(); |
| 93 | 84 |
| 94 // Enables/disables a semi-transparent overlay over the app list (good for | 85 // Enables/disables a semi-transparent overlay over the app list (good for |
| 95 // hiding the app list when a modal dialog is being shown). | 86 // hiding the app list when a modal dialog is being shown). |
| 96 void SetAppListOverlayVisible(bool visible); | 87 void SetAppListOverlayVisible(bool visible); |
| 97 | 88 |
| 98 // Returns true if the app list should be centered and in landscape mode. | |
| 99 bool ShouldCenterWindow() const; | |
| 100 | |
| 101 views::Widget* search_box_widget() const { return search_box_widget_; } | 89 views::Widget* search_box_widget() const { return search_box_widget_; } |
| 102 | 90 |
| 103 // Overridden from views::View: | 91 // Overridden from views::View: |
| 104 gfx::Size GetPreferredSize() const override; | 92 gfx::Size GetPreferredSize() const override; |
| 105 void OnPaint(gfx::Canvas* canvas) override; | 93 void OnPaint(gfx::Canvas* canvas) override; |
| 106 | 94 |
| 107 // WidgetDelegate overrides: | 95 // WidgetDelegate overrides: |
| 108 bool ShouldHandleSystemCommands() const override; | 96 bool ShouldHandleSystemCommands() const override; |
| 109 bool ShouldDescendIntoChildForEventHandling( | 97 bool ShouldDescendIntoChildForEventHandling( |
| 110 gfx::NativeView child, | 98 gfx::NativeView child, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 167 |
| 180 // For UMA and testing. If non-null, triggered when the app list is painted. | 168 // For UMA and testing. If non-null, triggered when the app list is painted. |
| 181 base::Closure next_paint_callback_; | 169 base::Closure next_paint_callback_; |
| 182 | 170 |
| 183 DISALLOW_COPY_AND_ASSIGN(AppListView); | 171 DISALLOW_COPY_AND_ASSIGN(AppListView); |
| 184 }; | 172 }; |
| 185 | 173 |
| 186 } // namespace app_list | 174 } // namespace app_list |
| 187 | 175 |
| 188 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ | 176 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ |
| OLD | NEW |