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

Side by Side Diff: ash/wm/resize_handle_window_targeter.cc

Issue 2172363002: Created min size for print preview dialog and modified to allow the Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Various fixes Created 4 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ash/wm/resize_handle_window_targeter.h" 5 #include "ash/wm/resize_handle_window_targeter.h"
6 6
7 #include "ash/common/ash_constants.h" 7 #include "ash/common/ash_constants.h"
8 #include "ash/common/wm/window_state.h" 8 #include "ash/common/wm/window_state.h"
9 #include "ash/wm/immersive_fullscreen_controller.h" 9 #include "ash/wm/immersive_fullscreen_controller.h"
10 #include "ash/wm/window_state_aura.h" 10 #include "ash/wm/window_state_aura.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // being generated. 63 // being generated.
64 insets = gfx::Insets(kImmersiveFullscreenTopEdgeInset, 0, 0, 0); 64 insets = gfx::Insets(kImmersiveFullscreenTopEdgeInset, 0, 0, 0);
65 } else { 65 } else {
66 // If the event falls very close to the inside of the frame border, then 66 // If the event falls very close to the inside of the frame border, then
67 // target the window itself, so that the window can be resized easily. 67 // target the window itself, so that the window can be resized easily.
68 insets = frame_border_inset_; 68 insets = frame_border_inset_;
69 } 69 }
70 70
71 if (!insets.IsEmpty()) { 71 if (!insets.IsEmpty()) {
72 gfx::Rect bounds = gfx::Rect(window_->bounds().size()); 72 gfx::Rect bounds = gfx::Rect(window_->bounds().size());
73 bounds.Inset(insets); 73 gfx::Rect insetBounds(bounds);
74 if (!bounds.Contains(event->location())) 74 insetBounds.Inset(insets);
75 if (!insetBounds.Contains(event->location()) &&
76 bounds.Contains(event->location()))
75 return window_; 77 return window_;
76 } 78 }
77 } 79 }
78 return aura::WindowTargeter::FindTargetForLocatedEvent(window, event); 80 return aura::WindowTargeter::FindTargetForLocatedEvent(window, event);
79 } 81 }
80 82
81 bool ResizeHandleWindowTargeter::SubtreeShouldBeExploredForEvent( 83 bool ResizeHandleWindowTargeter::SubtreeShouldBeExploredForEvent(
82 aura::Window* window, 84 aura::Window* window,
83 const ui::LocatedEvent& event) { 85 const ui::LocatedEvent& event) {
84 if (window == window_) { 86 if (window == window_) {
85 // Defer to the parent's targeter on whether |window_| should be able to 87 // Defer to the parent's targeter on whether |window_| should be able to
86 // receive the event. 88 // receive the event.
87 ui::EventTarget* parent = 89 ui::EventTarget* parent =
88 static_cast<ui::EventTarget*>(window)->GetParentTarget(); 90 static_cast<ui::EventTarget*>(window)->GetParentTarget();
89 if (parent) { 91 if (parent) {
90 aura::WindowTargeter* targeter = 92 aura::WindowTargeter* targeter =
91 static_cast<aura::WindowTargeter*>(parent->GetEventTargeter()); 93 static_cast<aura::WindowTargeter*>(parent->GetEventTargeter());
92 if (targeter) 94 if (targeter)
93 return targeter->SubtreeShouldBeExploredForEvent(window, event); 95 return targeter->SubtreeShouldBeExploredForEvent(window, event);
94 } 96 }
95 } 97 }
96 return aura::WindowTargeter::SubtreeShouldBeExploredForEvent(window, event); 98 return aura::WindowTargeter::SubtreeShouldBeExploredForEvent(window, event);
97 } 99 }
98 100
99 } // namespace ash 101 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698