diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-01 21:00:05 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-01 21:00:05 +0000 |
commit | ad3bc4d69d4e10c73b3232233391d3c4e81aa6c7 (patch) | |
tree | bd91cfce1c4f4a0fab9c94db7bb13eda97904e71 | |
parent | b667fb63cd2553b16b2d0f14703cb24724d37817 (diff) | |
download | chromium_src-ad3bc4d69d4e10c73b3232233391d3c4e81aa6c7.zip chromium_src-ad3bc4d69d4e10c73b3232233391d3c4e81aa6c7.tar.gz chromium_src-ad3bc4d69d4e10c73b3232233391d3c4e81aa6c7.tar.bz2 |
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
7 files changed, 41 insertions, 0 deletions
diff --git a/chrome/browser/ui/panels/native_panel.h b/chrome/browser/ui/panels/native_panel.h index 4d1581d8..3c71207 100644 --- a/chrome/browser/ui/panels/native_panel.h +++ b/chrome/browser/ui/panels/native_panel.h @@ -70,6 +70,14 @@ class NativePanel { const gfx::Size& window_size) 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 diff --git a/chrome/browser/ui/panels/panel_browser_view.cc b/chrome/browser/ui/panels/panel_browser_view.cc index 0a887e2..cea18f8 100644 --- a/chrome/browser/ui/panels/panel_browser_view.cc +++ b/chrome/browser/ui/panels/panel_browser_view.cc @@ -377,6 +377,15 @@ void PanelBrowserView::DestroyPanelBrowser() { 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 { return static_cast<PanelBrowserFrameView*>(frame()->GetFrameView()); } diff --git a/chrome/browser/ui/panels/panel_browser_view.h b/chrome/browser/ui/panels/panel_browser_view.h index aaf7c71..a9b2751 100644 --- a/chrome/browser/ui/panels/panel_browser_view.h +++ b/chrome/browser/ui/panels/panel_browser_view.h @@ -107,6 +107,8 @@ class PanelBrowserView : public BrowserView, virtual int TitleOnlyHeight() const OVERRIDE; virtual Browser* GetPanelBrowser() const OVERRIDE; virtual void DestroyPanelBrowser() OVERRIDE; + virtual gfx::Size IconOnlySize() const OVERRIDE; + virtual void EnsurePanelFullyVisible() OVERRIDE; // Overridden from AnimationDelegate: virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; diff --git a/chrome/browser/ui/panels/panel_browser_window_cocoa.h b/chrome/browser/ui/panels/panel_browser_window_cocoa.h index 93e9b7b..bf39f4b3 100644 --- a/chrome/browser/ui/panels/panel_browser_window_cocoa.h +++ b/chrome/browser/ui/panels/panel_browser_window_cocoa.h @@ -55,6 +55,8 @@ class PanelBrowserWindowCocoa : public NativePanel, const NativeWebKeyboardEvent& event) OVERRIDE; virtual Browser* GetPanelBrowser() const OVERRIDE; virtual void DestroyPanelBrowser() OVERRIDE; + virtual gfx::Size IconOnlySize() const OVERRIDE; + virtual void EnsurePanelFullyVisible() OVERRIDE; // These sizes are in screen coordinates. virtual gfx::Size WindowSizeFromContentSize( diff --git a/chrome/browser/ui/panels/panel_browser_window_cocoa.mm b/chrome/browser/ui/panels/panel_browser_window_cocoa.mm index 64a9224..dd8bff2 100644 --- a/chrome/browser/ui/panels/panel_browser_window_cocoa.mm +++ b/chrome/browser/ui/panels/panel_browser_window_cocoa.mm @@ -246,6 +246,15 @@ void PanelBrowserWindowCocoa::DestroyPanelBrowser() { [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() { DCHECK(!isClosed()); panel_->OnNativePanelClosed(); diff --git a/chrome/browser/ui/panels/panel_browser_window_gtk.cc b/chrome/browser/ui/panels/panel_browser_window_gtk.cc index 68db6fe..0726ba3 100644 --- a/chrome/browser/ui/panels/panel_browser_window_gtk.cc +++ b/chrome/browser/ui/panels/panel_browser_window_gtk.cc @@ -371,6 +371,15 @@ void PanelBrowserWindowGtk::DestroyPanelBrowser() { 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( const gfx::Size& content_size) const { gfx::Size frame = GetNonClientFrameSize(); diff --git a/chrome/browser/ui/panels/panel_browser_window_gtk.h b/chrome/browser/ui/panels/panel_browser_window_gtk.h index f094d68..d34b518 100644 --- a/chrome/browser/ui/panels/panel_browser_window_gtk.h +++ b/chrome/browser/ui/panels/panel_browser_window_gtk.h @@ -98,6 +98,8 @@ class PanelBrowserWindowGtk : public BrowserWindowGtk, virtual gfx::Size ContentSizeFromWindowSize( const gfx::Size& window_size) const OVERRIDE; virtual int TitleOnlyHeight() const OVERRIDE; + virtual gfx::Size IconOnlySize() const OVERRIDE; + virtual void EnsurePanelFullyVisible() OVERRIDE; private: void StartBoundsAnimation(const gfx::Rect& current_bounds); |