Chromium Code Reviews| 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 "base/android/jni_android.h" | |
| 15 #include "ui/aura/client/aura_constants.h" | |
| 14 #include "ui/platform_window/android/platform_window_android.h" | 16 #include "ui/platform_window/android/platform_window_android.h" |
| 15 #endif | 17 #endif |
| 16 | 18 |
| 17 #if defined(USE_OZONE) | 19 #if defined(USE_OZONE) |
| 18 #include "ui/ozone/public/ozone_platform.h" | 20 #include "ui/ozone/public/ozone_platform.h" |
| 19 #endif | 21 #endif |
| 20 | 22 |
| 21 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
| 22 #include "base/message_loop/message_loop.h" | 24 #include "base/message_loop/message_loop.h" |
| 23 #include "ui/base/cursor/cursor_loader_win.h" | 25 #include "ui/base/cursor/cursor_loader_win.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 | 66 |
| 65 ui::EventSource* WindowTreeHostPlatform::GetEventSource() { | 67 ui::EventSource* WindowTreeHostPlatform::GetEventSource() { |
| 66 return this; | 68 return this; |
| 67 } | 69 } |
| 68 | 70 |
| 69 gfx::AcceleratedWidget WindowTreeHostPlatform::GetAcceleratedWidget() { | 71 gfx::AcceleratedWidget WindowTreeHostPlatform::GetAcceleratedWidget() { |
| 70 return widget_; | 72 return widget_; |
| 71 } | 73 } |
| 72 | 74 |
| 73 void WindowTreeHostPlatform::ShowImpl() { | 75 void WindowTreeHostPlatform::ShowImpl() { |
| 76 #if defined(OS_ANDROID) | |
| 77 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 78 jobject activity = window()->GetProperty( | |
| 79 aura::client::kActivityForRootWindow); | |
| 80 // TODO: Call into WTHPlatform.java via JNI? | |
| 81 // Java_PlatformWindowAndroid_createForActivity( | |
|
mfomitchev
2015/11/19 20:57:05
We can't call into Java_PWA from here, so we'll ne
sadrul
2015/11/20 18:32:35
It's not clear what we would gain from calling tha
mfomitchev
2015/11/20 18:35:01
Well, the problem is that PWA has no reference to
sadrul
2015/11/20 20:04:12
I guess it's still not clear to me how this is goi
mfomitchev
2015/11/20 20:11:35
Something like this:
- We will have WTHAndroid.jav
| |
| 82 // env, | |
| 83 // activity, | |
| 84 // reinterpret_cast<jlong>(window_.get()), | |
| 85 // reinterpret_cast<jlong>(window_->GetPlatformImeController())); | |
| 86 #endif | |
| 74 window_->Show(); | 87 window_->Show(); |
| 75 } | 88 } |
| 76 | 89 |
| 77 void WindowTreeHostPlatform::HideImpl() { | 90 void WindowTreeHostPlatform::HideImpl() { |
| 78 window_->Hide(); | 91 window_->Hide(); |
| 79 } | 92 } |
| 80 | 93 |
| 81 gfx::Rect WindowTreeHostPlatform::GetBounds() const { | 94 gfx::Rect WindowTreeHostPlatform::GetBounds() const { |
| 82 return window_->GetBounds(); | 95 return window_->GetBounds(); |
| 83 } | 96 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 DCHECK_EQ(widget, widget_); | 196 DCHECK_EQ(widget, widget_); |
| 184 widget_ = gfx::kNullAcceleratedWidget; | 197 widget_ = gfx::kNullAcceleratedWidget; |
| 185 } | 198 } |
| 186 | 199 |
| 187 void WindowTreeHostPlatform::OnActivationChanged(bool active) { | 200 void WindowTreeHostPlatform::OnActivationChanged(bool active) { |
| 188 if (active) | 201 if (active) |
| 189 OnHostActivated(); | 202 OnHostActivated(); |
| 190 } | 203 } |
| 191 | 204 |
| 192 } // namespace aura | 205 } // namespace aura |
| OLD | NEW |