OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/window_tree_host_platform.h" | 5 #include "ui/aura/window_tree_host_platform.h" |
6 | 6 |
7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
8 #include "ui/aura/window_event_dispatcher.h" | 8 #include "ui/aura/window_event_dispatcher.h" |
9 #include "ui/compositor/compositor.h" | 9 #include "ui/compositor/compositor.h" |
10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
11 #include "ui/gfx/screen.h" | 11 #include "ui/gfx/screen.h" |
12 | 12 |
13 #if defined(OS_ANDROID) | 13 #if defined(OS_ANDROID) |
14 #include "ui/aura/client/aura_constants.h" | |
14 #include "ui/platform_window/android/platform_window_android.h" | 15 #include "ui/platform_window/android/platform_window_android.h" |
15 #endif | 16 #endif |
16 | 17 |
17 #if defined(USE_OZONE) | 18 #if defined(USE_OZONE) |
18 #include "ui/ozone/public/ozone_platform.h" | 19 #include "ui/ozone/public/ozone_platform.h" |
19 #endif | 20 #endif |
20 | 21 |
21 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
22 #include "base/message_loop/message_loop.h" | 23 #include "base/message_loop/message_loop.h" |
23 #include "ui/base/cursor/cursor_loader_win.h" | 24 #include "ui/base/cursor/cursor_loader_win.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 | 65 |
65 ui::EventSource* WindowTreeHostPlatform::GetEventSource() { | 66 ui::EventSource* WindowTreeHostPlatform::GetEventSource() { |
66 return this; | 67 return this; |
67 } | 68 } |
68 | 69 |
69 gfx::AcceleratedWidget WindowTreeHostPlatform::GetAcceleratedWidget() { | 70 gfx::AcceleratedWidget WindowTreeHostPlatform::GetAcceleratedWidget() { |
70 return widget_; | 71 return widget_; |
71 } | 72 } |
72 | 73 |
73 void WindowTreeHostPlatform::ShowImpl() { | 74 void WindowTreeHostPlatform::ShowImpl() { |
75 #if defined(OS_ANDROID) | |
76 JNIEnv* env = base::android::AttachCurrentThread(); | |
77 jobject activity = window()->GetProperty( | |
78 aura::client::kActivityForRootWindow); | |
79 ui::PlatformWindowAndroid::createForActivity( | |
80 env, | |
81 activity, | |
82 reinterpret_cast<jlong>(window_.get()), | |
83 reinterpret_cast<jlong>(window_->GetPlatformImeController())); | |
sadrul
2015/11/25 20:59:44
Curious as to the signature of this function ... w
mfomitchev
2015/11/27 20:57:15
Done.
| |
84 #endif | |
sadrul
2015/11/25 20:59:44
We shouldn't do this for every call to ::ShowImpl(
mfomitchev
2015/11/27 20:57:15
Oops, yes, forgot to fix this, thanks. Done.
I pla
| |
74 window_->Show(); | 85 window_->Show(); |
75 } | 86 } |
76 | 87 |
77 void WindowTreeHostPlatform::HideImpl() { | 88 void WindowTreeHostPlatform::HideImpl() { |
78 window_->Hide(); | 89 window_->Hide(); |
79 } | 90 } |
80 | 91 |
81 gfx::Rect WindowTreeHostPlatform::GetBounds() const { | 92 gfx::Rect WindowTreeHostPlatform::GetBounds() const { |
82 return window_->GetBounds(); | 93 return window_->GetBounds(); |
83 } | 94 } |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
183 DCHECK_EQ(widget, widget_); | 194 DCHECK_EQ(widget, widget_); |
184 widget_ = gfx::kNullAcceleratedWidget; | 195 widget_ = gfx::kNullAcceleratedWidget; |
185 } | 196 } |
186 | 197 |
187 void WindowTreeHostPlatform::OnActivationChanged(bool active) { | 198 void WindowTreeHostPlatform::OnActivationChanged(bool active) { |
188 if (active) | 199 if (active) |
189 OnHostActivated(); | 200 OnHostActivated(); |
190 } | 201 } |
191 | 202 |
192 } // namespace aura | 203 } // namespace aura |
OLD | NEW |