Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_AURA_APP_LIST_WINDOW_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_AURA_APP_LIST_WINDOW_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "ui/aura/desktop_observer.h" | |
| 10 #include "views/widget/widget_delegate.h" | |
| 11 | |
| 12 class DOMView; | |
| 13 | |
| 14 namespace views { | |
| 15 class Widget; | |
| 16 } | |
| 17 | |
| 18 class AppListWindow : public views::WidgetDelegate, | |
| 19 public aura::DesktopObserver { | |
| 20 public: | |
| 21 // Show/hide app list window. | |
| 22 static void Show(bool show); | |
|
sky
2011/10/27 23:52:34
Show(false) is a bit weird. Either name it SetVisi
| |
| 23 | |
| 24 // Whether app list window is shown or being shown. | |
| 25 static bool IsShowing(); | |
| 26 | |
| 27 private: | |
| 28 AppListWindow(); | |
| 29 virtual ~AppListWindow(); | |
| 30 | |
| 31 // Overridden from views::WidgetDelegate: | |
| 32 virtual void DeleteDelegate() OVERRIDE; | |
| 33 virtual views::View* GetContentsView() OVERRIDE; | |
| 34 virtual void WindowClosing() OVERRIDE; | |
| 35 virtual views::Widget* GetWidget() OVERRIDE; | |
| 36 virtual const views::Widget* GetWidget() const OVERRIDE; | |
| 37 | |
| 38 // aura::DesktopObserver overrides: | |
| 39 virtual void OnActiveWindowChanged(aura::Window* active) OVERRIDE; | |
| 40 | |
| 41 // Initializes the window. | |
| 42 void Init(); | |
| 43 | |
| 44 // Shows/hides the window. | |
| 45 void Show(bool show, bool animate); | |
| 46 | |
| 47 bool is_showing() const { | |
| 48 return is_showing_; | |
| 49 } | |
| 50 | |
| 51 // Current visible app list window. | |
| 52 static AppListWindow* instance_; | |
| 53 | |
| 54 views::Widget* widget_; | |
| 55 DOMView* contents_; | |
| 56 bool is_showing_; | |
| 57 | |
| 58 DISALLOW_COPY_AND_ASSIGN(AppListWindow); | |
| 59 }; | |
| 60 | |
| 61 #endif // CHROME_BROWSER_UI_VIEWS_AURA_APP_LIST_WINDOW_H_ | |
| OLD | NEW |