Commit ad3bc4d6 authored by jianli@chromium.org's avatar jianli@chromium.org

Add methods needed for overflow panels to NativePanel interface.

Add methods to NativePanel. Also provide dummy implementation for all platforms.

BUG=none
TEST=no test due to no new functionity

Review URL: http://codereview.chromium.org/8681025

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112532 0039d316-1c4b-4281-b951-d872f2087c98
parent b667fb63
...@@ -70,6 +70,14 @@ class NativePanel { ...@@ -70,6 +70,14 @@ class NativePanel {
const gfx::Size& window_size) const = 0; const gfx::Size& window_size) const = 0;
virtual int TitleOnlyHeight() const = 0; virtual int TitleOnlyHeight() const = 0;
// Returns the size of the iconified panel. This is the size we use to draw
// the panel put in the overflow area.
virtual gfx::Size IconOnlySize() const = 0;
// Brings the panel to the top of the z-order without activating it. This
// will make sure that the panel is not obscured by other top-most windows.
virtual void EnsurePanelFullyVisible() = 0;
}; };
// A NativePanel utility interface used for accessing elements of the // A NativePanel utility interface used for accessing elements of the
......
...@@ -377,6 +377,15 @@ void PanelBrowserView::DestroyPanelBrowser() { ...@@ -377,6 +377,15 @@ void PanelBrowserView::DestroyPanelBrowser() {
DestroyBrowser(); DestroyBrowser();
} }
gfx::Size PanelBrowserView::IconOnlySize() const {
// TODO(jianli): to be implemented.
return gfx::Size();
}
void PanelBrowserView::EnsurePanelFullyVisible() {
// TODO(jianli): to be implemented.
}
PanelBrowserFrameView* PanelBrowserView::GetFrameView() const { PanelBrowserFrameView* PanelBrowserView::GetFrameView() const {
return static_cast<PanelBrowserFrameView*>(frame()->GetFrameView()); return static_cast<PanelBrowserFrameView*>(frame()->GetFrameView());
} }
......
...@@ -107,6 +107,8 @@ class PanelBrowserView : public BrowserView, ...@@ -107,6 +107,8 @@ class PanelBrowserView : public BrowserView,
virtual int TitleOnlyHeight() const OVERRIDE; virtual int TitleOnlyHeight() const OVERRIDE;
virtual Browser* GetPanelBrowser() const OVERRIDE; virtual Browser* GetPanelBrowser() const OVERRIDE;
virtual void DestroyPanelBrowser() OVERRIDE; virtual void DestroyPanelBrowser() OVERRIDE;
virtual gfx::Size IconOnlySize() const OVERRIDE;
virtual void EnsurePanelFullyVisible() OVERRIDE;
// Overridden from AnimationDelegate: // Overridden from AnimationDelegate:
virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
......
...@@ -55,6 +55,8 @@ class PanelBrowserWindowCocoa : public NativePanel, ...@@ -55,6 +55,8 @@ class PanelBrowserWindowCocoa : public NativePanel,
const NativeWebKeyboardEvent& event) OVERRIDE; const NativeWebKeyboardEvent& event) OVERRIDE;
virtual Browser* GetPanelBrowser() const OVERRIDE; virtual Browser* GetPanelBrowser() const OVERRIDE;
virtual void DestroyPanelBrowser() OVERRIDE; virtual void DestroyPanelBrowser() OVERRIDE;
virtual gfx::Size IconOnlySize() const OVERRIDE;
virtual void EnsurePanelFullyVisible() OVERRIDE;
// These sizes are in screen coordinates. // These sizes are in screen coordinates.
virtual gfx::Size WindowSizeFromContentSize( virtual gfx::Size WindowSizeFromContentSize(
......
...@@ -246,6 +246,15 @@ void PanelBrowserWindowCocoa::DestroyPanelBrowser() { ...@@ -246,6 +246,15 @@ void PanelBrowserWindowCocoa::DestroyPanelBrowser() {
[controller_ close]; [controller_ close];
} }
gfx::Size PanelBrowserWindowCocoa::IconOnlySize() const {
// TODO(dimich): to be implemented.
return gfx::Size();
}
void PanelBrowserWindowCocoa::EnsurePanelFullyVisible() {
// TODO(dimich): to be implemented.
}
void PanelBrowserWindowCocoa::DidCloseNativeWindow() { void PanelBrowserWindowCocoa::DidCloseNativeWindow() {
DCHECK(!isClosed()); DCHECK(!isClosed());
panel_->OnNativePanelClosed(); panel_->OnNativePanelClosed();
......
...@@ -371,6 +371,15 @@ void PanelBrowserWindowGtk::DestroyPanelBrowser() { ...@@ -371,6 +371,15 @@ void PanelBrowserWindowGtk::DestroyPanelBrowser() {
DestroyBrowser(); DestroyBrowser();
} }
gfx::Size PanelBrowserWindowGtk::IconOnlySize() const {
// TODO(prasdt): to be implemented.
return gfx::Size();
}
void PanelBrowserWindowGtk::EnsurePanelFullyVisible() {
// TODO(prasdt): to be implemented.
}
gfx::Size PanelBrowserWindowGtk::WindowSizeFromContentSize( gfx::Size PanelBrowserWindowGtk::WindowSizeFromContentSize(
const gfx::Size& content_size) const { const gfx::Size& content_size) const {
gfx::Size frame = GetNonClientFrameSize(); gfx::Size frame = GetNonClientFrameSize();
......
...@@ -98,6 +98,8 @@ class PanelBrowserWindowGtk : public BrowserWindowGtk, ...@@ -98,6 +98,8 @@ class PanelBrowserWindowGtk : public BrowserWindowGtk,
virtual gfx::Size ContentSizeFromWindowSize( virtual gfx::Size ContentSizeFromWindowSize(
const gfx::Size& window_size) const OVERRIDE; const gfx::Size& window_size) const OVERRIDE;
virtual int TitleOnlyHeight() const OVERRIDE; virtual int TitleOnlyHeight() const OVERRIDE;
virtual gfx::Size IconOnlySize() const OVERRIDE;
virtual void EnsurePanelFullyVisible() OVERRIDE;
private: private:
void StartBoundsAnimation(const gfx::Rect& current_bounds); void StartBoundsAnimation(const gfx::Rect& current_bounds);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment