OLD | NEW |
---|---|
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/corewm/window_modality_controller.h" | 5 #include "ui/views/corewm/window_modality_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/capture_client.h" | 10 #include "ui/aura/client/capture_client.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 } | 68 } |
69 return NULL; | 69 return NULL; |
70 } | 70 } |
71 | 71 |
72 } // namespace | 72 } // namespace |
73 | 73 |
74 void SetModalParent(aura::Window* child, aura::Window* parent) { | 74 void SetModalParent(aura::Window* child, aura::Window* parent) { |
75 child->SetProperty(kModalParentKey, parent); | 75 child->SetProperty(kModalParentKey, parent); |
76 } | 76 } |
77 | 77 |
78 VIEWS_EXPORT aura::Window* GetModalTransientForActivatableWindow( | |
sadrul
2012/12/04 16:19:40
You shouldn't need VIEWS_EXPORT here.
| |
79 aura::Window* activatable) { | |
80 return GetModalTransientChild(activatable, activatable); | |
sadrul
2012/12/04 16:19:40
CHECK/DCHECK here that |activatable| is Activatabl
Ben Goodger (Google)
2012/12/04 16:37:10
Cannot. Results in recursion in CanActivateWindow(
| |
81 } | |
82 | |
78 aura::Window* GetModalTransient(aura::Window* window) { | 83 aura::Window* GetModalTransient(aura::Window* window) { |
79 if (!window) | 84 if (!window) |
80 return NULL; | 85 return NULL; |
81 | 86 |
82 // We always want to check the for the transient child of the activatable | 87 // We always want to check the for the transient child of the activatable |
83 // window. | 88 // window. |
84 aura::Window* activatable = GetActivatableWindow(window); | 89 aura::Window* activatable = GetActivatableWindow(window); |
85 if (!activatable) | 90 if (!activatable) |
86 return NULL; | 91 return NULL; |
87 | 92 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 aura::Window* modal_transient_child = GetModalTransient(target); | 154 aura::Window* modal_transient_child = GetModalTransient(target); |
150 if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED || | 155 if (modal_transient_child && (event->type() == ui::ET_MOUSE_PRESSED || |
151 event->type() == ui::ET_TOUCH_PRESSED)) { | 156 event->type() == ui::ET_TOUCH_PRESSED)) { |
152 AnimateWindow(modal_transient_child, WINDOW_ANIMATION_TYPE_BOUNCE); | 157 AnimateWindow(modal_transient_child, WINDOW_ANIMATION_TYPE_BOUNCE); |
153 } | 158 } |
154 return !!modal_transient_child; | 159 return !!modal_transient_child; |
155 } | 160 } |
156 | 161 |
157 } // namespace corewm | 162 } // namespace corewm |
158 } // namespace views | 163 } // namespace views |
OLD | NEW |