OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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_PANELS_PANEL_STACK_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_STACK_VIEW_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/ui/panels/native_panel_stack.h" |
| 11 #include "ui/views/widget/widget_delegate.h" |
| 12 #include "ui/views/widget/widget_observer.h" |
| 13 |
| 14 class StackedPanelCollection; |
| 15 |
| 16 // A native window that acts as the owner of all panels in the stack, in order |
| 17 // to make all panels appear as a single window on the taskbar or launcher. |
| 18 class PanelStackView : public NativePanelStack, |
| 19 public views::WidgetObserver, |
| 20 public views::WidgetDelegateView { |
| 21 public: |
| 22 explicit PanelStackView( |
| 23 scoped_ptr<StackedPanelCollection> stacked_collection); |
| 24 virtual ~PanelStackView(); |
| 25 |
| 26 protected: |
| 27 // Overridden from NativePanelStack: |
| 28 virtual void Close() OVERRIDE; |
| 29 virtual void OnPanelAddedOrRemoved(Panel* panel) OVERRIDE; |
| 30 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; |
| 31 |
| 32 private: |
| 33 // Overridden from views::WidgetDelegate: |
| 34 virtual string16 GetWindowTitle() const OVERRIDE; |
| 35 virtual gfx::ImageSkia GetWindowAppIcon() OVERRIDE; |
| 36 virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; |
| 37 virtual views::Widget* GetWidget() OVERRIDE; |
| 38 virtual const views::Widget* GetWidget() const OVERRIDE; |
| 39 virtual void DeleteDelegate() OVERRIDE; |
| 40 |
| 41 // Overridden from views::WidgetObserver: |
| 42 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
| 43 |
| 44 void EnsureInitialized(); |
| 45 |
| 46 // Updates the owner of the underlying window such that multiple panels |
| 47 // stacked together could appear as a single window on the taskbar or |
| 48 // launcher. |
| 49 void UpdateWindowOwnerForTaskbarIconAppearance(Panel* panel); |
| 50 |
| 51 scoped_ptr<StackedPanelCollection> stacked_collection_; |
| 52 |
| 53 bool delay_initialized_; |
| 54 |
| 55 views::Widget* window_; |
| 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(PanelStackView); |
| 58 }; |
| 59 |
| 60 #endif // CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_STACK_VIEW_H_ |
OLD | NEW |