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

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

Issue 577018: Support app menu and double-click close on upper left corner of window, part ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 10 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
OLDNEW
1 // Copyright (c) 2006-2008 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 "views/window/non_client_view.h" 5 #include "views/window/non_client_view.h"
6 6
7 #include "app/theme_provider.h" 7 #include "app/theme_provider.h"
8 #include "views/widget/root_view.h" 8 #include "views/widget/root_view.h"
9 #include "views/widget/widget.h" 9 #include "views/widget/widget.h"
10 #include "views/window/window.h" 10 #include "views/window/window.h"
11 11
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 void NonClientView::DisableInactiveRendering(bool disable) { 85 void NonClientView::DisableInactiveRendering(bool disable) {
86 frame_view_->DisableInactiveRendering(disable); 86 frame_view_->DisableInactiveRendering(disable);
87 } 87 }
88 88
89 gfx::Rect NonClientView::GetWindowBoundsForClientBounds( 89 gfx::Rect NonClientView::GetWindowBoundsForClientBounds(
90 const gfx::Rect client_bounds) const { 90 const gfx::Rect client_bounds) const {
91 return frame_view_->GetWindowBoundsForClientBounds(client_bounds); 91 return frame_view_->GetWindowBoundsForClientBounds(client_bounds);
92 } 92 }
93 93
94 gfx::Point NonClientView::GetSystemMenuPoint() const {
95 return frame_view_->GetSystemMenuPoint();
96 }
97
98 int NonClientView::NonClientHitTest(const gfx::Point& point) { 94 int NonClientView::NonClientHitTest(const gfx::Point& point) {
99 // Sanity check. 95 // Sanity check.
100 if (!bounds().Contains(point)) 96 if (!bounds().Contains(point))
101 return HTNOWHERE; 97 return HTNOWHERE;
102 98
103 // The ClientView gets first crack, since it overlays the NonClientFrameView 99 // The ClientView gets first crack, since it overlays the NonClientFrameView
104 // in the display stack. 100 // in the display stack.
105 int frame_component = client_view_->NonClientHitTest(point); 101 int frame_component = client_view_->NonClientHitTest(point);
106 if (frame_component != HTNOWHERE) 102 if (frame_component != HTNOWHERE)
107 return frame_component; 103 return frame_component;
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 // If the window can't be resized, there are no resize boundaries, just 270 // If the window can't be resized, there are no resize boundaries, just
275 // window borders. 271 // window borders.
276 return can_resize ? component : HTBORDER; 272 return can_resize ? component : HTBORDER;
277 } 273 }
278 274
279 bool NonClientFrameView::ShouldPaintAsActive() const { 275 bool NonClientFrameView::ShouldPaintAsActive() const {
280 return GetWindow()->IsActive() || paint_as_active_; 276 return GetWindow()->IsActive() || paint_as_active_;
281 } 277 }
282 278
283 } // namespace views 279 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698