OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "views/window/client_view.h" | 6 #include "views/window/client_view.h" |
7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
8 #include "views/window/hit_test.h" | 8 #include "views/window/hit_test.h" |
9 #endif | 9 #endif |
10 #include "views/window/window.h" | 10 #include "views/window/window.h" |
11 #include "views/window/window_delegate.h" | 11 #include "views/window/window_delegate.h" |
12 | 12 |
13 namespace views { | 13 namespace views { |
14 | 14 |
15 /////////////////////////////////////////////////////////////////////////////// | 15 /////////////////////////////////////////////////////////////////////////////// |
16 // ClientView, public: | 16 // ClientView, public: |
17 | 17 |
18 ClientView::ClientView(Window* window, View* contents_view) | 18 ClientView::ClientView(Window* window, View* contents_view) |
19 : window_(window), | 19 : window_(window), |
20 contents_view_(contents_view) { | 20 contents_view_(contents_view) { |
21 } | 21 } |
22 | 22 |
23 int ClientView::NonClientHitTest(const gfx::Point& point) { | 23 int ClientView::NonClientHitTest(const gfx::Point& point) { |
24 return bounds().Contains(point) ? HTCLIENT : HTNOWHERE; | 24 return bounds().Contains(point) ? HTCLIENT : HTNOWHERE; |
25 } | 25 } |
26 | 26 |
| 27 DialogClientView* ClientView::AsDialogClientView() { |
| 28 return NULL; |
| 29 } |
| 30 |
| 31 bool ClientView::CanClose() { |
| 32 return true; |
| 33 } |
| 34 |
27 void ClientView::WindowClosing() { | 35 void ClientView::WindowClosing() { |
28 window_->GetDelegate()->WindowClosing(); | 36 window_->GetDelegate()->WindowClosing(); |
29 } | 37 } |
30 | 38 |
31 /////////////////////////////////////////////////////////////////////////////// | 39 /////////////////////////////////////////////////////////////////////////////// |
32 // ClientView, View overrides: | 40 // ClientView, View overrides: |
33 | 41 |
34 gfx::Size ClientView::GetPreferredSize() { | 42 gfx::Size ClientView::GetPreferredSize() { |
35 // |contents_view_| is allowed to be NULL up until the point where this view | 43 // |contents_view_| is allowed to be NULL up until the point where this view |
36 // is attached to a Container. | 44 // is attached to a Container. |
(...skipping 23 matching lines...) Expand all Loading... |
60 // Overridden to do nothing. The NonClientView manually calls Layout on the | 68 // Overridden to do nothing. The NonClientView manually calls Layout on the |
61 // ClientView when it is itself laid out, see comment in | 69 // ClientView when it is itself laid out, see comment in |
62 // NonClientView::Layout. | 70 // NonClientView::Layout. |
63 } | 71 } |
64 | 72 |
65 AccessibilityTypes::Role ClientView::GetAccessibleRole() { | 73 AccessibilityTypes::Role ClientView::GetAccessibleRole() { |
66 return AccessibilityTypes::ROLE_CLIENT; | 74 return AccessibilityTypes::ROLE_CLIENT; |
67 } | 75 } |
68 | 76 |
69 } // namespace views | 77 } // namespace views |
OLD | NEW |