| 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_node_data.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" |
| 11 #include "ui/views/view_targeter.h" | 11 #include "ui/views/view_targeter.h" |
| 12 #include "ui/views/widget/root_view.h" | 12 #include "ui/views/widget/root_view.h" |
| 13 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
| 14 #include "ui/views/window/client_view.h" | 14 #include "ui/views/window/client_view.h" |
| 15 | 15 |
| 16 namespace views { | 16 namespace views { |
| 17 | 17 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // are subsequently resized all the parent-child relationships are | 193 // are subsequently resized all the parent-child relationships are |
| 194 // established. | 194 // established. |
| 195 if (details.is_add && GetWidget() && details.child == this) { | 195 if (details.is_add && GetWidget() && details.child == this) { |
| 196 AddChildViewAt(frame_view_.get(), kFrameViewIndex); | 196 AddChildViewAt(frame_view_.get(), kFrameViewIndex); |
| 197 AddChildViewAt(client_view_, kClientViewIndex); | 197 AddChildViewAt(client_view_, kClientViewIndex); |
| 198 if (overlay_view_) | 198 if (overlay_view_) |
| 199 AddChildView(overlay_view_); | 199 AddChildView(overlay_view_); |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 | 202 |
| 203 void NonClientView::GetAccessibleState(ui::AXViewState* state) { | 203 void NonClientView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 204 state->role = ui::AX_ROLE_CLIENT; | 204 node_data->role = ui::AX_ROLE_CLIENT; |
| 205 state->name = accessible_name_; | 205 node_data->SetName(accessible_name_); |
| 206 } | 206 } |
| 207 | 207 |
| 208 const char* NonClientView::GetClassName() const { | 208 const char* NonClientView::GetClassName() const { |
| 209 return kViewClassName; | 209 return kViewClassName; |
| 210 } | 210 } |
| 211 | 211 |
| 212 View* NonClientView::GetTooltipHandlerForPoint(const gfx::Point& point) { | 212 View* NonClientView::GetTooltipHandlerForPoint(const gfx::Point& point) { |
| 213 // The same logic as for |TargetForRect()| applies here. | 213 // The same logic as for |TargetForRect()| applies here. |
| 214 if (frame_view_->parent() == this) { | 214 if (frame_view_->parent() == this) { |
| 215 // During the reset of the frame_view_ it's possible to be in this code | 215 // During the reset of the frame_view_ it's possible to be in this code |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } | 311 } |
| 312 | 312 |
| 313 // If the window can't be resized, there are no resize boundaries, just | 313 // If the window can't be resized, there are no resize boundaries, just |
| 314 // window borders. | 314 // window borders. |
| 315 return can_resize ? component : HTBORDER; | 315 return can_resize ? component : HTBORDER; |
| 316 } | 316 } |
| 317 | 317 |
| 318 void NonClientFrameView::ActivationChanged(bool active) { | 318 void NonClientFrameView::ActivationChanged(bool active) { |
| 319 } | 319 } |
| 320 | 320 |
| 321 void NonClientFrameView::GetAccessibleState(ui::AXViewState* state) { | 321 void NonClientFrameView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 322 state->role = ui::AX_ROLE_CLIENT; | 322 node_data->role = ui::AX_ROLE_CLIENT; |
| 323 } | 323 } |
| 324 | 324 |
| 325 const char* NonClientFrameView::GetClassName() const { | 325 const char* NonClientFrameView::GetClassName() const { |
| 326 return kViewClassName; | 326 return kViewClassName; |
| 327 } | 327 } |
| 328 | 328 |
| 329 //////////////////////////////////////////////////////////////////////////////// | 329 //////////////////////////////////////////////////////////////////////////////// |
| 330 // NonClientFrameView, protected: | 330 // NonClientFrameView, protected: |
| 331 | 331 |
| 332 NonClientFrameView::NonClientFrameView() | 332 NonClientFrameView::NonClientFrameView() |
| (...skipping 11 matching lines...) Expand all Loading... |
| 344 // the client view. | 344 // the client view. |
| 345 return !GetWidget()->client_view()->bounds().Intersects(rect); | 345 return !GetWidget()->client_view()->bounds().Intersects(rect); |
| 346 } | 346 } |
| 347 | 347 |
| 348 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 348 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 349 // Overridden to do nothing. The NonClientView manually calls Layout on the | 349 // Overridden to do nothing. The NonClientView manually calls Layout on the |
| 350 // FrameView when it is itself laid out, see comment in NonClientView::Layout. | 350 // FrameView when it is itself laid out, see comment in NonClientView::Layout. |
| 351 } | 351 } |
| 352 | 352 |
| 353 } // namespace views | 353 } // namespace views |
| OLD | NEW |