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

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

Issue 10938009: Views fuzzing for Aura and Windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Making windows-specific code conditional. Created 8 years, 3 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
« ui/views/view.cc ('K') | « ui/views/window/non_client_view.h ('k') | no next file » | 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) 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/base/accessibility/accessible_view_state.h" 7 #include "ui/base/accessibility/accessible_view_state.h"
8 #include "ui/base/hit_test.h" 8 #include "ui/base/hit_test.h"
9 #include "ui/views/widget/root_view.h" 9 #include "ui/views/widget/root_view.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 void NonClientView::GetAccessibleState(ui::AccessibleViewState* state) { 159 void NonClientView::GetAccessibleState(ui::AccessibleViewState* state) {
160 state->role = ui::AccessibilityTypes::ROLE_WINDOW; 160 state->role = ui::AccessibilityTypes::ROLE_WINDOW;
161 state->name = accessible_name_; 161 state->name = accessible_name_;
162 } 162 }
163 163
164 std::string NonClientView::GetClassName() const { 164 std::string NonClientView::GetClassName() const {
165 return kViewClassName; 165 return kViewClassName;
166 } 166 }
167 167
168 views::View* NonClientView::GetEventHandlerForPoint(const gfx::Point& point) { 168 View* NonClientView::GetEventHandler(const gfx::Rect& rect, EventType type) {
169 // Because of the z-ordering of our child views (the client view is positioned 169 // Because of the z-ordering of our child views (the client view is positioned
170 // over the non-client frame view, if the client view ever overlaps the frame 170 // over the non-client frame view, if the client view ever overlaps the frame
171 // view visually (as it does for the browser window), then it will eat mouse 171 // view visually (as it does for the browser window), then it will eat mouse
172 // events for the window controls. We override this method here so that we can 172 // events for the window controls. We override this method here so that we can
173 // detect this condition and re-route the events to the non-client frame view. 173 // detect this condition and re-route the events to the non-client frame view.
174 // The assumption is that the frame view's implementation of HitTest will only 174 // The assumption is that the frame view's implementation of HitTest will only
175 // return true for area not occupied by the client view. 175 // return true for area not occupied by the client view.
176 if (frame_view_->parent() == this) { 176 if (frame_view_->parent() == this) {
177 // During the reset of the frame_view_ it's possible to be in this code 177 // During the reset of the frame_view_ it's possible to be in this code
178 // after it's been removed from the view hierarchy but before it's been 178 // after it's been removed from the view hierarchy but before it's been
179 // removed from the NonClientView. 179 // removed from the NonClientView.
180 gfx::Point point_in_child_coords(point); 180 gfx::Rect rect_in_child_coords(rect);
181 View::ConvertPointToTarget(this, frame_view_.get(), &point_in_child_coords); 181 View::ConvertRectToTarget(this, frame_view_.get(), &rect_in_child_coords);
182 if (frame_view_->HitTestPoint(point_in_child_coords)) 182 if (frame_view_->HitTestRect(rect_in_child_coords))
183 return frame_view_->GetEventHandlerForPoint(point_in_child_coords); 183 return frame_view_->GetEventHandler(rect_in_child_coords, type);
184 } 184 }
185 185
186 return View::GetEventHandlerForPoint(point); 186 return View::GetEventHandler(rect, type);
187 } 187 }
188 188
189 //////////////////////////////////////////////////////////////////////////////// 189 ////////////////////////////////////////////////////////////////////////////////
190 // NonClientFrameView, public: 190 // NonClientFrameView, public:
191 191
192 void NonClientFrameView::SetInactiveRenderingDisabled(bool disable) { 192 void NonClientFrameView::SetInactiveRenderingDisabled(bool disable) {
193 // See comment in Widget::SetInactiveRenderingDisabled as to why we don't 193 // See comment in Widget::SetInactiveRenderingDisabled as to why we don't
194 // conditionally invoke ShouldPaintAsActiveChanged. 194 // conditionally invoke ShouldPaintAsActiveChanged.
195 paint_as_active_ = disable; 195 paint_as_active_ = disable;
196 ShouldPaintAsActiveChanged(); 196 ShouldPaintAsActiveChanged();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 std::string NonClientFrameView::GetClassName() const { 273 std::string NonClientFrameView::GetClassName() const {
274 return kViewClassName; 274 return kViewClassName;
275 } 275 }
276 276
277 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { 277 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
278 // Overridden to do nothing. The NonClientView manually calls Layout on the 278 // Overridden to do nothing. The NonClientView manually calls Layout on the
279 // FrameView when it is itself laid out, see comment in NonClientView::Layout. 279 // FrameView when it is itself laid out, see comment in NonClientView::Layout.
280 } 280 }
281 281
282 } // namespace views 282 } // namespace views
OLDNEW
« ui/views/view.cc ('K') | « ui/views/window/non_client_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698