| 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/aura/desktop/desktop_stacking_client.h" | 5 #include "ui/aura/desktop/desktop_stacking_client.h" |
| 6 | 6 |
| 7 #include "ui/aura/client/activation_client.h" | 7 #include "ui/aura/client/activation_client.h" |
| 8 #include "ui/aura/client/default_capture_client.h" | 8 #include "ui/aura/client/default_capture_client.h" |
| 9 #include "ui/aura/desktop/desktop_activation_client.h" | 9 #include "ui/aura/desktop/desktop_activation_client.h" |
| 10 #include "ui/aura/focus_manager.h" | 10 #include "ui/aura/focus_manager.h" |
| 11 #include "ui/aura/root_window.h" | 11 #include "ui/aura/root_window.h" |
| 12 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 13 #include "ui/views/corewm/compound_event_filter.h" | 13 #include "ui/views/corewm/compound_event_filter.h" |
| 14 #include "ui/views/corewm/input_method_event_filter.h" | 14 #include "ui/views/corewm/input_method_event_filter.h" |
| 15 | 15 |
| 16 namespace aura { | 16 namespace aura { |
| 17 | 17 |
| 18 DesktopStackingClient::DesktopStackingClient() | 18 DesktopStackingClient::DesktopStackingClient() |
| 19 : window_event_filter_(NULL) { | 19 : window_event_filter_(NULL) { |
| 20 client::SetStackingClient(this); | |
| 21 } | 20 } |
| 22 | 21 |
| 23 DesktopStackingClient::~DesktopStackingClient() { | 22 DesktopStackingClient::~DesktopStackingClient() { |
| 24 if (window_event_filter_) | 23 if (window_event_filter_) |
| 25 window_event_filter_->RemoveFilter(input_method_filter_.get()); | 24 window_event_filter_->RemoveFilter(input_method_filter_.get()); |
| 26 | 25 |
| 27 client::SetStackingClient(NULL); | 26 client::SetStackingClient(NULL); |
| 28 } | 27 } |
| 29 | 28 |
| 30 Window* DesktopStackingClient::GetDefaultParent(Window* window, | 29 Window* DesktopStackingClient::GetDefaultParent(Window* context, |
| 30 Window* window, |
| 31 const gfx::Rect& bounds) { | 31 const gfx::Rect& bounds) { |
| 32 if (!null_parent_.get()) | 32 if (!null_parent_.get()) |
| 33 CreateNULLParent(); | 33 CreateNULLParent(); |
| 34 | 34 |
| 35 return null_parent_.get(); | 35 return null_parent_.get(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void DesktopStackingClient::CreateNULLParent() { | 38 void DesktopStackingClient::CreateNULLParent() { |
| 39 focus_manager_.reset(new FocusManager); | 39 focus_manager_.reset(new FocusManager); |
| 40 | 40 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 51 null_parent_->SetEventFilter(window_event_filter_); | 51 null_parent_->SetEventFilter(window_event_filter_); |
| 52 | 52 |
| 53 input_method_filter_.reset(new views::corewm::InputMethodEventFilter); | 53 input_method_filter_.reset(new views::corewm::InputMethodEventFilter); |
| 54 input_method_filter_->SetInputMethodPropertyInRootWindow(null_parent_.get()); | 54 input_method_filter_->SetInputMethodPropertyInRootWindow(null_parent_.get()); |
| 55 window_event_filter_->AddFilter(input_method_filter_.get()); | 55 window_event_filter_->AddFilter(input_method_filter_.get()); |
| 56 | 56 |
| 57 capture_client_.reset(new client::DefaultCaptureClient(null_parent_.get())); | 57 capture_client_.reset(new client::DefaultCaptureClient(null_parent_.get())); |
| 58 } | 58 } |
| 59 | 59 |
| 60 } // namespace aura | 60 } // namespace aura |
| OLD | NEW |