diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-31 04:45:06 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-31 04:45:06 +0000 |
commit | eeaef46e6a6ae3f8e70a8afddb7b3cdc63c84863 (patch) | |
tree | dd1274eaf2f5d17db8650235fc737d2d8cab6934 | |
parent | c8e1b96fa715d4c634a4fad71e93f67367a43da5 (diff) | |
download | chromium_src-eeaef46e6a6ae3f8e70a8afddb7b3cdc63c84863.zip chromium_src-eeaef46e6a6ae3f8e70a8afddb7b3cdc63c84863.tar.gz chromium_src-eeaef46e6a6ae3f8e70a8afddb7b3cdc63c84863.tar.bz2 |
Stub out the files to be used for the new browser frame.
B=1031854
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser.vcproj | 48 | ||||
-rw-r--r-- | chrome/browser/views/frame/aero_glass_frame.cc | 39 | ||||
-rw-r--r-- | chrome/browser/views/frame/aero_glass_frame.h | 51 | ||||
-rw-r--r-- | chrome/browser/views/frame/aero_glass_non_client_view.cc | 81 | ||||
-rw-r--r-- | chrome/browser/views/frame/aero_glass_non_client_view.h | 61 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_frame.h | 44 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 58 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 64 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_frame.cc | 39 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_frame.h | 52 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_non_client_view.cc | 80 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_non_client_view.h | 60 |
12 files changed, 677 insertions, 0 deletions
diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj index f6b4b01..5c85727 100644 --- a/chrome/browser/browser.vcproj +++ b/chrome/browser/browser.vcproj @@ -1689,6 +1689,54 @@ > </File> </Filter> + <Filter + Name="Frame" + > + <File + RelativePath=".\views\frame\aero_glass_frame.cc" + > + </File> + <File + RelativePath=".\views\frame\aero_glass_frame.h" + > + </File> + <File + RelativePath=".\views\frame\aero_glass_non_client_view.cc" + > + </File> + <File + RelativePath=".\views\frame\aero_glass_non_client_view.h" + > + </File> + <File + RelativePath=".\views\frame\browser_frame.h" + > + </File> + <File + RelativePath=".\views\frame\browser_view.cc" + > + </File> + <File + RelativePath=".\views\frame\browser_view.h" + > + </File> + <File + RelativePath=".\views\frame\opaque_frame.cc" + > + </File> + <File + RelativePath=".\views\frame\opaque_frame.h" + > + </File> + <File + RelativePath=".\views\frame\opaque_non_client_view.cc" + > + </File> + <File + RelativePath=".\views\frame\opaque_non_client_view.h" + > + </File> + </Filter> </Filter> <Filter Name="Destination" diff --git a/chrome/browser/views/frame/aero_glass_frame.cc b/chrome/browser/views/frame/aero_glass_frame.cc new file mode 100644 index 0000000..32e7044 --- /dev/null +++ b/chrome/browser/views/frame/aero_glass_frame.cc @@ -0,0 +1,39 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "chrome/browser/views/frame/aero_glass_frame.h" + +/////////////////////////////////////////////////////////////////////////////// +// AeroGlassFrame, public: + +AeroGlassFrame::AeroGlassFrame() : Window(NULL) { +} + +AeroGlassFrame::~AeroGlassFrame() { +} diff --git a/chrome/browser/views/frame/aero_glass_frame.h b/chrome/browser/views/frame/aero_glass_frame.h new file mode 100644 index 0000000..3795098 --- /dev/null +++ b/chrome/browser/views/frame/aero_glass_frame.h @@ -0,0 +1,51 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_ +#define CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_ + +#include "chrome/views/window.h" + +/////////////////////////////////////////////////////////////////////////////// +// AeroGlassFrame +// +// AeroGlassFrame is a Window subclass that in conjunction with +// AeroGlassNonClientView provides the window frame on Windows Vista with +// DWM desktop compositing is enabled. A standard Windows frame is used. +// +class AeroGlassFrame : public ChromeViews::Window { + public: + AeroGlassFrame(); + virtual ~AeroGlassFrame(); + + private: + DISALLOW_EVIL_CONSTRUCTORS(AeroGlassFrame); +}; + +#endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_FRAME_H_ diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.cc b/chrome/browser/views/frame/aero_glass_non_client_view.cc new file mode 100644 index 0000000..87cd951 --- /dev/null +++ b/chrome/browser/views/frame/aero_glass_non_client_view.cc @@ -0,0 +1,81 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#include "chrome/browser/views/frame/aero_glass_non_client_view.h" + +/////////////////////////////////////////////////////////////////////////////// +// AeroGlassNonClientView, public: + +AeroGlassNonClientView::AeroGlassNonClientView() { +} + +AeroGlassNonClientView::~AeroGlassNonClientView() { +} + +/////////////////////////////////////////////////////////////////////////////// +// AeroGlassNonClientView, ChromeViews::NonClientView implementation: + +gfx::Rect AeroGlassNonClientView::CalculateClientAreaBounds(int width, + int height) const { + return gfx::Rect(); +} + +gfx::Size AeroGlassNonClientView::CalculateWindowSizeForClientSize( + int width, + int height) const { + return gfx::Size(); +} + +CPoint AeroGlassNonClientView::GetSystemMenuPoint() const { + return CPoint(); +} + +int AeroGlassNonClientView::NonClientHitTest(const gfx::Point& point) { + return HTCLIENT; +} + +void AeroGlassNonClientView::GetWindowMask(const gfx::Size& size, + gfx::Path* window_mask) { +} + +void AeroGlassNonClientView::EnableClose(bool enable) { +} + +/////////////////////////////////////////////////////////////////////////////// +// AeroGlassNonClientView, ChromeViews::View overrides: + +void AeroGlassNonClientView::Layout() { +} + +void AeroGlassNonClientView::ViewHierarchyChanged(bool is_add, + ChromeViews::View* parent, + ChromeViews::View* child) { +} + diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.h b/chrome/browser/views/frame/aero_glass_non_client_view.h new file mode 100644 index 0000000..31968e4 --- /dev/null +++ b/chrome/browser/views/frame/aero_glass_non_client_view.h @@ -0,0 +1,61 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_NON_CLIENT_VIEW_H_ +#define CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_NON_CLIENT_VIEW_H_ + + +#include "chrome/views/non_client_view.h" + +class AeroGlassNonClientView : public ChromeViews::NonClientView { + public: + AeroGlassNonClientView(); + virtual ~AeroGlassNonClientView(); + + protected: + // Overridden from ChromeViews::NonClientView: + virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const; + virtual gfx::Size CalculateWindowSizeForClientSize(int width, + int height) const; + virtual CPoint GetSystemMenuPoint() const; + virtual int NonClientHitTest(const gfx::Point& point); + virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); + virtual void EnableClose(bool enable); + + // Overridden from ChromeViews::View: + virtual void Layout(); + virtual void ViewHierarchyChanged(bool is_add, + ChromeViews::View* parent, + ChromeViews::View* child); + + private: + DISALLOW_EVIL_CONSTRUCTORS(AeroGlassNonClientView); +}; + +#endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_NON_CLIENT_VIEW_H_ diff --git a/chrome/browser/views/frame/browser_frame.h b/chrome/browser/views/frame/browser_frame.h new file mode 100644 index 0000000..e71f9dd --- /dev/null +++ b/chrome/browser/views/frame/browser_frame.h @@ -0,0 +1,44 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CHROME_BROWSER_VIEWS_FRAME_BROWSER_FRAME_H_ +#define CHROME_BROWSER_VIEWS_FRAME_BROWSER_FRAME_H_ + +/////////////////////////////////////////////////////////////////////////////// +// BrowserFrame +// +// BrowserFrame is an interface that represents a top level browser window +// frame. Implementations of this interface exist to supply the browser window +// for specific environments, e.g. Vista with Aero Glass enabled. +// +class BrowserFrame { + public: +}; + +#endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_BROWSER_FRAME_H_ diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc new file mode 100644 index 0000000..e5e81fb --- /dev/null +++ b/chrome/browser/views/frame/browser_view.cc @@ -0,0 +1,58 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "chrome/browser/views/frame/browser_view.h" + +/////////////////////////////////////////////////////////////////////////////// +// BrowserView, public: + +/////////////////////////////////////////////////////////////////////////////// +// BrowserView, ChromeViews::ClientView overrides: + +bool BrowserView::CanClose() const { + return true; +} + +int BrowserView::NonClientHitTest(const gfx::Point& point) { + return HTCLIENT; +} + +/////////////////////////////////////////////////////////////////////////////// +// BrowserView, ChromeViews::View overrides: + +void BrowserView::Layout() { + +} + +void BrowserView::ViewHierarchyChanged(bool is_add, + ChromeViews::View* parent, + ChromeViews::View* child) { + + +} diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h new file mode 100644 index 0000000..e96df7b --- /dev/null +++ b/chrome/browser/views/frame/browser_view.h @@ -0,0 +1,64 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ +#define CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ + +#include "chrome/views/client_view.h" + +// NOTE: For more information about the objects and files in this directory, +// view: https://sites.google.com/a/google.com/the-chrome-project/developers/design-documents/browser-window + +/////////////////////////////////////////////////////////////////////////////// +// BrowserView +// +// A ClientView subclass that provides the contents of a browser window, +// including the TabStrip, toolbars, download shelves, the content area etc. +// +class BrowserView : public ChromeViews::ClientView { + public: + BrowserView(ChromeViews::Window* window, ChromeViews::View* contents_view); + virtual ~BrowserView(); + + // Overridden from ChromeViews::ClientView: + virtual bool CanClose() const; + virtual int NonClientHitTest(const gfx::Point& point); + + protected: + // Overridden from ChromeViews::View: + virtual void Layout(); + virtual void ViewHierarchyChanged(bool is_add, + ChromeViews::View* parent, + ChromeViews::View* child); + + private: + DISALLOW_EVIL_CONSTRUCTORS(BrowserView); +}; + +#endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ diff --git a/chrome/browser/views/frame/opaque_frame.cc b/chrome/browser/views/frame/opaque_frame.cc new file mode 100644 index 0000000..9b65795 --- /dev/null +++ b/chrome/browser/views/frame/opaque_frame.cc @@ -0,0 +1,39 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "chrome/browser/views/frame/opaque_frame.h" + +/////////////////////////////////////////////////////////////////////////////// +// OpaqueFrame, public: + +OpaqueFrame::OpaqueFrame() : CustomFrameWindow(NULL, NULL) { +} + +OpaqueFrame::~OpaqueFrame() { +} diff --git a/chrome/browser/views/frame/opaque_frame.h b/chrome/browser/views/frame/opaque_frame.h new file mode 100644 index 0000000..896729b --- /dev/null +++ b/chrome/browser/views/frame/opaque_frame.h @@ -0,0 +1,52 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CHROME_BROWSER_VIEWS_FRAME_OPAQUE_FRAME_H_ +#define CHROME_BROWSER_VIEWS_FRAME_OPAQUE_FRAME_H_ + +#include "chrome/views/custom_frame_window.h" + +/////////////////////////////////////////////////////////////////////////////// +// OpaqueFrame +// +// OpaqueFrame is a CustomFrameWindow subclass that in conjunction with +// OpaqueNonClientView provides the window frame on Windows XP and on Windows +// Vista when DWM desktop compositing is disabled. The window title and +// borders are provided with bitmaps. +// +class OpaqueFrame : public ChromeViews::CustomFrameWindow { + public: + OpaqueFrame(); + virtual ~OpaqueFrame(); + + private: + DISALLOW_EVIL_CONSTRUCTORS(OpaqueFrame); +}; + +#endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_OPAQUE_FRAME_H_ diff --git a/chrome/browser/views/frame/opaque_non_client_view.cc b/chrome/browser/views/frame/opaque_non_client_view.cc new file mode 100644 index 0000000..7504b3c --- /dev/null +++ b/chrome/browser/views/frame/opaque_non_client_view.cc @@ -0,0 +1,80 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "chrome/browser/views/frame/opaque_non_client_view.h" + +/////////////////////////////////////////////////////////////////////////////// +// OpaqueNonClientView, public: + +OpaqueNonClientView::OpaqueNonClientView() { +} + +OpaqueNonClientView::~OpaqueNonClientView() { +} + +/////////////////////////////////////////////////////////////////////////////// +// OpaqueNonClientView, ChromeViews::NonClientView implementation: + +gfx::Rect OpaqueNonClientView::CalculateClientAreaBounds(int width, + int height) const { + return gfx::Rect(); +} + +gfx::Size OpaqueNonClientView::CalculateWindowSizeForClientSize( + int width, + int height) const { + return gfx::Size(); +} + +CPoint OpaqueNonClientView::GetSystemMenuPoint() const { + return CPoint(); +} + +int OpaqueNonClientView::NonClientHitTest(const gfx::Point& point) { + return HTCLIENT; +} + +void OpaqueNonClientView::GetWindowMask(const gfx::Size& size, + gfx::Path* window_mask) { +} + +void OpaqueNonClientView::EnableClose(bool enable) { +} + +/////////////////////////////////////////////////////////////////////////////// +// OpaqueNonClientView, ChromeViews::View overrides: + +void OpaqueNonClientView::Layout() { +} + +void OpaqueNonClientView::ViewHierarchyChanged(bool is_add, + ChromeViews::View* parent, + ChromeViews::View* child) { +} + diff --git a/chrome/browser/views/frame/opaque_non_client_view.h b/chrome/browser/views/frame/opaque_non_client_view.h new file mode 100644 index 0000000..48c3e78 --- /dev/null +++ b/chrome/browser/views/frame/opaque_non_client_view.h @@ -0,0 +1,60 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CHROME_BROWSER_VIEWS_FRAME_OPAQUE_NON_CLIENT_VIEW_H_ +#define CHROME_BROWSER_VIEWS_FRAME_OPAQUE_NON_CLIENT_VIEW_H_ + +#include "chrome/views/non_client_view.h" + +class OpaqueNonClientView : public ChromeViews::NonClientView { + public: + OpaqueNonClientView(); + virtual ~OpaqueNonClientView(); + + protected: + // Overridden from ChromeViews::NonClientView: + virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const; + virtual gfx::Size CalculateWindowSizeForClientSize(int width, + int height) const; + virtual CPoint GetSystemMenuPoint() const; + virtual int NonClientHitTest(const gfx::Point& point); + virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); + virtual void EnableClose(bool enable); + + // Overridden from ChromeViews::View: + virtual void Layout(); + virtual void ViewHierarchyChanged(bool is_add, + ChromeViews::View* parent, + ChromeViews::View* child); + + private: + DISALLOW_EVIL_CONSTRUCTORS(OpaqueNonClientView); +}; + +#endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_OPAQUE_NON_CLIENT_VIEW_H_ |