| 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/accessibility/ax_view_state.h" | 7 #include "ui/accessibility/ax_view_state.h" |
| 8 #include "ui/base/hit_test.h" | 8 #include "ui/base/hit_test.h" |
| 9 #include "ui/gfx/geometry/rect_conversions.h" | 9 #include "ui/gfx/geometry/rect_conversions.h" |
| 10 #include "ui/views/rect_based_targeting_utils.h" | 10 #include "ui/views/rect_based_targeting_utils.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 return false; | 38 return false; |
| 39 } | 39 } |
| 40 | 40 |
| 41 //////////////////////////////////////////////////////////////////////////////// | 41 //////////////////////////////////////////////////////////////////////////////// |
| 42 // NonClientView, public: | 42 // NonClientView, public: |
| 43 | 43 |
| 44 NonClientView::NonClientView() | 44 NonClientView::NonClientView() |
| 45 : client_view_(nullptr), | 45 : client_view_(nullptr), |
| 46 overlay_view_(nullptr) { | 46 overlay_view_(nullptr) { |
| 47 SetEventTargeter( | 47 SetEventTargeter( |
| 48 scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this))); | 48 std::unique_ptr<views::ViewTargeter>(new views::ViewTargeter(this))); |
| 49 } | 49 } |
| 50 | 50 |
| 51 NonClientView::~NonClientView() { | 51 NonClientView::~NonClientView() { |
| 52 // This value may have been reset before the window hierarchy shuts down, | 52 // This value may have been reset before the window hierarchy shuts down, |
| 53 // so we need to manually remove it. | 53 // so we need to manually remove it. |
| 54 RemoveChildView(frame_view_.get()); | 54 RemoveChildView(frame_view_.get()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void NonClientView::SetFrameView(NonClientFrameView* frame_view) { | 57 void NonClientView::SetFrameView(NonClientFrameView* frame_view) { |
| 58 // See comment in header about ownership. | 58 // See comment in header about ownership. |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 const char* NonClientFrameView::GetClassName() const { | 317 const char* NonClientFrameView::GetClassName() const { |
| 318 return kViewClassName; | 318 return kViewClassName; |
| 319 } | 319 } |
| 320 | 320 |
| 321 //////////////////////////////////////////////////////////////////////////////// | 321 //////////////////////////////////////////////////////////////////////////////// |
| 322 // NonClientFrameView, protected: | 322 // NonClientFrameView, protected: |
| 323 | 323 |
| 324 NonClientFrameView::NonClientFrameView() | 324 NonClientFrameView::NonClientFrameView() |
| 325 : active_state_override_(nullptr) { | 325 : active_state_override_(nullptr) { |
| 326 SetEventTargeter( | 326 SetEventTargeter( |
| 327 scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this))); | 327 std::unique_ptr<views::ViewTargeter>(new views::ViewTargeter(this))); |
| 328 } | 328 } |
| 329 | 329 |
| 330 // ViewTargeterDelegate: | 330 // ViewTargeterDelegate: |
| 331 bool NonClientFrameView::DoesIntersectRect(const View* target, | 331 bool NonClientFrameView::DoesIntersectRect(const View* target, |
| 332 const gfx::Rect& rect) const { | 332 const gfx::Rect& rect) const { |
| 333 CHECK_EQ(target, this); | 333 CHECK_EQ(target, this); |
| 334 | 334 |
| 335 // For the default case, we assume the non-client frame view never overlaps | 335 // For the default case, we assume the non-client frame view never overlaps |
| 336 // the client view. | 336 // the client view. |
| 337 return !GetWidget()->client_view()->bounds().Intersects(rect); | 337 return !GetWidget()->client_view()->bounds().Intersects(rect); |
| 338 } | 338 } |
| 339 | 339 |
| 340 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 340 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 341 // Overridden to do nothing. The NonClientView manually calls Layout on the | 341 // Overridden to do nothing. The NonClientView manually calls Layout on the |
| 342 // FrameView when it is itself laid out, see comment in NonClientView::Layout. | 342 // FrameView when it is itself laid out, see comment in NonClientView::Layout. |
| 343 } | 343 } |
| 344 | 344 |
| 345 } // namespace views | 345 } // namespace views |
| OLD | NEW |