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

Unified Diff: content/shell/shell_stacking_client_ash.cc

Issue 11614037: Call ShowRootWindow on NativeWindow's RootWindow to display the window. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Reworked patch Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/shell_stacking_client_ash.cc
diff --git a/content/shell/shell_stacking_client_ash.cc b/content/shell/shell_stacking_client_ash.cc
index f9e7c0a644f2fa8a7ce9fd96f1db654d9e700e27..c558572439c593fe576c3b016ae6caba3b55b5c7 100644
--- a/content/shell/shell_stacking_client_ash.cc
+++ b/content/shell/shell_stacking_client_ash.cc
@@ -13,7 +13,10 @@
namespace content {
-ShellStackingClientAsh::ShellStackingClientAsh() {
+ShellStackingClientAsh::ShellStackingClientAsh(
+ scoped_ptr<aura::RootWindow> root_window)
+ : root_window_(root_window.Pass()){
+ Init();
}
ShellStackingClientAsh::~ShellStackingClientAsh() {
@@ -23,33 +26,30 @@ ShellStackingClientAsh::~ShellStackingClientAsh() {
aura::client::SetStackingClient(NULL);
}
+void ShellStackingClientAsh::Init() {
+ focus_client_.reset(new aura::FocusManager);
+ aura::client::SetFocusClient(root_window_.get(), focus_client_.get());
+
+ root_window_event_filter_ = new views::corewm::CompoundEventFilter;
+ // Pass ownership of the filter to the root_window.
+ root_window_->SetEventFilter(root_window_event_filter_);
+
+ input_method_filter_.reset(new views::corewm::InputMethodEventFilter(
+ root_window_->GetAcceleratedWidget()));
+ input_method_filter_->SetInputMethodPropertyInRootWindow(
+ root_window_.get());
+ root_window_event_filter_->AddHandler(input_method_filter_.get());
+
+ test_activation_client_.reset(
+ new aura::test::TestActivationClient(root_window_.get()));
+ capture_client_.reset(
+ new aura::client::DefaultCaptureClient(root_window_.get()));
+}
+
aura::Window* ShellStackingClientAsh::GetDefaultParent(
aura::Window* context,
aura::Window* window,
const gfx::Rect& bounds) {
- if (!root_window_.get()) {
- root_window_.reset(new aura::RootWindow(
- aura::RootWindow::CreateParams(gfx::Rect(100, 100))));
- root_window_->Init();
- focus_client_.reset(new aura::FocusManager);
- aura::client::SetFocusClient(root_window_.get(), focus_client_.get());
-
- root_window_event_filter_ = new views::corewm::CompoundEventFilter;
- // Pass ownership of the filter to the root_window.
- root_window_->SetEventFilter(root_window_event_filter_);
-
- input_method_filter_.reset(new views::corewm::InputMethodEventFilter(
- root_window_->GetAcceleratedWidget()));
- input_method_filter_->SetInputMethodPropertyInRootWindow(
- root_window_.get());
- root_window_event_filter_->AddHandler(input_method_filter_.get());
-
- test_activation_client_.reset(
- new aura::test::TestActivationClient(root_window_.get()));
-
- capture_client_.reset(
- new aura::client::DefaultCaptureClient(root_window_.get()));
- }
return root_window_.get();
}

Powered by Google App Engine
This is Rietveld 408576698