Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: views/window/client_view.cc

Issue 7054052: Move more from Window onto Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/window/client_view.h ('k') | views/window/dialog_client_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/logging.h" 5 #include "base/logging.h"
6 #include "ui/base/accessibility/accessible_view_state.h" 6 #include "ui/base/accessibility/accessible_view_state.h"
7 #include "views/window/client_view.h" 7 #include "views/window/client_view.h"
8 #if defined(OS_LINUX) 8 #if defined(OS_LINUX)
9 #include "views/window/hit_test.h" 9 #include "views/window/hit_test.h"
10 #endif 10 #endif
11 #include "views/window/window.h" 11 #include "views/widget/widget.h"
12 #include "views/window/window_delegate.h" 12 #include "views/widget/widget_delegate.h"
13 13
14 namespace views { 14 namespace views {
15 15
16 // static 16 // static
17 const char ClientView::kViewClassName[] = 17 const char ClientView::kViewClassName[] =
18 "views/window/ClientView"; 18 "views/window/ClientView";
19 19
20 /////////////////////////////////////////////////////////////////////////////// 20 ///////////////////////////////////////////////////////////////////////////////
21 // ClientView, public: 21 // ClientView, public:
22 22
23 ClientView::ClientView(Window* window, View* contents_view) 23 ClientView::ClientView(Widget* widget, View* contents_view)
24 : window_(window), 24 : widget_(widget),
25 contents_view_(contents_view) { 25 contents_view_(contents_view) {
26 } 26 }
27 27
28 int ClientView::NonClientHitTest(const gfx::Point& point) { 28 int ClientView::NonClientHitTest(const gfx::Point& point) {
29 return bounds().Contains(point) ? HTCLIENT : HTNOWHERE; 29 return bounds().Contains(point) ? HTCLIENT : HTNOWHERE;
30 } 30 }
31 31
32 DialogClientView* ClientView::AsDialogClientView() { 32 DialogClientView* ClientView::AsDialogClientView() {
33 return NULL; 33 return NULL;
34 } 34 }
35 35
36 bool ClientView::CanClose() { 36 bool ClientView::CanClose() {
37 return true; 37 return true;
38 } 38 }
39 39
40 void ClientView::WindowClosing() { 40 void ClientView::WidgetClosing() {
41 } 41 }
42 42
43 /////////////////////////////////////////////////////////////////////////////// 43 ///////////////////////////////////////////////////////////////////////////////
44 // ClientView, View overrides: 44 // ClientView, View overrides:
45 45
46 gfx::Size ClientView::GetPreferredSize() { 46 gfx::Size ClientView::GetPreferredSize() {
47 // |contents_view_| is allowed to be NULL up until the point where this view 47 // |contents_view_| is allowed to be NULL up until the point where this view
48 // is attached to a Container. 48 // is attached to a Container.
49 if (contents_view_) 49 if (contents_view_)
50 return contents_view_->GetPreferredSize(); 50 return contents_view_->GetPreferredSize();
(...skipping 25 matching lines...) Expand all
76 // Overridden to do nothing. The NonClientView manually calls Layout on the 76 // Overridden to do nothing. The NonClientView manually calls Layout on the
77 // ClientView when it is itself laid out, see comment in 77 // ClientView when it is itself laid out, see comment in
78 // NonClientView::Layout. 78 // NonClientView::Layout.
79 } 79 }
80 80
81 void ClientView::GetAccessibleState(ui::AccessibleViewState* state) { 81 void ClientView::GetAccessibleState(ui::AccessibleViewState* state) {
82 state->role = ui::AccessibilityTypes::ROLE_CLIENT; 82 state->role = ui::AccessibilityTypes::ROLE_CLIENT;
83 } 83 }
84 84
85 } // namespace views 85 } // namespace views
OLDNEW
« no previous file with comments | « views/window/client_view.h ('k') | views/window/dialog_client_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698