| 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/widget/desktop_aura/desktop_focus_rules.h" | 5 #include "ui/views/widget/desktop_aura/desktop_focus_rules.h" |
| 6 | 6 |
| 7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
| 8 #include "ui/aura/window_event_dispatcher.h" | 8 #include "ui/aura/window_event_dispatcher.h" |
| 9 | 9 |
| 10 namespace views { | 10 namespace views { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 aura::Window* window) const { | 33 aura::Window* window) const { |
| 34 // |content_window_| is initially hidden and made visible from Show(). Even in | 34 // |content_window_| is initially hidden and made visible from Show(). Even in |
| 35 // this state we still want it to be active. | 35 // this state we still want it to be active. |
| 36 return BaseFocusRules::IsWindowConsideredVisibleForActivation(window) || | 36 return BaseFocusRules::IsWindowConsideredVisibleForActivation(window) || |
| 37 (window == content_window_); | 37 (window == content_window_); |
| 38 } | 38 } |
| 39 | 39 |
| 40 aura::Window* DesktopFocusRules::GetToplevelWindow( | 40 aura::Window* DesktopFocusRules::GetToplevelWindow( |
| 41 aura::Window* window) const { | 41 aura::Window* window) const { |
| 42 aura::Window* top_level_window = | 42 aura::Window* top_level_window = |
| 43 corewm::BaseFocusRules::GetToplevelWindow(window); | 43 wm::BaseFocusRules::GetToplevelWindow(window); |
| 44 // In Desktop-Aura, only the content_window or children of the RootWindow are | 44 // In Desktop-Aura, only the content_window or children of the RootWindow are |
| 45 // considered as top level windows. | 45 // considered as top level windows. |
| 46 if (top_level_window == content_window_->parent()) | 46 if (top_level_window == content_window_->parent()) |
| 47 return content_window_; | 47 return content_window_; |
| 48 return top_level_window; | 48 return top_level_window; |
| 49 } | 49 } |
| 50 | 50 |
| 51 aura::Window* DesktopFocusRules::GetNextActivatableWindow( | 51 aura::Window* DesktopFocusRules::GetNextActivatableWindow( |
| 52 aura::Window* window) const { | 52 aura::Window* window) const { |
| 53 aura::Window* next_activatable_window = | 53 aura::Window* next_activatable_window = |
| 54 corewm::BaseFocusRules::GetNextActivatableWindow(window); | 54 wm::BaseFocusRules::GetNextActivatableWindow(window); |
| 55 // In Desktop-Aura the content_window_'s parent is a dummy window and thus | 55 // In Desktop-Aura the content_window_'s parent is a dummy window and thus |
| 56 // should never be activated. We should return the content_window_ if it | 56 // should never be activated. We should return the content_window_ if it |
| 57 // can be activated in this case. | 57 // can be activated in this case. |
| 58 if (next_activatable_window == content_window_->parent() && | 58 if (next_activatable_window == content_window_->parent() && |
| 59 CanActivateWindow(content_window_)) | 59 CanActivateWindow(content_window_)) |
| 60 return content_window_; | 60 return content_window_; |
| 61 return next_activatable_window; | 61 return next_activatable_window; |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace views | 64 } // namespace views |
| OLD | NEW |