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

Side by Side Diff: ui/aura/window_tree_host_platform.cc

Issue 1408373005: Add WindowTreeHostPlatform::GetHost for Android build (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « ui/aura/window_tree_host_platform.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/platform_window/android/platform_window_android.h" 14 #include "ui/platform_window/android/platform_window_android.h"
15 #endif 15 #endif
16 16
17 #if defined(USE_OZONE) 17 #if defined(USE_OZONE)
18 #include "ui/ozone/public/ozone_platform.h" 18 #include "ui/ozone/public/ozone_platform.h"
19 #endif 19 #endif
20 20
21 #if defined(OS_WIN) 21 #if defined(OS_WIN)
22 #include "base/message_loop/message_loop.h" 22 #include "base/message_loop/message_loop.h"
23 #include "ui/base/cursor/cursor_loader_win.h" 23 #include "ui/base/cursor/cursor_loader_win.h"
24 #include "ui/platform_window/win/win_window.h" 24 #include "ui/platform_window/win/win_window.h"
25 #endif 25 #endif
26 26
27 namespace aura { 27 namespace aura {
28 #if defined(OS_ANDROID)
29 namespace {
30 WindowTreeHostPlatform* instance = nullptr;
31 }
32
33 // static
34 WindowTreeHostPlatform* WindowTreeHostPlatform::GetHost() {
35 return instance;
36 }
37 #endif
28 38
29 // static 39 // static
30 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { 40 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) {
41 #if defined(OS_ANDROID)
42 DCHECK(!instance);
43 instance = new WindowTreeHostPlatform(bounds);
44 return instance;
45 #else
31 return new WindowTreeHostPlatform(bounds); 46 return new WindowTreeHostPlatform(bounds);
47 #endif
32 } 48 }
33 49
34 WindowTreeHostPlatform::WindowTreeHostPlatform(const gfx::Rect& bounds) 50 WindowTreeHostPlatform::WindowTreeHostPlatform(const gfx::Rect& bounds)
35 : widget_(gfx::kNullAcceleratedWidget), 51 : widget_(gfx::kNullAcceleratedWidget),
36 current_cursor_(ui::kCursorNull), 52 current_cursor_(ui::kCursorNull),
37 has_capture_(false) { 53 has_capture_(false) {
38 #if defined(USE_OZONE) 54 #if defined(USE_OZONE)
39 window_ = 55 window_ =
40 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds); 56 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds);
41 #elif defined(OS_WIN) 57 #elif defined(OS_WIN)
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 DCHECK_EQ(widget, widget_); 189 DCHECK_EQ(widget, widget_);
174 widget_ = gfx::kNullAcceleratedWidget; 190 widget_ = gfx::kNullAcceleratedWidget;
175 } 191 }
176 192
177 void WindowTreeHostPlatform::OnActivationChanged(bool active) { 193 void WindowTreeHostPlatform::OnActivationChanged(bool active) {
178 if (active) 194 if (active)
179 OnHostActivated(); 195 OnHostActivated();
180 } 196 }
181 197
182 } // namespace aura 198 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window_tree_host_platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698