summaryrefslogtreecommitdiffstats
path: root/chrome/views/client_view.cc
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-04 18:39:13 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-04 18:39:13 +0000
commit0d6ac82ec35133d4be884c54a1e48a371570272f (patch)
tree77c54ba70f3c35a59add3b19556acd12632897b5 /chrome/views/client_view.cc
parent3fa4bad7827a6c725e3e8868d63ddee0d4b67b2d (diff)
downloadchromium_src-0d6ac82ec35133d4be884c54a1e48a371570272f.zip
chromium_src-0d6ac82ec35133d4be884c54a1e48a371570272f.tar.gz
chromium_src-0d6ac82ec35133d4be884c54a1e48a371570272f.tar.bz2
Bring up the new frame (opaque version for XP only, for now).
I've hidden this frame behind a command line switch (--magic_browzR) so as not to destabilize the main browser UI any further. Note that running with this switch is likely buggy, incomplete, crashy, etc. In order to make this work without disrupting a lot of existing code, I've had to make another BrowserView class (temporary) - BrowserView2. This also has to be a BrowserWindow implementor since that's the interface Browser uses to communicate with the UI. BrowserView2 and OpaqueNonClientView are the major new files in this CL, but BrowserView2 is pretty similar to BrowserView. OpaqueNonClientView is the view that renders the titlebar/borders/etc. It's layout/painting routines are a bit simpler than XPFrame's! B=1031854 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@329 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/client_view.cc')
-rw-r--r--chrome/views/client_view.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/views/client_view.cc b/chrome/views/client_view.cc
index 89894e7..73986e5 100644
--- a/chrome/views/client_view.cc
+++ b/chrome/views/client_view.cc
@@ -38,7 +38,6 @@ namespace ChromeViews {
ClientView::ClientView(Window* window, View* contents_view)
: window_(window),
contents_view_(contents_view) {
- DCHECK(window && contents_view);
}
int ClientView::NonClientHitTest(const gfx::Point& point) {
@@ -54,12 +53,16 @@ int ClientView::NonClientHitTest(const gfx::Point& point) {
void ClientView::GetPreferredSize(CSize* out) {
DCHECK(out);
- contents_view_->GetPreferredSize(out);
+ // |contents_view_| is allowed to be NULL up until the point where this view
+ // is attached to a ViewContainer.
+ if (contents_view_)
+ contents_view_->GetPreferredSize(out);
}
void ClientView::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
if (is_add && child == this) {
DCHECK(GetViewContainer());
+ DCHECK(contents_view_); // |contents_view_| must be valid now!
AddChildView(contents_view_);
}
}
@@ -69,7 +72,10 @@ void ClientView::DidChangeBounds(const CRect& previous, const CRect& current) {
}
void ClientView::Layout() {
- contents_view_->SetBounds(0, 0, GetWidth(), GetHeight());
+ // |contents_view_| is allowed to be NULL up until the point where this view
+ // is attached to a ViewContainer.
+ if (contents_view_)
+ contents_view_->SetBounds(0, 0, GetWidth(), GetHeight());
}
}; // namespace ChromeViews \ No newline at end of file