diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 16:41:10 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 16:41:10 +0000 |
commit | c50a660db8dc3a4faa627e2dc78f6fbeea6e57cf (patch) | |
tree | 37f4c65706a593122c63d0fa26978ec5a6dc2061 /chrome/browser/views | |
parent | 2dbe3b46526ed24c0dac17644cd3ae28bf4ef705 (diff) | |
download | chromium_src-c50a660db8dc3a4faa627e2dc78f6fbeea6e57cf.zip chromium_src-c50a660db8dc3a4faa627e2dc78f6fbeea6e57cf.tar.gz chromium_src-c50a660db8dc3a4faa627e2dc78f6fbeea6e57cf.tar.bz2 |
BUG=chromium-os:4448 - Hide the address bar for popups in ChromeOS (http://code.google.com/p/chromium-os/issues/detail?id=4448)
Moved PopupNonClientFrameView to its own file and moved FrameView initialization logic to BrowserFrameChromeos::Init.
TEST=See issue. Additionally, ensure that non-chromeos Chrome popup window behavior is unaffected, and that the address bar is still visible for popup windows not generated by apps (e.g popped out google chat windows), on chromeos and non-chromeos.
Review URL: http://codereview.chromium.org/3133001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56370 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/frame/browser_frame_gtk.cc | 41 | ||||
-rw-r--r-- | chrome/browser/views/frame/popup_non_client_frame_view.cc | 54 | ||||
-rw-r--r-- | chrome/browser/views/frame/popup_non_client_frame_view.h | 39 |
3 files changed, 94 insertions, 40 deletions
diff --git a/chrome/browser/views/frame/browser_frame_gtk.cc b/chrome/browser/views/frame/browser_frame_gtk.cc index b7d9689..5b66885 100644 --- a/chrome/browser/views/frame/browser_frame_gtk.cc +++ b/chrome/browser/views/frame/browser_frame_gtk.cc @@ -12,50 +12,11 @@ #include "chrome/browser/views/frame/browser_root_view.h" #include "chrome/browser/views/frame/browser_view.h" #include "chrome/browser/views/frame/opaque_browser_frame_view.h" +#include "chrome/browser/views/frame/popup_non_client_frame_view.h" #include "gfx/font.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 int NonClientHitTest(const gfx::Point& point) { - return bounds().Contains(point) ? HTCLIENT : 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(BaseTabStrip* tabstrip) const { - return gfx::Rect(0, 0, width(), tabstrip->GetPreferredHeight()); - } - virtual void UpdateThrobber(bool running) {} - - private: - DISALLOW_COPY_AND_ASSIGN(PopupNonClientFrameView); -}; - -} - #if !defined(OS_CHROMEOS) // static (Factory method.) BrowserFrame* BrowserFrame::Create(BrowserView* browser_view, diff --git a/chrome/browser/views/frame/popup_non_client_frame_view.cc b/chrome/browser/views/frame/popup_non_client_frame_view.cc new file mode 100644 index 0000000..5d16079 --- /dev/null +++ b/chrome/browser/views/frame/popup_non_client_frame_view.cc @@ -0,0 +1,54 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/views/frame/popup_non_client_frame_view.h" + +#include "base/logging.h" +#include "chrome/browser/views/tabs/base_tab_strip.h" +#include "gfx/point.h" +#include "gfx/rect.h" +#include "gfx/size.h" + +#if defined(OS_LINUX) +#include "views/window/hit_test.h" +#endif + +gfx::Rect PopupNonClientFrameView::GetBoundsForClientView() const { + return gfx::Rect(0, 0, width(), height()); +} + +bool PopupNonClientFrameView::AlwaysUseCustomFrame() const { + return false; +} + +bool PopupNonClientFrameView::AlwaysUseNativeFrame() const { + return true; +} + +gfx::Rect PopupNonClientFrameView::GetWindowBoundsForClientBounds( + const gfx::Rect& client_bounds) const { + return client_bounds; +} + +int PopupNonClientFrameView::NonClientHitTest(const gfx::Point& point) { + return bounds().Contains(point) ? HTCLIENT : HTNOWHERE; +} + +void PopupNonClientFrameView::GetWindowMask(const gfx::Size& size, + gfx::Path* window_mask) { +} + +void PopupNonClientFrameView::EnableClose(bool enable) { +} + +void PopupNonClientFrameView::ResetWindowControls() { +} + +gfx::Rect PopupNonClientFrameView::GetBoundsForTabStrip( + BaseTabStrip* tabstrip) const { + return gfx::Rect(0, 0, width(), tabstrip->GetPreferredHeight()); +} + +void PopupNonClientFrameView::UpdateThrobber(bool running) { +} diff --git a/chrome/browser/views/frame/popup_non_client_frame_view.h b/chrome/browser/views/frame/popup_non_client_frame_view.h new file mode 100644 index 0000000..e403bf3 --- /dev/null +++ b/chrome/browser/views/frame/popup_non_client_frame_view.h @@ -0,0 +1,39 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_VIEWS_FRAME_POPUP_NON_CLIENT_FRAME_VIEW_H_ +#define CHROME_BROWSER_VIEWS_FRAME_POPUP_NON_CLIENT_FRAME_VIEW_H_ +#pragma once + +#include "chrome/browser/views/frame/browser_non_client_frame_view.h" + +class BaseTabStrip; + +// 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; + virtual bool AlwaysUseCustomFrame() const; + virtual bool AlwaysUseNativeFrame() const; + virtual gfx::Rect GetWindowBoundsForClientBounds( + const gfx::Rect& client_bounds) const; + virtual int NonClientHitTest(const gfx::Point& point); + virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); + virtual void EnableClose(bool enable); + virtual void ResetWindowControls(); + + // BrowserNonClientFrameView: + virtual gfx::Rect GetBoundsForTabStrip(BaseTabStrip* tabstrip) const; + virtual void UpdateThrobber(bool running); + + private: + DISALLOW_COPY_AND_ASSIGN(PopupNonClientFrameView); +}; + +#endif // CHROME_BROWSER_VIEWS_FRAME_POPUP_NON_CLIENT_FRAME_VIEW_H_ |