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

Make PanelBrowserView derive from NativePanel. Also add some more methods to NativePanel.

BUG=none
TEST=existing tests due to no new functionaility
Review URL: http://codereview.chromium.org/7104067

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88441 0039d316-1c4b-4281-b951-d872f2087c98
parent 71b5a446
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
#define CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_ #define CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_
#pragma once #pragma once
#include "ui/gfx/native_widget_types.h"
class Panel;
namespace gfx { namespace gfx {
class Rect; class Rect;
} // namespace gfx } // namespace gfx
...@@ -21,19 +25,25 @@ class Rect; ...@@ -21,19 +25,25 @@ class Rect;
// still use the BrowserWindow interface as part of their implementation so we // still use the BrowserWindow interface as part of their implementation so we
// use Panel in all the method names to avoid collisions. // use Panel in all the method names to avoid collisions.
class NativePanel { class NativePanel {
public: friend class Panel;
protected:
virtual ~NativePanel() {}
virtual void ShowPanel() = 0; virtual void ShowPanel() = 0;
virtual void SetPanelBounds(const gfx::Rect& bounds) = 0; virtual void SetPanelBounds(const gfx::Rect& bounds) = 0;
virtual void MinimizePanel() = 0; virtual void MinimizePanel() = 0;
virtual void RestorePanel() = 0; virtual void RestorePanel() = 0;
virtual void ClosePanel() = 0; virtual void ClosePanel() = 0;
virtual void ActivatePanel() = 0; virtual void ActivatePanel() = 0;
virtual void DeactivePanel() = 0; virtual void DeactivatePanel() = 0;
virtual bool IsActivePanel() const = 0; virtual bool IsPanelActive() const = 0;
virtual gfx::NativeWindow GetNativePanelHandle() = 0;
virtual void UpdatePanelTitleBar() = 0;
virtual void ShowTaskManagerForPanel() = 0;
virtual void NotifyPanelOnUserChangedTheme() = 0;
virtual void FlashPanelFrame() = 0; virtual void FlashPanelFrame() = 0;
virtual void DestroyPanelBrowser() = 0;
protected:
virtual ~NativePanel() {}
}; };
#endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_ #endif // CHROME_BROWSER_UI_PANELS_NATIVE_PANEL_H_
...@@ -118,6 +118,62 @@ bool PanelBrowserView::WillProcessWorkAreaChange() const { ...@@ -118,6 +118,62 @@ bool PanelBrowserView::WillProcessWorkAreaChange() const {
return true; return true;
} }
void PanelBrowserView::ShowPanel() {
Show();
}
void PanelBrowserView::SetPanelBounds(const gfx::Rect& bounds) {
SetBounds(bounds);
}
void PanelBrowserView::MinimizePanel() {
NOTIMPLEMENTED();
}
void PanelBrowserView::RestorePanel() {
NOTIMPLEMENTED();
}
void PanelBrowserView::ClosePanel() {
Close();
}
void PanelBrowserView::ActivatePanel() {
Activate();
}
void PanelBrowserView::DeactivatePanel() {
Deactivate();
}
bool PanelBrowserView::IsPanelActive() const {
return IsActive();
}
gfx::NativeWindow PanelBrowserView::GetNativePanelHandle() {
return GetNativeHandle();
}
void PanelBrowserView::UpdatePanelTitleBar() {
UpdateTitleBar();
}
void PanelBrowserView::ShowTaskManagerForPanel() {
ShowTaskManager();
}
void PanelBrowserView::NotifyPanelOnUserChangedTheme() {
UserChangedTheme();
}
void PanelBrowserView::FlashPanelFrame() {
FlashFrame();
}
void PanelBrowserView::DestroyPanelBrowser() {
DestroyBrowser();
}
PanelBrowserFrameView* PanelBrowserView::GetFrameView() const { PanelBrowserFrameView* PanelBrowserView::GetFrameView() const {
return static_cast<PanelBrowserFrameView*>(frame()->GetFrameView()); return static_cast<PanelBrowserFrameView*>(frame()->GetFrameView());
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "chrome/browser/ui/panels/native_panel.h"
#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/browser_view.h"
#include "ui/base/animation/animation_delegate.h" #include "ui/base/animation/animation_delegate.h"
...@@ -19,7 +20,8 @@ class SlideAnimation; ...@@ -19,7 +20,8 @@ class SlideAnimation;
} }
// A browser view that implements Panel specific behavior. // A browser view that implements Panel specific behavior.
class PanelBrowserView : public ::BrowserView, class PanelBrowserView : public BrowserView,
public NativePanel,
public ui::AnimationDelegate { public ui::AnimationDelegate {
public: public:
PanelBrowserView(Browser* browser, Panel* panel); PanelBrowserView(Browser* browser, Panel* panel);
...@@ -56,6 +58,22 @@ class PanelBrowserView : public ::BrowserView, ...@@ -56,6 +58,22 @@ class PanelBrowserView : public ::BrowserView,
virtual void OnWorkAreaChanged() OVERRIDE; virtual void OnWorkAreaChanged() OVERRIDE;
virtual bool WillProcessWorkAreaChange() const OVERRIDE; virtual bool WillProcessWorkAreaChange() const OVERRIDE;
// Overridden from NativePanel:
virtual void ShowPanel() OVERRIDE;
virtual void SetPanelBounds(const gfx::Rect& bounds) OVERRIDE;
virtual void MinimizePanel() OVERRIDE;
virtual void RestorePanel() OVERRIDE;
virtual void ClosePanel() OVERRIDE;
virtual void ActivatePanel() OVERRIDE;
virtual void DeactivatePanel() OVERRIDE;
virtual bool IsPanelActive() const OVERRIDE;
virtual gfx::NativeWindow GetNativePanelHandle() OVERRIDE;
virtual void UpdatePanelTitleBar() OVERRIDE;
virtual void ShowTaskManagerForPanel() OVERRIDE;
virtual void NotifyPanelOnUserChangedTheme() OVERRIDE;
virtual void FlashPanelFrame() OVERRIDE;
virtual void DestroyPanelBrowser() OVERRIDE;
// Overridden from AnimationDelegate: // Overridden from AnimationDelegate:
virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
......
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