#ifndef CHROME_BROWSER_UI_COCOA_PANELS_PANEL_STACK_WINDOW_COCOA_H_
#define CHROME_BROWSER_UI_COCOA_PANELS_PANEL_STACK_WINDOW_COCOA_H_
#import <Cocoa/Cocoa.h>
#include <list>
#include <map>
#include "base/basictypes.h"
#include "base/mac/scoped_nsobject.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/ui/panels/native_panel_stack_window.h"
#include "ui/gfx/rect.h"
@class BatchBoundsAnimationDelegate;
class Panel;
class PanelStackWindowCocoa;
class PanelStackWindowCocoa : public NativePanelStackWindow {
public:
explicit PanelStackWindowCocoa(NativePanelStackWindowDelegate* delegate);
virtual ~PanelStackWindowCocoa();
void BoundsUpdateAnimationEnded();
protected:
virtual void Close() OVERRIDE;
virtual void AddPanel(Panel* panel) OVERRIDE;
virtual void RemovePanel(Panel* panel) OVERRIDE;
virtual void MergeWith(NativePanelStackWindow* another) OVERRIDE;
virtual bool IsEmpty() const OVERRIDE;
virtual bool HasPanel(Panel* panel) const OVERRIDE;
virtual void MovePanelsBy(const gfx::Vector2d& delta) OVERRIDE;
virtual void BeginBatchUpdatePanelBounds(bool animate) OVERRIDE;
virtual void AddPanelBoundsForBatchUpdate(Panel* panel,
const gfx::Rect& bounds) OVERRIDE;
virtual void EndBatchUpdatePanelBounds() OVERRIDE;
virtual bool IsAnimatingPanelBounds() const OVERRIDE;
virtual void Minimize() OVERRIDE;
virtual bool IsMinimized() const OVERRIDE;
virtual void DrawSystemAttention(bool draw_attention) OVERRIDE;
virtual void OnPanelActivated(Panel* panel) OVERRIDE;
private:
typedef std::list<Panel*> Panels;
typedef std::map<Panel*, gfx::Rect> BoundsUpdates;
void TerminateBoundsAnimation();
gfx::Rect GetStackWindowBounds() const;
void UpdateStackWindowBounds();
void EnsureWindowCreated();
NativePanelStackWindowDelegate* delegate_;
base::scoped_nsobject<NSWindow> window_;
Panels panels_;
NSInteger attention_request_id_;
bool bounds_updates_started_;
bool animate_bounds_updates_;
BoundsUpdates bounds_updates_;
NSViewAnimation* bounds_animation_;
base::scoped_nsobject<BatchBoundsAnimationDelegate>
bounds_animation_delegate_;
DISALLOW_COPY_AND_ASSIGN(PanelStackWindowCocoa);
};
#endif