| 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" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 void UpdateBounds(); | 89 void UpdateBounds(); |
| 90 | 90 |
| 91 // Enables/disables a semi-transparent overlay over the app list (good for | 91 // Enables/disables a semi-transparent overlay over the app list (good for |
| 92 // hiding the app list when a modal dialog is being shown). | 92 // hiding the app list when a modal dialog is being shown). |
| 93 void SetAppListOverlayVisible(bool visible); | 93 void SetAppListOverlayVisible(bool visible); |
| 94 | 94 |
| 95 // Returns true if the app list should be centered and in landscape mode. | 95 // Returns true if the app list should be centered and in landscape mode. |
| 96 bool ShouldCenterWindow() const; | 96 bool ShouldCenterWindow() const; |
| 97 | 97 |
| 98 SearchBoxView* search_box_view() const { return search_box_view_; } | 98 views::Widget* search_box_widget() const { return search_box_widget_; } |
| 99 | 99 |
| 100 // Overridden from views::View: | 100 // Overridden from views::View: |
| 101 gfx::Size GetPreferredSize() const override; | 101 gfx::Size GetPreferredSize() const override; |
| 102 void Paint(gfx::Canvas* canvas, const views::CullSet& cull_set) override; | 102 void Paint(gfx::Canvas* canvas, const views::CullSet& cull_set) override; |
| 103 void OnThemeChanged() override; | 103 void OnThemeChanged() override; |
| 104 | 104 |
| 105 // WidgetDelegate overrides: | 105 // WidgetDelegate overrides: |
| 106 bool ShouldHandleSystemCommands() const override; | 106 bool ShouldHandleSystemCommands() const override; |
| 107 | 107 |
| 108 // Overridden from AppListViewDelegateObserver: | 108 // Overridden from AppListViewDelegateObserver: |
| (...skipping 22 matching lines...) Expand all Loading... |
| 131 // Overridden from views::View: | 131 // Overridden from views::View: |
| 132 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 132 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 133 void Layout() override; | 133 void Layout() override; |
| 134 void SchedulePaintInRect(const gfx::Rect& rect) override; | 134 void SchedulePaintInRect(const gfx::Rect& rect) override; |
| 135 | 135 |
| 136 private: | 136 private: |
| 137 friend class ::test::AppListViewTestApi; | 137 friend class ::test::AppListViewTestApi; |
| 138 | 138 |
| 139 void InitContents(gfx::NativeView parent, int initial_apps_page); | 139 void InitContents(gfx::NativeView parent, int initial_apps_page); |
| 140 | 140 |
| 141 void InitChildWidgets(); |
| 142 |
| 141 void InitAsBubbleInternal(gfx::NativeView parent, | 143 void InitAsBubbleInternal(gfx::NativeView parent, |
| 142 int initial_apps_page, | 144 int initial_apps_page, |
| 143 views::BubbleBorder::Arrow arrow, | 145 views::BubbleBorder::Arrow arrow, |
| 144 bool border_accepts_events, | 146 bool border_accepts_events, |
| 145 const gfx::Vector2d& anchor_offset); | 147 const gfx::Vector2d& anchor_offset); |
| 146 | 148 |
| 147 // Overridden from views::BubbleDelegateView: | 149 // Overridden from views::BubbleDelegateView: |
| 148 void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params, | 150 void OnBeforeBubbleWidgetInit(views::Widget::InitParams* params, |
| 149 views::Widget* widget) const override; | 151 views::Widget* widget) const override; |
| 150 | 152 |
| 151 // Overridden from views::WidgetDelegateView: | 153 // Overridden from views::WidgetDelegateView: |
| 152 views::View* GetInitiallyFocusedView() override; | 154 views::View* GetInitiallyFocusedView() override; |
| 153 gfx::ImageSkia GetWindowIcon() override; | 155 gfx::ImageSkia GetWindowIcon() override; |
| 154 bool WidgetHasHitTestMask() const override; | 156 bool WidgetHasHitTestMask() const override; |
| 155 void GetWidgetHitTestMask(gfx::Path* mask) const override; | 157 void GetWidgetHitTestMask(gfx::Path* mask) const override; |
| 156 | 158 |
| 157 // Overridden from views::WidgetObserver: | 159 // Overridden from views::WidgetObserver: |
| 158 void OnWidgetDestroying(views::Widget* widget) override; | 160 void OnWidgetDestroying(views::Widget* widget) override; |
| 159 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; | 161 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; |
| 160 void OnWidgetActivationChanged(views::Widget* widget, bool active) override; | 162 void OnWidgetActivationChanged(views::Widget* widget, bool active) override; |
| 161 | 163 |
| 162 // Overridden from SpeechUIModelObserver: | 164 // Overridden from SpeechUIModelObserver: |
| 163 void OnSpeechRecognitionStateChanged( | 165 void OnSpeechRecognitionStateChanged( |
| 164 SpeechRecognitionState new_state) override; | 166 SpeechRecognitionState new_state) override; |
| 165 | 167 |
| 166 AppListViewDelegate* delegate_; // Weak. Owned by AppListService. | 168 AppListViewDelegate* delegate_; // Weak. Owned by AppListService. |
| 167 | 169 |
| 168 AppListMainView* app_list_main_view_; | 170 AppListMainView* app_list_main_view_; |
| 169 SearchBoxView* search_box_view_; | |
| 170 SpeechView* speech_view_; | 171 SpeechView* speech_view_; |
| 171 | 172 |
| 173 views::Widget* search_box_widget_; // Owned by the app list's widget. |
| 174 SearchBoxView* search_box_view_; // Owned by |search_box_widget_|. |
| 175 |
| 172 // The red "experimental" banner for the experimental app list. | 176 // The red "experimental" banner for the experimental app list. |
| 173 views::ImageView* experimental_banner_view_; | 177 views::ImageView* experimental_banner_view_; |
| 174 | 178 |
| 175 // A semi-transparent white overlay that covers the app list while dialogs are | 179 // A semi-transparent white overlay that covers the app list while dialogs are |
| 176 // open. | 180 // open. |
| 177 views::View* overlay_view_; | 181 views::View* overlay_view_; |
| 178 | 182 |
| 179 ObserverList<AppListViewObserver> observers_; | 183 ObserverList<AppListViewObserver> observers_; |
| 180 scoped_ptr<HideViewAnimationObserver> animation_observer_; | 184 scoped_ptr<HideViewAnimationObserver> animation_observer_; |
| 181 | 185 |
| 182 // For UMA and testing. If non-null, triggered when the app list is painted. | 186 // For UMA and testing. If non-null, triggered when the app list is painted. |
| 183 base::Closure next_paint_callback_; | 187 base::Closure next_paint_callback_; |
| 184 | 188 |
| 185 DISALLOW_COPY_AND_ASSIGN(AppListView); | 189 DISALLOW_COPY_AND_ASSIGN(AppListView); |
| 186 }; | 190 }; |
| 187 | 191 |
| 188 } // namespace app_list | 192 } // namespace app_list |
| 189 | 193 |
| 190 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ | 194 #endif // UI_APP_LIST_VIEWS_APP_LIST_VIEW_H_ |
| OLD | NEW |