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

Side by Side Diff: services/native_viewport/platform_viewport_android.h

Issue 1081443005: Make the C++ PlatformViewportAndroid's dtor call the Java PVA's destroy() method. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: use a weak ref instead Created 5 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_ANDROID_H_ 5 #ifndef SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_ANDROID_H_
6 #define SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_ANDROID_H_ 6 #define SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_ANDROID_H_
7 7
8 #include "base/android/jni_weak_ref.h" 8 #include "base/android/jni_weak_ref.h"
9 #include "base/android/scoped_java_ref.h"
10 #include "base/macros.h" 9 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
12 #include "services/native_viewport/platform_viewport.h" 11 #include "services/native_viewport/platform_viewport.h"
13 #include "ui/events/event_constants.h" 12 #include "ui/events/event_constants.h"
14 #include "ui/gfx/rect.h" 13 #include "ui/gfx/rect.h"
15 #include "ui/gfx/sequential_id_generator.h" 14 #include "ui/gfx/sequential_id_generator.h"
16 #include "ui/gfx/size.h" 15 #include "ui/gfx/size.h"
17 16
18 namespace gpu { 17 namespace gpu {
19 class GLInProcessContext; 18 class GLInProcessContext;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // Overridden from PlatformViewport: 60 // Overridden from PlatformViewport:
62 virtual void Init(const gfx::Rect& bounds) override; 61 virtual void Init(const gfx::Rect& bounds) override;
63 virtual void Show() override; 62 virtual void Show() override;
64 virtual void Hide() override; 63 virtual void Hide() override;
65 virtual void Close() override; 64 virtual void Close() override;
66 virtual gfx::Size GetSize() override; 65 virtual gfx::Size GetSize() override;
67 virtual void SetBounds(const gfx::Rect& bounds) override; 66 virtual void SetBounds(const gfx::Rect& bounds) override;
68 67
69 void ReleaseWindow(); 68 void ReleaseWindow();
70 69
71 Delegate* delegate_; 70 Delegate* const delegate_;
71 JavaObjectWeakGlobalRef java_platform_viewport_android_;
72 ANativeWindow* window_; 72 ANativeWindow* window_;
73 mojo::ViewportMetricsPtr metrics_; 73 mojo::ViewportMetricsPtr metrics_;
74 ui::SequentialIDGenerator id_generator_; 74 ui::SequentialIDGenerator id_generator_;
75 75
76 base::WeakPtrFactory<PlatformViewportAndroid> weak_factory_; 76 base::WeakPtrFactory<PlatformViewportAndroid> weak_factory_;
77 77
78 DISALLOW_COPY_AND_ASSIGN(PlatformViewportAndroid); 78 DISALLOW_COPY_AND_ASSIGN(PlatformViewportAndroid);
79 }; 79 };
80 80
81 } // namespace native_viewport 81 } // namespace native_viewport
82 82
83 #endif // SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_ANDROID_H_ 83 #endif // SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698