summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/frame/browser_frame_gtk.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 20:19:39 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 20:19:39 +0000
commitb95661e87d9de0419246c31064e402ecade16404 (patch)
tree29fec2d1cdc6e33fe7fb7f6dfbc7f69aaf9d239d /chrome/browser/views/frame/browser_frame_gtk.cc
parente2fcee0718e449a1a74d47376cfd00b69725c56e (diff)
downloadchromium_src-b95661e87d9de0419246c31064e402ecade16404.zip
chromium_src-b95661e87d9de0419246c31064e402ecade16404.tar.gz
chromium_src-b95661e87d9de0419246c31064e402ecade16404.tar.bz2
Makes the nonclientframeview for popups on views/gtk draw
nothing. This is needed as we want the window manager rendering the decorations. BUG=none TEST=none Review URL: http://codereview.chromium.org/436026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32963 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame/browser_frame_gtk.cc')
-rw-r--r--chrome/browser/views/frame/browser_frame_gtk.cc51
1 files changed, 50 insertions, 1 deletions
diff --git a/chrome/browser/views/frame/browser_frame_gtk.cc b/chrome/browser/views/frame/browser_frame_gtk.cc
index bcbb3c6..0068b81 100644
--- a/chrome/browser/views/frame/browser_frame_gtk.cc
+++ b/chrome/browser/views/frame/browser_frame_gtk.cc
@@ -11,6 +11,52 @@
#include "chrome/browser/views/frame/browser_view.h"
#include "chrome/browser/views/frame/opaque_browser_frame_view.h"
#include "views/widget/root_view.h"
+#include "views/window/hit_test.h"
+
+namespace {
+
+// BrowserNonClientFrameView implementation for popups. We let the window
+// manager implementation render the decorations for popups, so this draws
+// nothing.
+class PopupNonClientFrameView : public BrowserNonClientFrameView {
+ public:
+ PopupNonClientFrameView() {
+ }
+
+ // NonClientFrameView:
+ virtual gfx::Rect GetBoundsForClientView() const {
+ return gfx::Rect(0, 0, width(), height());
+ }
+ virtual bool AlwaysUseCustomFrame() const { return false; }
+ virtual bool AlwaysUseNativeFrame() const { return true; }
+ virtual gfx::Rect GetWindowBoundsForClientBounds(
+ const gfx::Rect& client_bounds) const {
+ return client_bounds;
+ }
+ virtual gfx::Point GetSystemMenuPoint() const {
+ // Never used on GTK.
+ // TODO: make this method windows specific.
+ return gfx::Point(0, 0);
+ }
+ virtual int NonClientHitTest(const gfx::Point& point) {
+ return HTNOWHERE;
+ }
+ virtual void GetWindowMask(const gfx::Size& size,
+ gfx::Path* window_mask) {}
+ virtual void EnableClose(bool enable) {}
+ virtual void ResetWindowControls() {}
+
+ // BrowserNonClientFrameView:
+ virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const {
+ return gfx::Rect(0, 0, width(), tabstrip->GetPreferredHeight());
+ }
+ virtual void UpdateThrobber(bool running) {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PopupNonClientFrameView);
+};
+
+}
// static (Factory method.)
BrowserFrame* BrowserFrame::Create(BrowserView* browser_view,
@@ -27,7 +73,10 @@ BrowserFrameGtk::BrowserFrameGtk(BrowserView* browser_view, Profile* profile)
root_view_(NULL),
profile_(profile) {
browser_view_->set_frame(this);
- browser_frame_view_ = new OpaqueBrowserFrameView(this, browser_view_);
+ if (browser_view->browser()->type() == Browser::TYPE_POPUP)
+ browser_frame_view_ = new PopupNonClientFrameView();
+ else
+ browser_frame_view_ = new OpaqueBrowserFrameView(this, browser_view_);
GetNonClientView()->SetFrameView(browser_frame_view_);
// Don't focus anything on creation, selecting a tab will set the focus.
}