| 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 "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" |
| 11 #include "ui/app_list/app_list_export.h" | 11 #include "ui/app_list/app_list_export.h" |
| 12 #include "ui/app_list/app_list_view_delegate_observer.h" | 12 #include "ui/app_list/app_list_view_delegate_observer.h" |
| 13 #include "ui/app_list/speech_ui_model_observer.h" | 13 #include "ui/app_list/speech_ui_model_observer.h" |
| 14 #include "ui/views/bubble/bubble_delegate.h" | 14 #include "ui/views/bubble/bubble_delegate.h" |
| 15 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class FilePath; | 18 class FilePath; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace test { | |
| 22 class AppListViewTestApi; | |
| 23 } | |
| 24 | |
| 25 namespace app_list { | 21 namespace app_list { |
| 26 class ApplicationDragAndDropHost; | 22 class ApplicationDragAndDropHost; |
| 27 class AppListMainView; | 23 class AppListMainView; |
| 28 class AppListModel; | 24 class AppListModel; |
| 29 class AppListViewDelegate; | 25 class AppListViewDelegate; |
| 30 class AppListViewObserver; | 26 class AppListViewObserver; |
| 31 class HideViewAnimationObserver; | 27 class HideViewAnimationObserver; |
| 32 class PaginationModel; | 28 class PaginationModel; |
| 33 class SpeechView; | 29 class SpeechView; |
| 34 | 30 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 ApplicationDragAndDropHost* drag_and_drop_host); | 67 ApplicationDragAndDropHost* drag_and_drop_host); |
| 72 | 68 |
| 73 // Shows the UI when there are no pending icon loads. Otherwise, starts a | 69 // Shows the UI when there are no pending icon loads. Otherwise, starts a |
| 74 // timer to show the UI when a maximum allowed wait time has expired. | 70 // timer to show the UI when a maximum allowed wait time has expired. |
| 75 void ShowWhenReady(); | 71 void ShowWhenReady(); |
| 76 | 72 |
| 77 void Close(); | 73 void Close(); |
| 78 | 74 |
| 79 void UpdateBounds(); | 75 void UpdateBounds(); |
| 80 | 76 |
| 81 // Enables/disables a semi-transparent overlay over the app list (good for | |
| 82 // hiding the app list when a modal dialog is being shown). | |
| 83 void SetAppListOverlayVisible(bool visible); | |
| 84 | |
| 85 // Returns true if the app list should be centered and in landscape mode. | 77 // Returns true if the app list should be centered and in landscape mode. |
| 86 bool ShouldCenterWindow() const; | 78 bool ShouldCenterWindow() const; |
| 87 | 79 |
| 88 // Overridden from views::View: | 80 // Overridden from views::View: |
| 89 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 81 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
| 90 virtual void Paint(gfx::Canvas* canvas, | 82 virtual void Paint(gfx::Canvas* canvas, |
| 91 const views::CullSet& cull_set) OVERRIDE; | 83 const views::CullSet& cull_set) OVERRIDE; |
| 92 virtual void OnThemeChanged() OVERRIDE; | 84 virtual void OnThemeChanged() OVERRIDE; |
| 93 | 85 |
| 94 // WidgetDelegate overrides: | 86 // WidgetDelegate overrides: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 110 #if defined(OS_WIN) | 102 #if defined(OS_WIN) |
| 111 HWND GetHWND() const; | 103 HWND GetHWND() const; |
| 112 #endif | 104 #endif |
| 113 | 105 |
| 114 AppListMainView* app_list_main_view() { return app_list_main_view_; } | 106 AppListMainView* app_list_main_view() { return app_list_main_view_; } |
| 115 | 107 |
| 116 // Gets the PaginationModel owned by this view's apps grid. | 108 // Gets the PaginationModel owned by this view's apps grid. |
| 117 PaginationModel* GetAppsPaginationModel(); | 109 PaginationModel* GetAppsPaginationModel(); |
| 118 | 110 |
| 119 private: | 111 private: |
| 120 friend class ::test::AppListViewTestApi; | |
| 121 | |
| 122 void InitAsBubbleInternal(gfx::NativeView parent, | 112 void InitAsBubbleInternal(gfx::NativeView parent, |
| 123 int initial_apps_page, | 113 int initial_apps_page, |
| 124 views::BubbleBorder::Arrow arrow, | 114 views::BubbleBorder::Arrow arrow, |
| 125 bool border_accepts_events, | 115 bool border_accepts_events, |
| 126 const gfx::Vector2d& anchor_offset); | 116 const gfx::Vector2d& anchor_offset); |
| 127 | 117 |
| 128 // Overridden from views::BubbleDelegateView: | 118 // Overridden from views::BubbleDelegateView: |
| 129 virtual void OnBeforeBubbleWidgetInit( | 119 virtual void OnBeforeBubbleWidgetInit( |
| 130 views::Widget::InitParams* params, | 120 views::Widget::InitParams* params, |
| 131 views::Widget* widget) const OVERRIDE; | 121 views::Widget* widget) const OVERRIDE; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 150 | 140 |
| 151 // Overridden from SpeechUIModelObserver: | 141 // Overridden from SpeechUIModelObserver: |
| 152 virtual void OnSpeechRecognitionStateChanged( | 142 virtual void OnSpeechRecognitionStateChanged( |
| 153 SpeechRecognitionState new_state) OVERRIDE; | 143 SpeechRecognitionState new_state) OVERRIDE; |
| 154 | 144 |
| 155 scoped_ptr<AppListViewDelegate> delegate_; | 145 scoped_ptr<AppListViewDelegate> delegate_; |
| 156 | 146 |
| 157 AppListMainView* app_list_main_view_; | 147 AppListMainView* app_list_main_view_; |
| 158 SpeechView* speech_view_; | 148 SpeechView* speech_view_; |
| 159 | 149 |
| 160 // A semi-transparent white overlay that covers the app list while dialogs are | |
| 161 // open. | |
| 162 views::View* overlay_view_; | |
| 163 | |
| 164 ObserverList<AppListViewObserver> observers_; | 150 ObserverList<AppListViewObserver> observers_; |
| 165 scoped_ptr<HideViewAnimationObserver> animation_observer_; | 151 scoped_ptr<HideViewAnimationObserver> animation_observer_; |
| 166 | 152 |
| 167 // For UMA and testing. If non-null, triggered when the app list is painted. | 153 // For UMA and testing. If non-null, triggered when the app list is painted. |
| 168 base::Closure next_paint_callback_; | 154 base::Closure next_paint_callback_; |
| 169 | 155 |
| 170 DISALLOW_COPY_AND_ASSIGN(AppListView); | 156 DISALLOW_COPY_AND_ASSIGN(AppListView); |
| 171 }; | 157 }; |
| 172 | 158 |
| 173 } // namespace app_list | 159 } // namespace app_list |
| 174 | 160 |
| 175 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ | 161 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ |
| OLD | NEW |