| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/window/non_client_view.h" | 5 #include "ui/views/window/non_client_view.h" |
| 6 | 6 |
| 7 #include "ui/base/accessibility/accessible_view_state.h" | 7 #include "ui/base/accessibility/accessible_view_state.h" |
| 8 #include "ui/base/hit_test.h" | 8 #include "ui/base/hit_test.h" |
| 9 #include "ui/views/widget/root_view.h" | 9 #include "ui/views/widget/root_view.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 NonClientView::~NonClientView() { | 38 NonClientView::~NonClientView() { |
| 39 // This value may have been reset before the window hierarchy shuts down, | 39 // This value may have been reset before the window hierarchy shuts down, |
| 40 // so we need to manually remove it. | 40 // so we need to manually remove it. |
| 41 RemoveChildView(frame_view_.get()); | 41 RemoveChildView(frame_view_.get()); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void NonClientView::SetFrameView(NonClientFrameView* frame_view) { | 44 void NonClientView::SetFrameView(NonClientFrameView* frame_view) { |
| 45 // See comment in header about ownership. | 45 // See comment in header about ownership. |
| 46 frame_view->set_parent_owned(false); | 46 frame_view->set_owned_by_client(); |
| 47 if (frame_view_.get()) | 47 if (frame_view_.get()) |
| 48 RemoveChildView(frame_view_.get()); | 48 RemoveChildView(frame_view_.get()); |
| 49 frame_view_.reset(frame_view); | 49 frame_view_.reset(frame_view); |
| 50 if (parent()) | 50 if (parent()) |
| 51 AddChildViewAt(frame_view_.get(), kFrameViewIndex); | 51 AddChildViewAt(frame_view_.get(), kFrameViewIndex); |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool NonClientView::CanClose() { | 54 bool NonClientView::CanClose() { |
| 55 return client_view_->CanClose(); | 55 return client_view_->CanClose(); |
| 56 } | 56 } |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 std::string NonClientFrameView::GetClassName() const { | 272 std::string NonClientFrameView::GetClassName() const { |
| 273 return kViewClassName; | 273 return kViewClassName; |
| 274 } | 274 } |
| 275 | 275 |
| 276 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 276 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 277 // Overridden to do nothing. The NonClientView manually calls Layout on the | 277 // Overridden to do nothing. The NonClientView manually calls Layout on the |
| 278 // FrameView when it is itself laid out, see comment in NonClientView::Layout. | 278 // FrameView when it is itself laid out, see comment in NonClientView::Layout. |
| 279 } | 279 } |
| 280 | 280 |
| 281 } // namespace views | 281 } // namespace views |
| OLD | NEW |