OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/client_view.h" | 5 #include "ui/views/window/client_view.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/base/accessibility/accessible_view_state.h" | 8 #include "ui/base/accessibility/accessible_view_state.h" |
9 #include "ui/base/hit_test.h" | 9 #include "ui/base/hit_test.h" |
10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
11 #include "ui/views/widget/widget_delegate.h" | 11 #include "ui/views/widget/widget_delegate.h" |
12 | 12 |
13 namespace views { | 13 namespace views { |
14 | 14 |
15 // static | 15 // static |
16 const char ClientView::kViewClassName[] = | 16 const char ClientView::kViewClassName[] = |
17 "ui/views/window/ClientView"; | 17 "ui/views/window/ClientView"; |
18 | 18 |
19 /////////////////////////////////////////////////////////////////////////////// | 19 /////////////////////////////////////////////////////////////////////////////// |
20 // ClientView, public: | 20 // ClientView, public: |
21 | 21 |
22 ClientView::ClientView(Widget* widget, View* contents_view) | 22 ClientView::ClientView(Widget* widget, View* contents_view) |
23 : widget_(widget), | 23 : contents_view_(contents_view) { |
24 contents_view_(contents_view) { | |
25 } | 24 } |
26 | 25 |
27 int ClientView::NonClientHitTest(const gfx::Point& point) { | 26 int ClientView::NonClientHitTest(const gfx::Point& point) { |
28 return bounds().Contains(point) ? HTCLIENT : HTNOWHERE; | 27 return bounds().Contains(point) ? HTCLIENT : HTNOWHERE; |
29 } | 28 } |
30 | 29 |
31 DialogClientView* ClientView::AsDialogClientView() { | 30 DialogClientView* ClientView::AsDialogClientView() { |
32 return NULL; | 31 return NULL; |
33 } | 32 } |
34 | 33 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 if (is_add && child == this) { | 78 if (is_add && child == this) { |
80 DCHECK(GetWidget()); | 79 DCHECK(GetWidget()); |
81 DCHECK(contents_view_); // |contents_view_| must be valid now! | 80 DCHECK(contents_view_); // |contents_view_| must be valid now! |
82 // Insert |contents_view_| at index 0 so it is first in the focus chain. | 81 // Insert |contents_view_| at index 0 so it is first in the focus chain. |
83 // (the OK/Cancel buttons are inserted before contents_view_) | 82 // (the OK/Cancel buttons are inserted before contents_view_) |
84 AddChildViewAt(contents_view_, 0); | 83 AddChildViewAt(contents_view_, 0); |
85 } | 84 } |
86 } | 85 } |
87 | 86 |
88 } // namespace views | 87 } // namespace views |
OLD | NEW |