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

Side by Side 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: Create RootWindowFirst 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 unified diff | Download patch
OLDNEW
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 "content/shell/shell_stacking_client_ash.h" 5 #include "content/shell/shell_stacking_client_ash.h"
6 6
7 #include "ui/aura/client/default_capture_client.h" 7 #include "ui/aura/client/default_capture_client.h"
8 #include "ui/aura/focus_manager.h" 8 #include "ui/aura/focus_manager.h"
9 #include "ui/aura/root_window.h" 9 #include "ui/aura/root_window.h"
10 #include "ui/aura/test/test_activation_client.h" 10 #include "ui/aura/test/test_activation_client.h"
11 #include "ui/views/corewm/compound_event_filter.h" 11 #include "ui/views/corewm/compound_event_filter.h"
12 #include "ui/views/corewm/input_method_event_filter.h" 12 #include "ui/views/corewm/input_method_event_filter.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 ShellStackingClientAsh::ShellStackingClientAsh() { 16 ShellStackingClientAsh::ShellStackingClientAsh(aura::RootWindow* root_window)
17 : root_window_(root_window){
17 } 18 }
18 19
19 ShellStackingClientAsh::~ShellStackingClientAsh() { 20 ShellStackingClientAsh::~ShellStackingClientAsh() {
20 if (root_window_.get()) 21 if (root_window_.get())
21 root_window_event_filter_->RemoveHandler(input_method_filter_.get()); 22 root_window_event_filter_->RemoveHandler(input_method_filter_.get());
22 23
23 aura::client::SetStackingClient(NULL); 24 aura::client::SetStackingClient(NULL);
24 } 25 }
25 26
26 aura::Window* ShellStackingClientAsh::GetDefaultParent( 27 aura::Window* ShellStackingClientAsh::GetDefaultParent(
27 aura::Window* context, 28 aura::Window* context,
28 aura::Window* window, 29 aura::Window* window,
29 const gfx::Rect& bounds) { 30 const gfx::Rect& bounds) {
30 if (!root_window_.get()) { 31 if (!focus_client_.get()) {
sky 2013/01/15 21:53:49 Can we instead have an Init() method that does thi
Nayan 2013/01/15 23:39:03 Done.
31 root_window_.reset(new aura::RootWindow(
32 aura::RootWindow::CreateParams(gfx::Rect(100, 100))));
33 root_window_->Init();
34 focus_client_.reset(new aura::FocusManager); 32 focus_client_.reset(new aura::FocusManager);
35 aura::client::SetFocusClient(root_window_.get(), focus_client_.get()); 33 aura::client::SetFocusClient(root_window_.get(), focus_client_.get());
34 }
36 35
36 if (!input_method_filter_.get()) {
37 root_window_event_filter_ = new views::corewm::CompoundEventFilter; 37 root_window_event_filter_ = new views::corewm::CompoundEventFilter;
38 // Pass ownership of the filter to the root_window. 38 // Pass ownership of the filter to the root_window.
39 root_window_->SetEventFilter(root_window_event_filter_); 39 root_window_->SetEventFilter(root_window_event_filter_);
40 40
41 input_method_filter_.reset(new views::corewm::InputMethodEventFilter( 41 input_method_filter_.reset(new views::corewm::InputMethodEventFilter(
42 root_window_->GetAcceleratedWidget())); 42 root_window_->GetAcceleratedWidget()));
43 input_method_filter_->SetInputMethodPropertyInRootWindow( 43 input_method_filter_->SetInputMethodPropertyInRootWindow(
44 root_window_.get()); 44 root_window_.get());
45 root_window_event_filter_->AddHandler(input_method_filter_.get()); 45 root_window_event_filter_->AddHandler(input_method_filter_.get());
46 }
46 47
48 if (!test_activation_client_.get()) {
47 test_activation_client_.reset( 49 test_activation_client_.reset(
48 new aura::test::TestActivationClient(root_window_.get())); 50 new aura::test::TestActivationClient(root_window_.get()));
51 }
49 52
53 if (!capture_client_.get()) {
50 capture_client_.reset( 54 capture_client_.reset(
51 new aura::client::DefaultCaptureClient(root_window_.get())); 55 new aura::client::DefaultCaptureClient(root_window_.get()));
52 } 56 }
57
53 return root_window_.get(); 58 return root_window_.get();
54 } 59 }
55 60
56 } // namespace content 61 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698